共用方式為


如何設定 IPDLC 連結服務

  1. 擷取命令提示字元指示。

  2. 如有必要,請擷取配接器名稱。

  3. 建立連結服務。

  4. 建立獨立會話。

    下列程式碼範例說明如何設定 IPDLC 連結服務。 下表描述相關的命令提示字元參數:

命令列參數 Description
-p PrimaryNNS:主要網路節點伺服器
-b (選擇性) BackupNNS:備份網路節點伺服器
-d (選擇性) 裝置:覆寫探索到的介面卡名稱
-l (選擇性) LenNode:用來設定 LEN 節點 (預設值為第 1)
    On Error Resume   Next  
'Declarations and Constants  
    Dim strPrimaryNNS  
    Dim strBackupNNS  
    Dim strLocalAddress  
    Dim strLenNode  
    Dim strComputerName  
    Dim wshEnvProc  
'Defaults  
    strPrimaryNNS = ""  
    strBackupNNS = ""  
    strLocalAddress = ""  
    strLenNode = "SNA Service"  
'Get the command line  
    Set objArgs = WScript.Arguments  
    For I = 0 to objArgs.Count - 1  
       select case objArgs(I)  
        Case "-p"  
            I = I + 1  
            strPrimaryNNS = objArgs(I)  
        case "-b"  
            I = I + 1  
            strBackupNNS = objArgs(I)  
        case "-d"  
            I = I + 1  
            strLocalAddress = objArgs(I)  
        case "-l"  
            I = I + 1  
            strLenNode = objArgs(I)  
        case else  
            Wscript.Echo "Script Usage: "  
            Wscript.Echo " -p Primary NNS (Required)"  
            Wscript.Echo " -b Backup NNS (Optional)"  
            wscript.echo " -d Device Name (Optional)"  
            wscript.echo " -l Len Node (Optional)"  
            return  
       end select  
    Next  
'NNS parameter is required  
    if strPrimaryNNS = "" then  
       Wscript.Echo "Please supply the -p (PrimaryNNS) parameter"  
       return  
    end if  
'See if we need to get a device  
    if strLocalAddress = "" then  
       GetAdapterName()  
    end if  
' Two methods for creating the link service and independent session connection  
    CreateIPDLCLinkService  
    CreateIndependentSession