急,一个字串操做的问题
dim str1 as string
dim str2 as string
dim str3 as string
比如
str1= "C:\\file\\1.txt "
怎么获取
str2= "C:\\file "
str3= "1.txt "
高手帮帮我,感激不尽
[解决办法]
Imports System.IO
Public Class Form1
Dim str1 As String
Dim str2 As String
Dim str3 As String
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
str1 = "C:\\file\\1.txt "
str2 = Path.GetDirectoryName(str1)
str3 = Path.GetFileName(str1)
MsgBox(str2)
MsgBox(str3)
End Sub
End Class