1. 怎樣用VB獲取文件的文件名(不要包含擴展名)
這樣來就可自以啦,幹嘛要這么麻煩呢? Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim a As String
a = System.IO.Path.GetFileNameWithoutExtension("c:\windows\test123.txt123")
Me.Text = a End Sub
DimdAsString
d=Dir("c:soft*.exe")
Ifd<>""ThenShell"c:soft"&d
以上代碼是假定只有一個exe文件。如果有多個exe都要執行,可以這樣:
DimdAsString
d=Dir("c:soft*.exe")
DoUntild=""
Shell"c:soft"&d
d=Dir
Loop