Re: How to Get File Path

Tech-Archive recommends: Speed Up your PC by fixing your registry



Tom:

Yours is even simpler.

Venki

"Tom Shelton" wrote:

> In article <#o#N5i1pFHA.2072@xxxxxxxxxxxxxxxxxxxx>, Dustin Wilson wrote:
> > I'm looking for a quick function that will give me just the path for a file.
> > For example if I have the string "C:\Temp\MyFile.txt", I want to just return
> > just the string "C:\Temp\". How is this done using VB.NET?
> >
> > Thanks
> > Dustin
> >
> >
> Imports System.IO
>
> ....
>
> Dim fi As New FileInfo ("C:\Temp\MyFile.txt")
> Console.WriteLine (fi.DirectoryName)
>
> --
> Tom Shelton [MVP]
>
.



Relevant Pages

  • Re: Writing a new KEY-VALUE pair into configuration file
    ... Tom Shelton [MVP] ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Macros in c#
    ... in the project (or write an IDE macro or addin to do it). ... Tom Shelton [MVP] ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# property
    ... My guess is that your .FrameStyle property takes a enumerated ... Tom Shelton [MVP] ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: console app Q
    ... HTH ... Tom Shelton [MVP] ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Load class library at runtime
    ... > Plugins, etc? ... Tom Shelton [MVP] ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)