Click here to Skip to main content
15,899,825 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello

please anyone has code in Visuel studio 2010, to get only the name of file withe savefiledialog,
there is not proprité like salefilename in openfile gielog

thanks
Posted

Try:
VB
Dim sfd As New SaveFileDialog()
If sfd.ShowDialog() = DialogResult.OK Then
    Dim filenameWithPath As String = sfd.FileName
    Dim justTheFilename As String = Path.GetFileName(filenameWithPath)
End If
 
Share this answer
 
There is property named FileName that could be set or get with the full file name (including the path).

Look on this MSDN Example[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900