Yeah, I know those classes, I was just lazy :D. I was used for years on Python that I must do everything on my own. Btw I started using Path yesterday. I have made my own video player and I use the FileName property to show what is currently playing :)
2009/7/28 Cerebrus <[email protected]> > > Ah yes! Thanks a ton, Peter. > > I always seem to forget completely about Path.Combine. :-) > > On Jul 28, 12:46 am, Peter Smith <[email protected]> wrote: > > On Mon, Jul 27, 2009 at 12:59 PM, Cerebrus<[email protected]> wrote: > > > > > 2. I would use the members of the System.IO namespace instead of > > > relying on string splitting. I would do it like this: > > > > And I would use the members of the System.IO.Path namespace instead of > > relying on string building. :) > > > > Instead of: > > > > private DirectoryInfo GetExtension(FileInfo file) > > { > > string ext = file.Extension.Replace(".", ""); > > return CreateDir(this.path + "\\" + ext); > > } > > > > I would do something closer to: > > > > private DirectoryInfo GetExtension(FileInfo file) > > { > > string ext = file.Extension.Replace(".", ""); > > return CreateDir(System.IO.Path.Combine(this.path, ext)); > > } > > > > Check out > ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_fxfund/html/bf00c380-706a-4e38-b829-454a480629fc.htm > > -- it's full of tricks! >
