【实例简介】
【实例截图】
【核心代码】
调用方法
var changer = IpToolWrapper.GetInstance();
changer.Success = msg => MessageBox.Show(
"Success:"
msg);
changer.Error = msg => MessageBox.Show(
"Error:"
msg);
changer.ChangeIp();
核心代码:
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
using
BullSofts.ADSL.Helper;
using
BullSofts.ADSL.Helper.Model;
using
DotRas;
using
BullSofts.ADSL.Helper.Tools;
namespace
AdslDemo
{
public
partial
class
Form1 : Form
{
private
AdslData curAdsl =
null
;
public
Form1()
{
InitializeComponent();
}
private
void
btnSetAdsl_Click(
object
sender, EventArgs e)
{
SetAdslWin f =
new
SetAdslWin();
f.SetAdslCompleted = f_SetAdslCompleted;
f.Owner =
this
;
f.ShowDialog();
}
private
void
f_SetAdslCompleted(
object
sender, BullSofts.ADSL.Helper.Args.SetAdslCompletedEventArgs e)
{
MessageBox.Show(e.list.Count.ToString());
if
(e.list !=
null
&& e.list.Count > 0)
{
MessageBox.Show(e.list.First().AdslName);
curAdsl = e.list.First();
}
}
private
void
btnChangeIp_Click(
object
sender, EventArgs e)
{
//可以在 执行业务逻辑的时候 调取下面代码,自动更换IP
var changer = IpToolWrapper.GetInstance();
changer.Success = msg => MessageBox.Show(
"Success:"
msg);
changer.Error = msg => MessageBox.Show(
"Error:"
msg);
changer.ChangeIp();
}
}
}
下载声明:
1、本站所有资源、仅供学习交流,不得商业运营资源,不确保资源完整性,图片和资源仅供参考, 不提供任何技术服务。
2、本站资源均有第三方用户自行上传分享推荐,非本站自制,仅供玩家做交流学习之用!切勿用于商业用途!游戏作品版权
归原作者享有,如有版权问题,请附带版权证明至邮件,本平台将应您的要求删除。举报邮箱 :859840003@qq.com
评论