FileSystemProxy.GetName(String) Method
Definition
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
Parameters
- path
- String
Required. Path to be parsed. String
.
Returns
The file name from the specified path.
Examples
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.
Remarks
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 |
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om