详细扫描不需要的文件

时间:2016-05-26 20:45:34

标签: vb.net

我正在尝试为我的服务器启动启动器,但我有点担心,是否有任何方法可以在浏览目录中列出不需要的文件,如果脚本在按下此按钮时找到任何这些文件将显示像这个警告信息,香港专业教育学院尝试了一些但没有工作

 Imports System.IO

Public Class imeprezime

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If (FolderBrowserDialog1.ShowDialog() = DialogResult.OK) Then
            TextBox2.Text = FolderBrowserDialog1.SelectedPath

        End If
    End Sub

    Private Sub connect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles connect.Click

            Dim cleoPath As String
            Dim filePath As String
            filePath = System.IO.Path.Combine(TextBox2.Text, "gta_sa.exe")
        cleoPath = System.IO.Path.Combine(TextBox2.Text, "cleo")

            If File.Exists(filePath) Then

            If Directory.Exists(cleoPath) Then

                MsgBox("Pronasli smo cleo fajl u vasem GTA root folderu. Da se konektujete na server morate ga obrisati.")

            Else

                Dim p() As Process

                p = Process.GetProcessesByName("gta_sa")

                If p.Count > 0 Then
                    MsgBox("Vec imate pokrenut GTA San Andreas.")
                Else
                    ' Process is not running
                End If

            End If


        Else
            MsgBox("Da se konektujete morate locirati GTA San Andreas folder.")
        End If
    End Sub

    Private Sub imeprezime_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

0 个答案:

没有答案