|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
vb.net "getting the base name of a file"Hello,
Suppose in VB.NET I have a file at: c:\bitmaps\image1.bmp and I want to get the "basename" (ie: image1) and the "path" (ie: c:\bitmaps\) How do I go about it? It doesn't appear that io.file has these features? Thanks. I think one of the easiest ways is to use the FileInfo class.
-- Show quoteHide quoteDennis in Houston "samadams_2***@yahoo.ca" wrote: > > Hello, > > Suppose in VB.NET I have a file at: > > c:\bitmaps\image1.bmp > > and I want to get the "basename" (ie: image1) > and the "path" (ie: c:\bitmaps\) > > How do I go about it? It doesn't appear that io.file has these > features? > > Thanks. > > Look at System.IO.Path.Get<what you need>()
samadams_2***@yahoo.ca wrote: Show quoteHide quote > Hello, > > Suppose in VB.NET I have a file at: > > c:\bitmaps\image1.bmp > > and I want to get the "basename" (ie: image1) > and the "path" (ie: c:\bitmaps\) > > How do I go about it? It doesn't appear that io.file has these > features? > > Thanks. If you're using VB2005:
Console.Writeline(Path.GetDirectoryName("C:\bitmaps\image1.bmp")) will give you "C:\Bitmaps" Path also has GetFileName (image1.bmp), GetExtension (bmp), GetFileNameWithoutExtension (image), GetPathRoot (C:\) .... Robin S. -------------------------- <samadams_2***@yahoo.ca> wrote in message Show quoteHide quote news:1165537699.568234.3040@j44g2000cwa.googlegroups.com... > > Hello, > > Suppose in VB.NET I have a file at: > > c:\bitmaps\image1.bmp > > and I want to get the "basename" (ie: image1) > and the "path" (ie: c:\bitmaps\) > > How do I go about it? It doesn't appear that io.file has these > features? > > Thanks. >
DataTable FillSchema error - Pulling my hair out!
Populating combox from dataset Is this a bug I see before me, or an incomplete understanding of scope? Shared textfile...threading Namespace for stdole? Installing a windows service simple question Trigger a Help event. Look at this debugging output about TreeViews Drop shadow under image |
|||||||||||||||||||||||