也许你应该那样做
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' get desktop path for current user
TextBox3.Text = My.Computer.FileSystem.SpecialDirectories.Desktop.ToString
'strips "\Desktop"
Dim path As String = TextBox3.Text.Replace("\Desktop", "")
TextBox3.Text = path
End Sub
那么您可以Process.Start(Textbox3.Text)
获取该路径还是要删除该文件夹?
新类型,我希望它能让这件事发挥作用;)
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
' get desktop path for current user
TextBox1.Text = My.Computer.FileSystem.SpecialDirectories.Desktop.ToString
'input for username to delete
Dim usertodel As String = InputBox("Type Username:")
'strips "\Desktop" & curr user name
Dim user As String = System.Environment.UserName
Dim path1 As String = TextBox1.Text.Replace("\" & user & "\Desktop", "") '= C:\Users\
TextBox1.Text = path1 & "\" & usertodel '= C:\Users\ + input box for user
End Sub
它对我有用:)