我正在使用下面的代碼但的Visual Basic,代碼清潔
Label2.Text = "Cleaned."
If CheckBox1.Checked = True Then
On Error Resume Next
Kill("C:\Nexon\Combat Arms\*.txt")
End If
If CheckBox2.Checked = True Then
On Error Resume Next
Kill("C:\Nexon\Combat Arms\*.jpg")
End If
If CheckBox3.Checked = True Then
On Error Resume Next
Kill("C:\Nexon\Combat Arms\*.v3d")
End If
If CheckBox4.Checked = True Then
On Error Resume Next
Kill("C:\Nexon\Combat Arms\*.bin")
End If
If CheckBox5.Checked = True Then
On Error Resume Next
Kill("C:\Nexon\Combat Arms\*.dmp")
End If
If CheckBox6.Checked = True Then
On Error Resume Next
Kill("C:\Nexon\Combat Arms\*.dump")
End If
If CheckBox7.Checked = True Then
On Error Resume Next
System.IO.File.SetAttributes("C:\Nexon\Combat Arms\EndingBanner.exe", System.IO.FileAttributes.Normal)
Kill("C:\Nexon\Combat Arms\EndingBanner.exe")
End If
If CheckBox8.Checked = True Then
On Error Resume Next
System.IO.File.SetAttributes("C:\Nexon\Combat Arms\CAV.exe", System.IO.FileAttributes.Normal)
Kill("C:\Nexon\Combat Arms\CAV.exe")
End If
If CheckBox9.Checked = True Then
On Error Resume Next
If Dir("C:\Nexon\Combat Arms\MOVIES") <> "" Then
Rename("C:\Nexon\Combat Arms\Game\MOVIES", "C:\Nexon\Combat Arms\Game\CLEANED")
End If
End If
,而不是說明在我希望用戶選擇它的程序的目錄的目錄清潔劑,「C:\ Nexon公司\戰鬥Arms \「使用SelectDirectory;我有這個但是,不能讓它工作
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim MyFolderBrowser As New System.Windows.Forms.FolderBrowserDialog
Dim dlgResult As DialogResult = MyFolderBrowser.ShowDialog()
Me.FileReference.Text = MyFolderBrowser.SelectedPath
End Sub
「不能使它工作」不會告訴我們任何事情。你嘗試了什麼,以及你觀察到了什麼意外的行爲? – 2011-12-14 00:31:59