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

📄 frmpass.frm

📁 用VB调用SSH控件
💻 FRM
📖 第 1 页 / 共 3 页
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form FrmPass 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Password"
   ClientHeight    =   1080
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4890
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1080
   ScaleWidth      =   4890
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "返回"
      Height          =   375
      Left            =   3840
      TabIndex        =   6
      Top             =   600
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   3840
      TabIndex        =   5
      Top             =   120
      Width           =   975
   End
   Begin VB.TextBox Text3 
      Height          =   270
      Left            =   1800
      TabIndex        =   4
      Top             =   1560
      Width           =   1335
   End
   Begin VB.TextBox Text2 
      Height          =   270
      Left            =   240
      TabIndex        =   3
      Top             =   1560
      Width           =   1455
   End
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   2880
      Top             =   600
   End
   Begin MSWinsockLib.Winsock Winsock1 
      Left            =   2400
      Top             =   600
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin MSWinsockLib.Winsock WinSockCtl 
      Left            =   1920
      Top             =   600
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.TextBox Text1 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1200
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   120
      Width           =   2535
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      BorderStyle     =   1  'Fixed Single
      Height          =   255
      Left            =   0
      TabIndex        =   2
      Top             =   480
      Width           =   1815
   End
   Begin VB.Label Label1 
      Caption         =   "登陆验证口令:"
      Height          =   255
      Left            =   0
      TabIndex        =   0
      Top             =   120
      Width           =   1335
   End
End
Attribute VB_Name = "FrmPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strCharB, strCharA
  Dim strSectionTemp As String
  Dim strNameTemp As String
  Dim strReturn As String
  Dim strip As String
Dim strpost As String
Dim strname As String
Dim itwms As ListItem
Dim conent As Integer
'递归远程资源目录
Dim SendData As String
Dim ScanRun As Boolean
Dim WaitForInfo As Boolean
Dim StoredData(0 To 10) As String

Function setProfile(strFileName As String, strSection As String, strname As String, strSave As String) As Boolean
  '这个函数是用来对INI文件进行写操作的
  '函数说明:
  'strFileName 是所要存储的文件名
  'strSection  是这个文件中的一个节点名
  'strName 是所要查找的字段名
  'strSave 是所要替换字段值
  '薛向华 1998/05/13
  
  Dim strtemp As String
  Dim strfileback As String
  Dim strReturn As String
  strfileback = App.Path & "\系统文件\System.tmp" '临时文件是用来存放中转信息的
  
  Open strFileName For Input As #1
  Open strfileback For Output As #2
   Do While Not EOF(1)
    Line Input #1, strtemp
    strReturn = strtemp
    Print #2, strReturn
    If InStr(1, Trim(strtemp), "[") <> 0 Then
      If InStr(1, Trim(strtemp), Trim(strSection)) <> 0 Then
        Do While Not EOF(1)
            Line Input #1, strtemp
            If InStr(1, Trim(strtemp), Trim(strname)) <> 0 Then Exit Do  '找到所要修改的字段值
            strReturn = strtemp
            Print #2, strReturn  '拷贝不需要的字段值
         Loop
         strReturn = strname & "=" & strSave  '修改
         Print #2, strReturn
      End If
    End If
   Loop
  Close #1
  Close #2
  Open strfileback For Input As #1
  Open strFileName For Output As #2
  Do While Not EOF(1) And EOF(2)
  Line Input #1, strReturn
   Print #2, strReturn
  Loop
  Close #1
  Close #2
End Function

