📄 获取最新公告.frm
字号:
VERSION 5.00
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "Command.ocx"
Begin VB.Form Form19
BorderStyle = 1 'Fixed Single
Caption = "获取软件开发者的最新公告"
ClientHeight = 5310
ClientLeft = 45
ClientTop = 375
ClientWidth = 8130
LinkTopic = "Form19"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 5310
ScaleWidth = 8130
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text2
Appearance = 0 'Flat
BackColor = &H00DEF8DD&
BorderStyle = 0 'None
ForeColor = &H00008000&
Height = 3210
Left = 270
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 4
Text = "获取最新公告.frx":0000
Top = 1335
Width = 7665
End
Begin VB.TextBox Text1
BorderStyle = 0 'None
ForeColor = &H00008000&
Height = 225
Left = 645
TabIndex = 3
Text = "目标文件地址:http://www.fuhengkeji.com/BuzInfoVer.txt"
Top = 960
Width = 6960
End
Begin CSCommand.Command Command1
Height = 405
Left = 5940
TabIndex = 0
Top = 4740
Width = 1980
_ExtentX = 3493
_ExtentY = 714
IconAlign = 0
Icon = "获取最新公告.frx":0006
Caption = "下载公告文件 &D"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Shape Shape2
BackColor = &H00DEF8DD&
BackStyle = 1 'Opaque
BorderColor = &H00008000&
Height = 3285
Left = 180
Top = 1305
Width = 7800
End
Begin VB.Shape Shape1
BorderColor = &H00008000&
Height = 405
Left = 180
Shape = 4 'Rounded Rectangle
Top = 840
Width = 7800
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "此功能需要连接到互联网。"
ForeColor = &H00004000&
Height = 180
Left = 660
TabIndex = 2
Top = 525
Width = 2160
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "软件作者最新公告:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0FFC0&
Height = 210
Left = 240
TabIndex = 1
Top = 195
Width = 1890
End
Begin VB.Image Image1
Height = 1170
Left = -90
Picture = "获取最新公告.frx":0022
Top = -195
Width = 9690
End
End
Attribute VB_Name = "Form19"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/12/24
'描 述:商务名片及客户资料管理系统 Ver 1.73
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Option Explicit
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
Me.Command1.Enabled = False
Dim r As Long
Dim VerStr As String
VerStr = ""
Me.Text2.Text = ""
VerStr = "请保证本计算机连接能正常连接互联网。"
Text2.Text = VerStr
VerStr = VerStr & vbCrLf & "程序正在尝试连接目标文件并下载,这个过程需要大约半分钟,请稍候 ..." & vbCrLf
Text2.Text = VerStr
DoEvents
If Dir(App.Path & "\NowVer.txt") <> "" Then
Kill App.Path & "\NowVer.txt"
End If
DoEvents
Text2.Text = VerStr
DoEvents
r = URLDownloadToFile(0, "http://www.fuhengkeji.com/buzinfover.txt", App.Path & "\NowVer.txt", 0, 0)
DoEvents
If Dir(App.Path & "\NowVer.txt") <> "" Then
VerStr = VerStr & vbCrLf & "目标文件已经下载结束,正在打开文件,请稍候 ..."
Text2.Text = VerStr
DoEvents
Open App.Path & "\NowVer.txt" For Input As #1
DoEvents
Dim str As String
VerStr = VerStr & vbCrLf & "最新公告内容如下:" & vbCrLf
Text2.Text = VerStr
DoEvents
VerStr = VerStr & vbCrLf & "**************************************************************"
Text2.Text = VerStr
Do While Not EOF(1)
Line Input #1, str
VerStr = VerStr & vbCrLf & str
Text2.Text = VerStr
Loop
VerStr = VerStr & vbCrLf & "**************************************************************"
Text2.Text = VerStr
Close #1
Me.Command1.Enabled = True
Exit Sub
End If
VerStr = VerStr & vbCrLf & " 下载目标文件失败,请检查网络连接是否正常,并重试;" & vbCrLf & " 也可能目标文件不存在,请联系软件作者。"
Text2.Text = VerStr
Me.Command1.Enabled = True
End Sub
Private Sub Form_Load()
Me.Icon = MDIForm1.Icon
Me.BackColor = 12775616 'RGB(192, 240, 194)
Me.Text1.BackColor = Me.BackColor
Me.Text1.Locked = True
Me.Text2.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -