| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 400 人关注过本帖
标题:怎么直接删除绝对路径的文件
只看楼主 加入收藏
b13690976754
Rank: 1
等 级:新手上路
威 望:2
帖 子:835
专家分:7
注 册:2006-11-9
结帖率:100%
收藏
 问题点数:0 回复次数:1 
怎么直接删除绝对路径的文件
用Kill不行哟 请指点一下
搜索更多相关主题的帖子: 路径 文件 删除 
2007-05-16 16:41
西山居士
Rank: 4
等 级:贵宾
威 望:11
帖 子:581
专家分:0
注 册:2007-4-21
收藏
得分:0 

在公共模块之中:
Option Explicit

Public Const FO_MOVE = &H1
Public Const FO_COPY = &H2
Public Const FO_DELETE = &H3
Public Const FO_RENAME = &H4

Public Const FOF_NOCONFIRMATION = &H10
Public Const FOF_NOCONFIRMMKDIR = &H200
Public Const FOF_ALLOWUNDO = &H40

Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long


窗体中:

Private Sub Command1_Click()
Dim SHFileOp As SHFILEOPSTRUCT
Dim Path As String, pFrom As String, i As Integer

pFrom ="c:\abc.exe"

SHFileOp.wFunc = FO_DELETE
SHFileOp.pFrom = pFrom
SHFileOp.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION
SHFileOperation SHFileOp
End Sub


2007-05-16 16:48
快速回复:怎么直接删除绝对路径的文件
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016054 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved