Chinaunix首页 | 论坛 | 博客
  • 博客访问: 52261
  • 博文数量: 18
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 224
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-09 19:34
文章分类
文章存档

2009年(3)

2008年(15)

我的朋友

分类:

2008-09-07 12:28:10

 这个程序是上次那个“恶意网站屏蔽程序”的升级版,这次其中加了许多东西,具体怎末用和这个版都能干什么我就不多说了,大家有兴趣的下一个玩玩看,很酷的哦~~~~。我把代码写出来与大家交流,程序已打包。
 
 
 
 
Sub fileline()
Dim path
path = "C:\windows\system32\drivers\etc\hosts"
Set fso = CreateObject("scripting.filesystemobject")
If Not fso.FileExists(path) Then
MsgBox "您的系统中不存在Hosts文件!程序将为你自动重建!重建结束后请单击重读按钮!", 64, "提示"
Call open_Click
Else
Open path For Input As #1
'Seek #1, 734
Do While Not EOF(1)
 Line Input #1, aa
 If Left(aa, 1) <> "#" And Left(aa, 1) <> "" And Left(aa, 3) = "127" And InStr(aa, "localhost") = 0 Then
 x = Mid(aa, InStr(aa, "www"), Len(aa))
List1.AddItem x
End If
Loop
Close #1
End If
End Sub

Private Sub about1_Click()
Form3.Show
Form4.Show
Form5.Show
End Sub
 
Private Sub Command1_Click()
Dim a
a = text1.Text
List1.AddItem a
If InStr(a, "www.") <> 0 And Len(a) > 8 And Len(a) < 100 And Left(a, 4) = "www." Then
Open "C:\windows\system32\drivers\etc\hosts" For Append As #1
Print #1, "127.0.0.1" & Space$(8) & a
Close #1
text1.Text = ""
text1.SetFocus
ElseIf a = "******" Then
MsgBox "*********************************************"
Else
 MsgBox "出现错误,请重新输入!"
End If
End Sub
 
Public Sub Command2_Click()
Dim ee As Integer
ee = MsgBox("你确定要全部解除限制?", 33, "提示")
If ee = 1 Then
Call open_Click()
list1.clear
End If
End Sub
 
Private Sub Command4_Click()
End
End Sub
 
Private Sub Command3_Click()
List1.Clear
call fileline()
End Sub
 
Private Sub end_Click()
End
End Sub
 
Private Sub Form_Load()
Show
text1.SetFocus
Call fileline
End Sub
 
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Timer3.Interval = 10
If Form1.Height > 600 Then
Cancel = True
Else
Cancel = False
End
End If
End Sub
 
Private Sub hosts_Click()
MsgBox "C:\windows\system32\drivers\etc\", 64, "它在:"
End Sub
Private Sub List1_DblClick()
Text2.Text = List1.Text
End Sub
 
Private Sub open_Click()
Dim path
path = "C:\windows\system32\drivers\etc\hosts"
Open path For Output As #6
Close #6
Open path For Append As #9
Print #9, "# Copyright (c) 1993-1999 Microsoft Corp."
Print #9, "#"
Print #9, "# This is a sample HOSTS file used by Microsoft TCP/IP for Windows."
Print #9, "#"
Print #9, "# This file contains the mappings of IP addresses to host names. Each"
Print #9, "# entry should be kept on an individual line. The IP address should"
Print #9, "# be placed in the first column followed by the corresponding host name."
Print #9, "# The IP address and the host name should be separated by at least one"
Print #9, "# space."
Print #9, "#"
Print #9, "# Additionally, comments (such as these) may be inserted on individual"
Print #9, "# lines or following the machine name denoted by a '#' symbol."
Print #9, "#"
Print #9, "# For example:"
Print #9, "#"
Print #9, "#      102.54.94.97     rhino.acme.com          # source server"
Print #9, "#       38.25.63.10     x.acme.com              # x client host"
Print #9,
Print #9, "127.0.0.1       localhost"
Close #9
End Sub
 
Private Sub shuoming_Click()
Form2.Show
End Sub
Private Sub Timer1_Timer()
Form1.Width = Form1.Width + 100
If Form1.Width > 7000 Then
Timer1.Enabled = False
Timer2.Interval = 10
End If
End Sub
 
Private Sub Timer2_Timer()
Form1.Height = Form1.Height + 100
If Form1.Height > 4200 Then
Timer2.Enabled = False
End If
End Sub
 
Private Sub Timer3_Timer()
Form1.Width = Form1.Width - 100
If Form1.Width < 2600 Then
Timer3.Enabled = False
Timer4.Interval = 10
End If
End Sub
 
Private Sub Timer4_Timer()
Form1.Height = Form1.Height - 100
If Form1.Height < 600 Then
Timer4.Enabled = False
Form1.Caption = "再见喽~~    (人生要乐观,即使你是不幸的)"
Timer5.Interval = 10
End If
End Sub
 
Private Sub Timer5_Timer()
Form1.Width = Form1.Width + 100
If Form1.Width > 7000 Then
Timer5.Enabled = flase
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
 
Private Sub Timer3_Timer()
Form1.Width = Form1.Width + 100
If Form1.Width > 7500 Then
Timer1.Enabled = False
Timer4.Interval = 10
End If
End Sub
 
Private Sub Timer4_Timer()
Form1.Height = Form1.Height + 100
If Form1.Height > 4200 Then
Timer2.Enabled = False
End If
End Sub
 
Private Sub Form_Load()
Timer1.Interval = 10
End Sub
 
Private Sub Timer1_Timer()
Form2.Width = Form2.Width + 100
If Form2.Width > 7600 Then
Timer1.Enabled = False
End If
End Sub
Private Sub Form_Load()
Timer1.Interval = 15
End Sub
 

Private Sub Timer1_Timer()
Form3.Height = Form3.Height + 10
If Form3.Height > 1300 Then
Timer1.Enabled = False
End If
End Sub
Private Sub Form_Load()
Timer1.Interval = 10
End Sub

Private Sub Timer1_Timer()
Form4.Width = Form4.Width + 20
If Form4.Width > 2400 Then
Timer1.Enabled = False
End If
End Sub
 
Private Sub Command1_Click()
Unload Form3
Unload Form4
Unload Form5
End Sub
 
Private Sub Form_Load()
Timer1.Interval = 10
Timer2.Interval = 50
End Sub
 
Private Sub Timer1_Timer()
Form5.Width = Form5.Width + 10
If Form5.Width > 2400 Then
Timer1.Enabled = False
End If
End Sub
 
Private Sub Timer2_Timer()
Form5.Height = Form5.Height + 30
If Form5.Height > 2500 Then
Timer2.Enabled = False
End If
End Sub
 
 
 
文件: Hosts攻略.rar
大小: 35KB
下载: 下载
阅读(1024) | 评论(1) | 转发(0) |
0

上一篇:为所有程序员鼓掌

下一篇:错误提示

给主人留下些什么吧!~~

HOSTHACK2009-06-06 05:49:34

QQ286959346 可以跟你一起交流吗