十年網(wǎng)站開發(fā)經(jīng)驗 + 多家企業(yè)客戶 + 靠譜的建站團隊
量身定制 + 運營維護+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
你都用.net了,這是vb的舊語法,不推薦使用。vb.net是面向?qū)ο蟮?,推薦您使用

成都創(chuàng)新互聯(lián)提供高防主機、云服務(wù)器、香港服務(wù)器、綿陽服務(wù)器托管等
dim OpF as new io.filestream(OpenFileDialog1.FileName, IO.FileMode.Open)
...
OpF.close
或是
Using OpF as new io.filestream(OpenFileDialog1.FileName, IO.FileMode.Open)
...
End Using
但是你如果執(zhí)意要用的話,也可以:
FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
...
FileClose(1) '這里可以同時關(guān)閉多個文件號,文件號之間用,隔開
appid = Shell("explorer.exe c:\windows", vbNormalNoFocus)
If appid 0 Then Shell "Taskkill /PID " appid, vbHide
在vb中關(guān)閉所有被打開的文件可以用close語句。如果指定要關(guān)閉的文件號,那就只關(guān)閉指定的文件;否則,就關(guān)閉所有已經(jīng)打開的文件。
軟糖來回答羅:通過System.Diagnostics命名空間下的Process類來關(guān)閉程序的進程
Dim?進程集合?=?Process.GetProcessesByName("進程名稱")
For?Each?進程?In?進程集合
進程.Kill()
'進程.Close()?'或者使用關(guān)閉
Next
也可以先獲取所有進程,再來判斷這些進程的名稱ProcessName
Dim?獲取本地所有進程?=?Process.GetProcesses()
For?Each?進程?In?獲取本地所有進程
If?進程.ProcessName?=?"explorer.exe"?Then?進程.Kill()
Next
你都用.net了,這是vb的舊語法,不推薦使用。vb.net是面向?qū)ο蟮?,推薦您使用
dim
opf
as
new
io.filestream(openfiledialog1.filename,
io.filemode.open)
...
opf.close
或是
using
opf
as
new
io.filestream(openfiledialog1.filename,
io.filemode.open)
...
end
using
但是你如果執(zhí)意要用的話,也可以:
fileopen(1,
openfiledialog1.filename,
openmode.input)
...
fileclose(1)
'這里可以同時關(guān)閉多個文件號,文件號之間用,隔開