📄 serverdt.frm
字号:
VERSION 5.00
Begin VB.Form frmRemoteServerDetails
BorderStyle = 3 'Fixed Dialog
Caption = "#"
ClientHeight = 4545
ClientLeft = 3195
ClientTop = 2400
ClientWidth = 7800
ControlBox = 0 'False
Icon = "serverdt.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4545
ScaleWidth = 7800
Begin VB.CommandButton cmdCancel
Caption = "Cancel"
Height = 375
Left = 5580
MaskColor = &H00000000&
TabIndex = 5
Top = 3930
Width = 1935
End
Begin VB.CommandButton cmdOK
Caption = "&Ok"
Default = -1 'True
Enabled = 0 'False
Height = 375
Left = 3540
MaskColor = &H00000000&
TabIndex = 4
Top = 3930
Width = 1935
End
Begin VB.ComboBox cboNetworkProtocol
Height = 300
Left = 2400
Style = 2 'Dropdown List
TabIndex = 3
Top = 3165
Width = 5100
End
Begin VB.TextBox txtNetworkAddress
Height = 300
Left = 2400
TabIndex = 1
Top = 2535
Width = 5100
End
Begin VB.Frame Frame1
Height = 555
Left = 225
TabIndex = 7
Top = 1395
Width = 7290
Begin VB.Label lblServerName
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "#"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 135
TabIndex = 8
Top = 240
Width = 7020
WordWrap = -1 'True
End
End
Begin VB.Label lblNetworkProtocol
AutoSize = -1 'True
Caption = "Network &Protocol"
Height = 195
Left = 210
TabIndex = 2
Top = 3165
Width = 2100
WordWrap = -1 'True
End
Begin VB.Label lblNetworkAddress
AutoSize = -1 'True
Caption = "Network &Address"
Height = 195
Left = 225
TabIndex = 0
Top = 2535
Width = 2100
WordWrap = -1 'True
End
Begin VB.Label lblRemoteServerDetails
AutoSize = -1 'True
Caption = "Please fill in the requested configuration information about the following remote component:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 480
Left = 360
TabIndex = 6
Top = 360
Width = 7020
WordWrap = -1 'True
End
End
Attribute VB_Name = "frmRemoteServerDetails"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Compare Text
Private m_fNetworkAddressSpecified As Boolean
Private m_fNetworkProtocolSpecified As Boolean
Private m_fDCOM As Boolean
Private Declare Function RpcNetworkIsProtseqValid Lib "rpcrt4.dll" Alias "RpcNetworkIsProtseqValidA" (ByVal strProtseq As String) As Long
' Determines whether a given protocol sequence is supported and available on this machine
Function fIsProtocolSeqSupported(ByVal strProto As String, ByVal strProtoFriendlyName) As Boolean
Const RPC_S_OK = 0&
Const RPC_S_PROTSEQ_NOT_SUPPORTED = 1703&
Const RPC_S_INVALID_RPC_PROTSEQ = 1704&
Dim rcps As Long
Static fUnexpectedErr As Boolean
On Error Resume Next
fIsProtocolSeqSupported = False
rcps = RpcNetworkIsProtseqValid(strProto)
Select Case rcps
Case RPC_S_OK
fIsProtocolSeqSupported = True
Case RPC_S_PROTSEQ_NOT_SUPPORTED
LogNote ResolveResString(resNOTEPROTOSEQNOTSUPPORTED, "|1", strProto, "|2", strProtoFriendlyName)
Case RPC_S_INVALID_RPC_PROTSEQ
LogWarning ResolveResString(resNOTEPROTOSEQINVALID, "|1", strProto, "|2", strProtoFriendlyName)
Case Else
If Not fUnexpectedErr Then
MsgWarning ResolveResString(resPROTOSEQUNEXPECTEDERR), vbOKOnly Or vbInformation, gstrTitle
If gfNoUserInput Then
'
' This is probably redundant since this form should never
' be shown if we are running in silent or SMS mode.
'
ExitSetup frmRemoteServerDetails, gintRET_FATAL
End If
fUnexpectedErr = True
End If
'End Case
End Select
End Function
Private Sub cboNetworkProtocol_Click()
cmdOK.Enabled = fValid()
End Sub
Private Sub cmdCancel_Click()
ExitSetup frmRemoteServerDetails, gintRET_EXIT
End Sub
Private Sub cmdOK_Click()
Hide
End Sub
Private Sub Form_Load()
InitCommonControls
Dim fMoveControlsUp As Boolean 'Whether or not to move controls up to fill in an empty space
Dim yTopCutoff As Integer 'We will move all controls lower down than this y value
SetFormFont Me
Caption = ResolveResString(resREMOTESERVERDETAILSTITLE)
lblRemoteServerDetails.Caption = ResolveResString(resREMOTESERVERDETAILSLBL)
lblNetworkAddress.Caption = ResolveResString(resNETWORKADDRESS)
lblNetworkProtocol.Caption = ResolveResString(resNETWORKPROTOCOL)
cmdOK.Caption = ResolveResString(resOK)
cmdCancel.Caption = ResolveResString(resCANCEL)
'
' We don't care about protocols if this is DCOM.
'
If Not m_fDCOM Then
FillInProtocols
End If
'Now we selectively turn on/off the available controls depending on how
' much information we need from the user.
If m_fNetworkAddressSpecified Then
'The network address has already been filled in, so we can hide this
' control and move all the other controls up
txtNetworkAddress.Visible = False
lblNetworkAddress.Visible = False
fMoveControlsUp = True
yTopCutoff = txtNetworkAddress.Top
ElseIf m_fNetworkProtocolSpecified Or m_fDCOM Then
'The network protocol has already been filled in, so we can hide this
' control and move all the other controls up
cboNetworkProtocol.Visible = False
lblNetworkProtocol.Visible = False
fMoveControlsUp = True
yTopCutoff = cboNetworkProtocol.Top
End If
If fMoveControlsUp Then
'Find out how much to move the controls up
Dim yDiff As Integer
yDiff = cboNetworkProtocol.Top - txtNetworkAddress.Top
Dim c As Control
For Each c In Controls
If c.Top > yTopCutoff Then
c.Top = c.Top - yDiff
End If
Next c
'Finally, shrink the form
Height = Height - yDiff
End If
'Center the form
Top = (Screen.Height - Height) \ 2
Left = (Screen.Width - Width) \ 2
End Sub
'-----------------------------------------------------------
' SUB: GetServerDetails
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -