VB 检测桌面上的记事本文件,发现记事本内容是123就删除这个记事本文件
VB检测桌面上的记事本文件,发现记事本内容是123就删除这个记事本文件就是打开程序后不停的循环检测桌面上的所有记事本如果记事本内容中含有123就把这个记事本删除跪求各位高...
VB 检测桌面上的记事本文件,发现记事本内容是123就删除这个记事本文件
就是打开程序后不停的循环检测桌面上的所有记事本如果记事本内容中含有123就把这个记事本删除 跪求各位高手发送工程源代码至:1033628415@qq.com(请注明您的ID好给分)
谁的代码简单易懂就选谁!代码精炼简洁追加20分 展开
就是打开程序后不停的循环检测桌面上的所有记事本如果记事本内容中含有123就把这个记事本删除 跪求各位高手发送工程源代码至:1033628415@qq.com(请注明您的ID好给分)
谁的代码简单易懂就选谁!代码精炼简洁追加20分 展开
3个回答
展开全部
在窗体新建一个文件框和一个timer
Private Sub Form_Load()
File1.Path = "C:\Documents and Settings\Administrator\桌面"
File1.Pattern = "*.txt"
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim strtxt As String
If File1.ListCount > 0 Then
For i = 0 To File1.ListCount - 1
Open "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt" For Input As #1
Do While Not EOF(1)
strtxt = strtxt & Input(1, 1)
Loop
If InStr(strtxt, "123") > 0 Then Kill "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt"
Next i
End If
File1.Refresh
End Sub
Private Sub Form_Load()
File1.Path = "C:\Documents and Settings\Administrator\桌面"
File1.Pattern = "*.txt"
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim strtxt As String
If File1.ListCount > 0 Then
For i = 0 To File1.ListCount - 1
Open "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt" For Input As #1
Do While Not EOF(1)
strtxt = strtxt & Input(1, 1)
Loop
If InStr(strtxt, "123") > 0 Then Kill "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt"
Next i
End If
File1.Refresh
End Sub
追问
不行啊
Open "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt" For Input As #1
卡在这段
能不能直接把工程发给我?
追答
在窗体新建一个文件框和一个timer
Private Sub Form_Load()
File1.Path = "C:\Documents and Settings\Administrator\桌面"
File1.Pattern = "*.txt"
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim strtxt As String
If File1.ListCount > 0 Then
For i = 0 To File1.ListCount - 1
Open "C:\Documents and Settings\Administrator\桌面\" & File1.List(i ) & ".txt" For Input As #1
Do While Not EOF(1)
strtxt = strtxt & Input(1, 1)
Loop
If InStr(strtxt, "123") > 0 Then Kill "C:\Documents and Settings\Administrator\桌面\" & File1.List(i ) & ".txt"
Next i
End If
File1.Refresh
End Sub
不好意思啊
一个参数错了
我以重发了一下
展开全部
在窗体新建一个文件框和一个timer
Private Sub Form_Load()
File1.Path = "C:\Documents and Settings\Administrator\桌面"
File1.Pattern = "*.txt"
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim strtxt As String
If File1.ListCount > 0 Then
For i = 0 To File1.ListCount - 1
Open "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt" For Input As #1
Do While Not EOF(1)
strtxt = strtxt & Input(1, 1)
Loop
If InStr(strtxt, "123") > 0 Then Kill "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt"
Next i
End If
File1.Refresh
End Sub 追问不行啊
Open "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt" For Input As #1
卡在这段
能不能直接把工程发给我?
Private Sub Form_Load()
File1.Path = "C:\Documents and Settings\Administrator\桌面"
File1.Pattern = "*.txt"
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim strtxt As String
If File1.ListCount > 0 Then
For i = 0 To File1.ListCount - 1
Open "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt" For Input As #1
Do While Not EOF(1)
strtxt = strtxt & Input(1, 1)
Loop
If InStr(strtxt, "123") > 0 Then Kill "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt"
Next i
End If
File1.Refresh
End Sub 追问不行啊
Open "C:\Documents and Settings\Administrator\桌面\" & File1.List(i - 1) & ".txt" For Input As #1
卡在这段
能不能直接把工程发给我?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询