コード例 #1
0
        // Token: 0x0600008C RID: 140 RVA: 0x00005B58 File Offset: 0x00003D58
        public RasPhoneBook SetPhoneBookPPTP(string server, RasPhoneBook myPB, string sVPNPrefix)
        {
            myPB = this.ClearPhoneBook(myPB, sVPNPrefix);
            RasDevice pptpDevice = ConnectorVPN.GetPptpDevice(RasDevice.GetDevices());

            if (pptpDevice != null)
            {
                RasEntry item = RasEntry.CreateVpnEntry(sVPNPrefix, server, RasVpnStrategy.PptpOnly, pptpDevice, true);
                myPB.Entries.Add(item);
            }
            return(myPB);
        }
コード例 #2
0
        // Token: 0x0600008D RID: 141 RVA: 0x00005BA4 File Offset: 0x00003DA4
        public RasPhoneBook SetPhoneBookL2TP(string server, RasPhoneBook myPB, string sVPNPrefix, string sSharedKey)
        {
            myPB = this.ClearPhoneBook(myPB, sVPNPrefix);
            RasDevice l2tpDevice = ConnectorVPN.GetL2tpDevice(RasDevice.GetDevices());

            if (l2tpDevice != null)
            {
                RasEntry rasEntry = RasEntry.CreateVpnEntry(sVPNPrefix, server, RasVpnStrategy.L2tpOnly, l2tpDevice, true);
                rasEntry.Options.UsePreSharedKey     = true;
                rasEntry.Options.UseLogOnCredentials = true;
                myPB.Entries.Add(rasEntry);
                rasEntry.UpdateCredentials(RasPreSharedKey.Client, sSharedKey);
            }
            return(myPB);
        }