FileSystemProxy.GetName(String) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Parses the file name out of the path provided.
public:
System::String ^ GetName(System::String ^ path);
public string GetName(string path);
member this.GetName : string -> string
Public Function GetName (path As String) As String
- path
- String
Required. Path to be parsed. String
.
The file name from the specified path.
The following example parses a file path and returns the name of the file.
MsgBox("The filename is: " &
My.Computer.FileSystem.GetName("C:\testdirectory\testfile"))
Replace the path C:\Testdirectory\Testfile
with the path you wish to parse.
This is a string operation; the FileSystem
is not examined.
The GetName
method ignores a slash mark occurring at the end of the path.
The following table lists examples of tasks involving the My.Computer.FileSystem.GetFileName
method.
To | See |
---|---|
Parse a file path | How to: Parse File Paths |
Produkt | Versioner |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 5, 6, 7, 8, 9, 10 |
Feedback om .NET
.NET är ett öppen källkod projekt. Välj en länk för att ge feedback: