⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmoption.frm

📁 本程序可以设置本机自动与Internet时间同步。
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmOption 
   Caption         =   "系统设置"
   ClientHeight    =   3045
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4815
   LinkTopic       =   "Form1"
   ScaleHeight     =   3045
   ScaleWidth      =   4815
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdSave 
      Caption         =   "保存(&S)"
      Height          =   375
      Left            =   3000
      TabIndex        =   11
      Top             =   2640
      Width           =   855
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "关闭(&E)"
      Height          =   375
      Left            =   3960
      TabIndex        =   3
      Top             =   2640
      Width           =   855
   End
   Begin VB.Frame Frame2 
      Caption         =   "同步网络时间"
      Height          =   1575
      Left            =   0
      TabIndex        =   1
      Top             =   960
      Width           =   4815
      Begin VB.TextBox txtTimer 
         Alignment       =   2  'Center
         Height          =   270
         Left            =   1320
         TabIndex        =   9
         Text            =   "1"
         Top             =   1020
         Width           =   735
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   1320
         TabIndex        =   5
         Text            =   "Combo1"
         Top             =   300
         Width           =   3255
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "分钟"
         Height          =   180
         Left            =   2160
         TabIndex        =   10
         Top             =   1080
         Width           =   360
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "同步频率:"
         Height          =   180
         Left            =   300
         TabIndex        =   8
         Top             =   1080
         Width           =   810
      End
      Begin VB.Label labContent 
         AutoSize        =   -1  'True
         Height          =   180
         Left            =   1320
         TabIndex        =   7
         Top             =   720
         Width           =   90
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "位置:"
         Height          =   180
         Left            =   660
         TabIndex        =   6
         Top             =   720
         Width           =   450
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "时间服务器:"
         Height          =   180
         Left            =   120
         TabIndex        =   4
         Top             =   360
         Width           =   990
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "设置"
      Height          =   855
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   4815
      Begin VB.CheckBox Check1 
         Caption         =   "开机自动运行"
         Height          =   255
         Left            =   120
         TabIndex        =   2
         Top             =   360
         Width           =   2175
      End
   End
End
Attribute VB_Name = "frmOption"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub cmdSave_Click()
    If Check1 Then
        SetAutoRun (True)
    Else
        SetAutoRun (False)
    End If
    strServer = Combo1.List(Combo1.ListIndex)
    valTimer = CLng(txtTimer.Text)
    ckRun = Check1.Value
    iniOp.Setstr "Options", "TimeServer", strServer
    iniOp.Setstr "Options", "SynTimer", valTimer
    iniOp.Setstr "Options", "AutoRun", ckRun
    Unload Me
End Sub

Private Sub Combo1_Click()
    Select Case Combo1.ListIndex
        Case 0
            labContent.Caption = "NIST, Gaithersburg, Maryland"
        Case 1
            labContent.Caption = "NIST, Gaithersburg, Maryland"
        Case 2
            labContent.Caption = "NIST, Boulder, Colorado"
        Case 3
            labContent.Caption = "NIST, Boulder, Colorado"
        Case 4
            labContent.Caption = "NIST, Boulder, Colorado"
        Case 5
            labContent.Caption = "NCAR, Boulder, Colorado"
        Case 6
            labContent.Caption = "Microsoft, Redmond, Washington"
        Case 7
            labContent.Caption = "Datum, San Jose, California"
        Case 8
            labContent.Caption = "TrueTime, AOL facility, Sunnyvale, CA"
    End Select
End Sub

Private Sub Form_Load()
    Set iniOp = New clsIniOp
    With iniOp
        .Inipath = App.Path & "\Config.ini" '指定路径
        valTimer = .Getstr("Options", "SynTimer", "1")
        strServer = .Getstr("Options", "TimeServer", "time-nw.nist.gov")
        ckRun = .Getstr("Options", "AutoRun", "0")
    End With
    Check1.Value = ckRun
    With Combo1
        .AddItem "time-a.nist.gov"
        .AddItem "time-b.nist.gov"
        .AddItem "time-a.timefreq.bldrdoc.gov"
        .AddItem "time-b.timefreq.bldrdoc.gov"
        .AddItem "time-c.timefreq.bldrdoc.gov"
        .AddItem "time.nist.gov"
        .AddItem "time-nw.nist.gov"
        .AddItem "nist1.datum.com"
        .AddItem "nist1.aol-ca.truetime.com"
        '.ListIndex = 6
        .Text = strServer
    End With
    Set m_ud = New CUpDown
    With m_ud
        .Min = 1
        .Max = 1440
        Set .Buddy = txtTimer
        .Value = valTimer
    End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set iniOp = Nothing
    Set m_ud = Nothing
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -