1
Answer

how to get the filename using path in vb.net using c#

narasiman rao

narasiman rao

9y
938
1
  I am retrieving the drafts folder file name from c folder.
   In c folder file as follows
  C:\Drafts\AFF.htm.

  for retrieving the filename code as follows in vb.net 
 Dim strpath As String = "C:\Drafts\"
 Foldername = Directory.GetFiles(strpath, "*", SearchOption.TopDirectoryOnly)

 When i  run and debug in foldername path as follows
 C:\Drafts\AFF.htm.

 i have one label in that label i want to store the AFF name.
 after 2nd backslash AFF is there.
i want to retrieve AFF after 2nd slash AFF is there.

  C:\Drafts\AFF.htm
  From the above path how to get AFF name after Back Slash.
for that how can i write the code in vb.net.

Answers (1)