抓取onceclick的發佈路徑的程式碼

            Dim strDirectoryName As String = ""
            Dim UserName() As String = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Split("\")
            If UserName.Length > 1 Then
                strDirectoryName = "C:\Documents and Settings\" + UserName(1) + "\Local Settings\Apps\2.0\"
            Else
                strDirectoryName = "C:\Documents and Settings\" + UserName(0) + "\Local Settings\Apps\2.0\"
            End If
            Dim fs, f As Object
            Dim MaxFile As String = ""
            Dim update As Date

            For Each foundFile As String In My.Computer.FileSystem.GetFiles(strDirectoryName, FileIO.SearchOption.SearchAllSubDirectories, "POS_Stage.exe")

                fs = CreateObject("Scripting.FileSystemObject")
                f = fs.GetFile(foundFile)

                If Date.Compare(f.DateLastModified(), update) > 0 Then
                    update = f.DateLastModified()
                    MaxFile = foundFile
                End If
            Next
            If Application.ExecutablePath.ToString() <> MaxFile.ToString() Then
                Shell(MaxFile.ToString())
                Application.Exit()
                Application.ExitThread()

            End If

arrow
arrow
    文章標籤
    vb onceclick
    全站熱搜
    創作者介紹
    創作者 雀悦 的頭像
    雀悦

    雀悅 - 恢復自由了

    雀悦 發表在 痞客邦 留言(0) 人氣()