Option Explicit Private Const FO_DELETE = &H3 Private Const FOF_ALLOWUNDO = &H40 Private Const FOF_NOCONFIRMATION = &H10 Private Type SHFILEOPSTRUCT hwnd As Long wFunc As Long pFrom As String pTo As String fFlags As Long fAnyOperationsAborted As Long hNameMappings As Long lpszProgressTitle As String End Type Private Declare Function SHFileOperation Lib "Shell32" Alias "SHFileOperationA" (ByRef lpFileOp As SHFILEOPSTRUCT) As Long '******************************************************* ' '本程序是给经常掉线且没有插件的玩家使用 ' '****************安装插件者禁止使用***************** '****************安装插件者禁止使用***************** '****************安装插件者禁止使用***************** '****************安装插件者禁止使用***************** '****************安装插件者禁止使用***************** '****************安装插件者禁止使用***************** '****************安装插件者禁止使用***************** ' '程序运行完会自动启动魔兽世界 ' '******************************************************* Private Sub Form_Load() Dim wow, str, dstr, arr, darr, i Dim sh As SHFILEOPSTRUCT sh.fFlags = FOF_ALLOWUNDO Or FOF_NOCONFIRMATION sh.wFunc = FO_DELETE wow = "E:\World of Warcraft" '********************************************************** 'wow为魔兽世界的文件夹,玩家根据自己的路径修改 '********************************************************** str = wow & "\Cache" & "|||" & wow & "\Interface" & "|||" & wow & "\WTF" dstr = "Cache" & "|||" & "Interface" & "|||" & "WTF" arr = Split(str, "|||") darr = Split(dstr, "|||") If Dir(wow, vbDirectory) <> "" Then '判断文件夹是否存在 For i = 0 To UBound(arr) sh.pFrom = arr(i) If Dir(sh.pFrom, vbDirectory) <> "" Then If InStr(sh.pFrom, darr(i)) <> 0 Then Call SHFileOperation(sh) '放入回收站 End If End If Next i If Dir(wow & "\World of Warcraft Launcher.exe", vbDirectory) <> "" Then Shell wow & "\World of Warcraft Launcher.exe", vbHide '启动客户端程序 Else MsgBox "客户端不存在!" End If Else MsgBox "魔兽文件夹不存在!" End If End End Sub
热门文章更多>>
标签更多>>
专题更多>>
最新文章更多>>
- 团队城市未满足要求:MSBuildTools12.0_x86_Path 存在
- 使用 MSBuild.exe 在发布模式下构建 C# 解决方案
- 当我发布 Web 应用程序时,AfterPublish 脚本不运行
- 构建时 T4 转换的产品仅在下一个构建中使用
- ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json
- 新的 .csproj 格式 - 如何将整个目录指定为“链接文件"到子目录?
- 如何将条件编译符号(DefineConstants)传递给 msbuild
- MSBuild 支持 Visual Studio 2017 RTM 中的 T4 模板
- NuGet 包还原找不到包,没有源
- 使用 C# 6.0 功能运行 TFS 构建