vb 如何每按一次按钮就生成一个TXT文件?

2025-04-30 04:01:41
推荐回答(1个)
回答1:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1

打开:
ShellExecute 0, "open", "c:\1.txt", "", vbNullString, SW_SHOWNORMAL

"c:\1.txt", ""
分别为文件路径和执行参数(一般是exe)