Function setProfile2(strFileName As String, strSection As String, strname As String, strSave As String) As Boolean
  '这个函数是用来对INI文件进行写操作的
  '函数说明:
  'strFileName 是所要存储的文件名
  'strSection  是这个文件中的一个节点名
  'strName 是所要查找的字段名
  'strSave 是所要替换字段值
  '薛向华 1998/05/13
  
  Dim strtemp As String
  Dim strfileback As String
  Dim strReturn As String
  strfileback = App.Path & "\系统文件\err.tmp" '临时文件是用来存放中转信息的
  
  Open strFileName For Input As #1
  Open strfileback For Output As #2
   Do While Not EOF(1)
    Line Input #1, strtemp
    strReturn = strtemp
    Print #2, strReturn
    If InStr(1, Trim(strtemp), "[") <> 0 Then
      If InStr(1, Trim(strtemp), Trim(strSection)) <> 0 Then
        Do While Not EOF(1)
            Line Input #1, strtemp
            If InStr(1, Trim(strtemp), Trim(strname)) <> 0 Then Exit Do  '找到所要修改的字段值
            strReturn = strtemp
            Print #2, strReturn  '拷贝不需要的字段值
         Loop
         strReturn = strname & "=" & strSave  '修改
         Print #2, strReturn
      End If
    End If
   Loop
  Close #1
  Close #2
  Open strfileback For Input As #1
  Open strFileName For Output As #2
  Do While Not EOF(1) And EOF(2)
  Line Input #1, strReturn
   Print #2, strReturn
  Loop
  Close #1
  Close #2
End Function

Function GetProfile2(strFileName As String, strSection As String, strname As String) As String
  '这个函数是用来对INI文件进行读操作的
  '函数说明:
  'strFileName 是所要读取的文件名
  'strSection  是这个文件中的一个节点名
  'strName 是所要查找的字段名
  '返回值:
  '薛向华 1998/05/13
   strSectionTemp = ""
   strNameTemp = ""
   strReturn2 = ""
   On Error GoTo ErrSrchSection
   Open strFileName For Input As #1
   ' 下面这段程序是用来查找节点的
     Do While Not EOF(1)
        strCharA = Input(1, #1)
        If strCharA = "[" Then
           Do While Not EOF(1)
             strCharB = Input(1, #1)
             If strCharB = "]" Then Exit Do
             strSectionTemp = strSectionTemp & strCharB
           Loop
        End If
        If strSectionTemp = strSection Then
          strCharA = Input(2, #1)
          Exit Do
        Else
          strSectionTemp = ""
        End If
     Loop
 On Error GoTo ErrReadFile
  
AA:
    '下面这段程序是用来查找所要查找的字段的
    strNameTemp = ""
    Do While Not EOF(1)
      strCharA = Input(1, #1)
      If strCharA <> "=" Then
        strNameTemp = strNameTemp & strCharA  '得到名称
      Else
        Exit Do
      End If
    Loop
        If strNameTemp = strname Then
       Line Input #1, strReturn2 '如果找到与它匹配的字段名,就返回得到的值
    Else
       Line Input #1, strReturn2  '如果未找到与它匹配的字段名,就继续找
       GoTo AA
    End If
    Close #1
    GetProfile2 = strReturn2
    Exit Function
ErrReadFile:
  
          Exit Function
      
ErrSrchSection:
     MsgBox "节点未找到", vbOKOnly
     GetProfile2 = ""
     Close #1
End Function

Function GetProfile(strFileName As String, strSection As String, strname As String) As String
  '这个函数是用来对INI文件进行读操作的
  '函数说明:
  'strFileName 是所要读取的文件名
  'strSection  是这个文件中的一个节点名
  'strName 是所要查找的字段名
  '返回值:
  '薛向华 1998/05/13
   strSectionTemp = ""
   strNameTemp = ""
   strReturn = ""
   On Error GoTo ErrSrchSection
   Open strFileName For Input As #1
   ' 下面这段程序是用来查找节点的
     Do While Not EOF(1)
        strCharA = Input(1, #1)
        If strCharA = "[" Then
           Do While Not EOF(1)
             strCharB = Input(1, #1)
             If strCharB = "]" Then Exit Do
             strSectionTemp = strSectionTemp & strCharB
           Loop
        End If
        If strSectionTemp = strSection Then
          strCharA = Input(2, #1)
          Exit Do
        Else
          strSectionTemp = ""
        End If
     Loop
 On Error GoTo ErrReadFile
  
AA:
    '下面这段程序是用来查找所要查找的字段的

⌨️ 快捷键说明

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