Private Sub Command1_Click()
If Me.Text1 = "123" And Me.Text2 = "1234" Then
   Form2.Show    'Submit
End If
If Me.Check1.Value = 1 Then
    If GetSetting("Record", "Setting", "User") = "" Then
        SaveSetting "Record", "Setting", "User", "123"
        SaveSetting "Record", "Setting", "PrassWord", "1234"
        SaveSetting "Record", "Setting", "Auto", "1"
    End If
Else
    If GetSetting("Record", "Setting", "User") <> "" Then
    DeleteSetting "Record"
End IfEnd If
End SubPrivate Sub Form_Load()
Me.Text1 = GetSetting("Record", "Setting", "User")
Me.Text2 = GetSetting("Record", "Setting", "PrassWord")If Me.Text1 = "123" And Me.Text2 = "1234" Then
    Form2.Show       'Auto Submit
    Me.Check1.Value = 1
End IfEnd Sub
用了两个form,两个text,一个check,一个command

解决方案 »

  1.   

    各位高手大侠,可不可以帮我解释下 GetSetting( "Record ",   "Setting ",   "User ")   =   " " 等是什么意思?
    万分感谢!
      

  2.   

    http://www.d270.com/online_help/VBhanshu/contents/GetSetting.htm
      

  3.   

    MSDN帮助里不是有吗?
    GetSetting(appname, section, key[, default])appname 必要。字符串表达式,包含应用程序或工程的名称,要求这些应用程序或工程有注册表项设置。 
    section 必要。字符串表达式,包含区域名称,要求该区域有注册表项设置。 
    key 必要。字符串表达式,返回注册表项设置的名称。 
    default 可选。表达式,如果注册表项设置中没有设置值,则返回缺省值。如果省略,则 default 取值为长度为零的字符串 ("")。 
      

  4.   

    你可以讲具体一点?包含应用程序或工程的名称,包含区域名称,返回注册表项设置的名称,究竟指什么?
    等待中
    den
      

  5.   

    那我问你GetSetting(   "Record   ",       "Setting   ",       "User   ")  得到的是什么?
      

  6.   

    SaveSetting   "Record ",   "Setting ",   "User ",   "123 "GetSetting( "Record ",   "Setting ",   "User ")