///定义Ini写入对象///privateIniWriteini=newIniWrite(ADSLPath);//////判断第一登录///privateboolIsFirst=true;/////////privateMD5.DES.Md5Classmd5=newMD5.DES.Md5Class();/////////publicstaticstringkey=null;#endregion//////构造函数///publicfrmMain(){InitializeComponent();}#region窗体事件//////窗体初始/////////privatevoidfrmMain_Load(objectsender,EventArgse){SetToolTip();IntiLoad(sender,e);}#endregion#region控件按钮事件//////复制账号/////////privatevoidbtnCopyAccount_Click(objectsender,EventArgse){if(this.chkSpecial.Checked)//判断特殊拨号是否勾选{//进行加密UsernameEncodeencode=newUsernameEncode();Clipboard.SetDataObject(encode.EncodeUsername(this.txtAccount.Text,this.txtPassword.Text));}else{Clipboard.SetDataObject(this.txtAccount.Text);}MessageBox.Show("账号已经复制到剪贴板!","复制成功");}//////拨号/////////privatevoidbtnDia_Click(objectsender,EventArgse){if(this.txtAccount.Text.Trim()==""){MessageBox.Show("账号不能为空","输入错误");txtAccount.Focus();return;}if(this.txtPassword.Text.Trim()==""){MessageBox.Show("密码不能为空","输入错误");txtPassword.Focus();return;}this.NetDia();}//////找不到电话簿?/////////privatevoidlblNotFind_LinkClicked(objectsender,LinkLabelLinkClickedEventArgse){this.CreateConnections();}//////记住账号联动/////////privatevoidchkRemAccount_CheckedChanged(objectsender,EventArgse){if(!this.chkRemAccount.Checked){this.chkRemPassword.Checked=false;}}//////记住密码联动/////////privatevoidchkRemPassword_CheckedChanged(objectsender,EventArgse){if(this.chkRemPassword.Checked){this.chkRemAccount.Checked=true;}}//////自动登录启动/////////privatevoidAutoConectTimer_Tick(objectsender,EventArgse){this.AutoConectTimer.Enabled=false;newfrmLinkInfo(this).Show();base.Hide();}#endregion#region自定义方法//////初始登录/////////privatevoidIntiLoad(objectsender,EventArgse){FileInfoinfo=newFileInfo(ADSLPath);try{if(info.Exists){this.ReadConfig();}if(this.chkAutoDia.Checked)//是否自动登录{this.AutoConectTimer.Start();}}catch(Exception){File.Delete(ADSLPath);this.frmMain_Load(sender,e);}}//////设置控件提示///privatevoidSetToolTip(){ToolTiptip=newToolTip();tip.BackColor=System.Drawing.Color.Transparent;tip.SetToolTip(this.btnCopyAccount,"复制账号到剪贴板。如果勾选了特殊拨号,复制的则是加密过的账号。");tip.SetToolTip(this.btnDia,"手动进行拨号。");tip.SetToolTip(this.chkAutoDia,"勾选后,下次启动将自动拨号。");tip.SetToolTip(this.chkSpecial,"如果你原本使用协同拨号器拨号,请勾选此项。");tip.SetToolTip(this.chkRemPassword,"勾选后,将会保存密码信息,同时保存账号信息。");tip.SetToolTip(this.chkRemAccount,"勾选后,将会保存账号信息,但不会保存密码信息。");tip.SetToolTip(this.txtPassword,"在这里输入你的密码。如果有字母,有大小写之分。");tip.SetToolTip(this.lblNotFind,"如果拨号时提示找不到电话簿,请点击这里。");tip.SetToolTip(this.txtAccount,"在这里输入你的用户名,如果是特殊拨号不分大小写。");tip.SetToolTip(this.chkAutoClo,"勾选后拨号成功将自动关闭程序,如果拨号失败,则不会自动关闭。");}//////写入配置信息///privatevoidWriteConfig(){this.ini.Writue("用户设置","记住账号",this.chkRemAccount.Checked.ToString());this.ini.Writue("用户设置","记住密码",this.chkRemPassword.Checked.ToString());this.ini.Writue("用户设置","特殊拨号",this.chkSpecial.Checked.ToString());this.ini.Writue("用户设置","自动连接",this.chkAutoDia.Checked.ToString());this.ini.Writue("用户设置","自动关闭",this.chkAutoClo.Checked.ToString());this.ini.Writue("用户设置","首次使用",this.IsFirst.ToString());if(this.chkRemAccount.Checked){this.ini.Writue("用户信息","账号",this.md5.Encryption(this.txtAccount.Text));this.ini.Writue("加密密钥","账号",key);}if(this.chkRemPassword.Checked){this.ini.Writue("用户信息","密码",this.md5.Encryption(this.txtPassword.Text));this.ini.Writue("加密密钥","密码",key);}}//////读取配置信息///privatevoidReadConfig(){this.chkRemAccount.Checked=bool.Parse(this.ini.ReadValue("用户设置","记住账号"));this.chkRemPassword.Checked=bool.Parse(this.ini.ReadValue("用户设置","记住密码"));this.chkSpecial.Checked=bool.Parse(this.ini.ReadValue("用户设置","特殊拨号"));this.chkAutoDia.Checked=bool.Parse(this.ini.ReadValue("用户设置","自动连接"));this.chkAutoClo.Checked=bool.Parse(this.ini.ReadValue("用户设置","自动关闭"));this.IsFirst=bool.Parse(this.ini.ReadValue("用户设置","首次使用"));if(this.chkRemAccount.Checked){this.txtAccount.Text=this.md5.Decryption(this.ini.ReadValue("加密密钥","账号"),this.ini.ReadValue("用户信息","账号"));if(this.txtAccount.Text.Trim()==""){this.txtAccount.Text=null;}}if(this.chkRemPassword.Checked){this.txtPassword.Text=this.md5.Decryption(this.ini.ReadValue("加密密钥","密码"),this.ini.ReadValue("用户信息","密码"));if(this.txtPassword.Text.Trim()==""){this.txtPassword.Text=null;}}}//////判断是否是第一次使用本软件///privatevoidIsFirstUse(){if(this.IsFirst){if(MessageBox.Show("检测到您是初次使用本软件,是否自动创建一个名为【宽带连接】的连接?如果已经存在,请选否。","初次使用",MessageBoxButtons.YesNo,MessageBoxIcon.Question)==DialogResult.Yes){this.CreateConnections();}this.IsFirst=false;this.WriteConfig();}}//////连接宽带///privatevoidNetDia(){this.IsFirstUse();newfrmLinkInfo(this).Show();base.Hide();}//////电话簿///privatevoidCreateConnections(){Process[]processArray;StreamWriterwriter=newStreamWriter(ConnectionsPath,false,Encoding.Default);writer.Write(this.GetVersion());writer.Close();Processprocess=newProcess();process.StartInfo.FileName=ConnectionsPath;process.StartInfo.CreateNoWindow=true;base.Hide();process.Start();process.WaitForExit();File.Delete(ConnectionsPath);Label_006A:processArray=Process.GetProcesses();foreach(Processprocess2inprocessArray){if(process2.ProcessName.ToString()=="rasphone"){gotoLabel_006A;}}base.Show();}//////获取版本?//////privatestringGetVersion(){StringBuilderstr=newStringBuilder();str.Append("");str.Append("setws=createobject("wscript.shell")");str.Append("ws.run"rasphone-a宽带连接"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{t}"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{n}"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{enter}"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{enter}"");if(Registry.LocalMachine.OpenSubKey(@"SoftwareMicrosoftWindowsNTCurrentVersion").GetValue("ProductName").ToString()=="Windows7Ultimate"){str.Append("");str.Append("setws=createobject("wscript.shell")");str.Append("ws.run"rasphone-a宽带连接"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{enter}"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{enter}"");}returnstr.ToString();}#endregion}}-IMDN开发者社群-imdn.cn"> ///定义Ini写入对象///privateIniWriteini=newIniWrite(ADSLPath);//////判断第一登录///privateboolIsFirst=true;/////////privateMD5.DES.Md5Classmd5=newMD5.DES.Md5Class();/////////publicstaticstringkey=null;#endregion//////构造函数///publicfrmMain(){InitializeComponent();}#region窗体事件//////窗体初始/////////privatevoidfrmMain_Load(objectsender,EventArgse){SetToolTip();IntiLoad(sender,e);}#endregion#region控件按钮事件//////复制账号/////////privatevoidbtnCopyAccount_Click(objectsender,EventArgse){if(this.chkSpecial.Checked)//判断特殊拨号是否勾选{//进行加密UsernameEncodeencode=newUsernameEncode();Clipboard.SetDataObject(encode.EncodeUsername(this.txtAccount.Text,this.txtPassword.Text));}else{Clipboard.SetDataObject(this.txtAccount.Text);}MessageBox.Show("账号已经复制到剪贴板!","复制成功");}//////拨号/////////privatevoidbtnDia_Click(objectsender,EventArgse){if(this.txtAccount.Text.Trim()==""){MessageBox.Show("账号不能为空","输入错误");txtAccount.Focus();return;}if(this.txtPassword.Text.Trim()==""){MessageBox.Show("密码不能为空","输入错误");txtPassword.Focus();return;}this.NetDia();}//////找不到电话簿?/////////privatevoidlblNotFind_LinkClicked(objectsender,LinkLabelLinkClickedEventArgse){this.CreateConnections();}//////记住账号联动/////////privatevoidchkRemAccount_CheckedChanged(objectsender,EventArgse){if(!this.chkRemAccount.Checked){this.chkRemPassword.Checked=false;}}//////记住密码联动/////////privatevoidchkRemPassword_CheckedChanged(objectsender,EventArgse){if(this.chkRemPassword.Checked){this.chkRemAccount.Checked=true;}}//////自动登录启动/////////privatevoidAutoConectTimer_Tick(objectsender,EventArgse){this.AutoConectTimer.Enabled=false;newfrmLinkInfo(this).Show();base.Hide();}#endregion#region自定义方法//////初始登录/////////privatevoidIntiLoad(objectsender,EventArgse){FileInfoinfo=newFileInfo(ADSLPath);try{if(info.Exists){this.ReadConfig();}if(this.chkAutoDia.Checked)//是否自动登录{this.AutoConectTimer.Start();}}catch(Exception){File.Delete(ADSLPath);this.frmMain_Load(sender,e);}}//////设置控件提示///privatevoidSetToolTip(){ToolTiptip=newToolTip();tip.BackColor=System.Drawing.Color.Transparent;tip.SetToolTip(this.btnCopyAccount,"复制账号到剪贴板。如果勾选了特殊拨号,复制的则是加密过的账号。");tip.SetToolTip(this.btnDia,"手动进行拨号。");tip.SetToolTip(this.chkAutoDia,"勾选后,下次启动将自动拨号。");tip.SetToolTip(this.chkSpecial,"如果你原本使用协同拨号器拨号,请勾选此项。");tip.SetToolTip(this.chkRemPassword,"勾选后,将会保存密码信息,同时保存账号信息。");tip.SetToolTip(this.chkRemAccount,"勾选后,将会保存账号信息,但不会保存密码信息。");tip.SetToolTip(this.txtPassword,"在这里输入你的密码。如果有字母,有大小写之分。");tip.SetToolTip(this.lblNotFind,"如果拨号时提示找不到电话簿,请点击这里。");tip.SetToolTip(this.txtAccount,"在这里输入你的用户名,如果是特殊拨号不分大小写。");tip.SetToolTip(this.chkAutoClo,"勾选后拨号成功将自动关闭程序,如果拨号失败,则不会自动关闭。");}//////写入配置信息///privatevoidWriteConfig(){this.ini.Writue("用户设置","记住账号",this.chkRemAccount.Checked.ToString());this.ini.Writue("用户设置","记住密码",this.chkRemPassword.Checked.ToString());this.ini.Writue("用户设置","特殊拨号",this.chkSpecial.Checked.ToString());this.ini.Writue("用户设置","自动连接",this.chkAutoDia.Checked.ToString());this.ini.Writue("用户设置","自动关闭",this.chkAutoClo.Checked.ToString());this.ini.Writue("用户设置","首次使用",this.IsFirst.ToString());if(this.chkRemAccount.Checked){this.ini.Writue("用户信息","账号",this.md5.Encryption(this.txtAccount.Text));this.ini.Writue("加密密钥","账号",key);}if(this.chkRemPassword.Checked){this.ini.Writue("用户信息","密码",this.md5.Encryption(this.txtPassword.Text));this.ini.Writue("加密密钥","密码",key);}}//////读取配置信息///privatevoidReadConfig(){this.chkRemAccount.Checked=bool.Parse(this.ini.ReadValue("用户设置","记住账号"));this.chkRemPassword.Checked=bool.Parse(this.ini.ReadValue("用户设置","记住密码"));this.chkSpecial.Checked=bool.Parse(this.ini.ReadValue("用户设置","特殊拨号"));this.chkAutoDia.Checked=bool.Parse(this.ini.ReadValue("用户设置","自动连接"));this.chkAutoClo.Checked=bool.Parse(this.ini.ReadValue("用户设置","自动关闭"));this.IsFirst=bool.Parse(this.ini.ReadValue("用户设置","首次使用"));if(this.chkRemAccount.Checked){this.txtAccount.Text=this.md5.Decryption(this.ini.ReadValue("加密密钥","账号"),this.ini.ReadValue("用户信息","账号"));if(this.txtAccount.Text.Trim()==""){this.txtAccount.Text=null;}}if(this.chkRemPassword.Checked){this.txtPassword.Text=this.md5.Decryption(this.ini.ReadValue("加密密钥","密码"),this.ini.ReadValue("用户信息","密码"));if(this.txtPassword.Text.Trim()==""){this.txtPassword.Text=null;}}}//////判断是否是第一次使用本软件///privatevoidIsFirstUse(){if(this.IsFirst){if(MessageBox.Show("检测到您是初次使用本软件,是否自动创建一个名为【宽带连接】的连接?如果已经存在,请选否。","初次使用",MessageBoxButtons.YesNo,MessageBoxIcon.Question)==DialogResult.Yes){this.CreateConnections();}this.IsFirst=false;this.WriteConfig();}}//////连接宽带///privatevoidNetDia(){this.IsFirstUse();newfrmLinkInfo(this).Show();base.Hide();}//////电话簿///privatevoidCreateConnections(){Process[]processArray;StreamWriterwriter=newStreamWriter(ConnectionsPath,false,Encoding.Default);writer.Write(this.GetVersion());writer.Close();Processprocess=newProcess();process.StartInfo.FileName=ConnectionsPath;process.StartInfo.CreateNoWindow=true;base.Hide();process.Start();process.WaitForExit();File.Delete(ConnectionsPath);Label_006A:processArray=Process.GetProcesses();foreach(Processprocess2inprocessArray){if(process2.ProcessName.ToString()=="rasphone"){gotoLabel_006A;}}base.Show();}//////获取版本?//////privatestringGetVersion(){StringBuilderstr=newStringBuilder();str.Append("");str.Append("setws=createobject("wscript.shell")");str.Append("ws.run"rasphone-a宽带连接"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{t}"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{n}"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{enter}"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{enter}"");if(Registry.LocalMachine.OpenSubKey(@"SoftwareMicrosoftWindowsNTCurrentVersion").GetValue("ProductName").ToString()=="Windows7Ultimate"){str.Append("");str.Append("setws=createobject("wscript.shell")");str.Append("ws.run"rasphone-a宽带连接"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{enter}"");str.Append("wscript.sleep200");str.Append("ws.sendkeys"{enter}"");}returnstr.ToString();}#endregion}} - IMDN开发者社群-imdn.cn">
登录
首页 » C# » ADSL宽带拨号 (C#)实例源码下载

ADSL宽带拨号 (C#)实例源码下载

于 2014-07-16 发布
0 475
下载积分: 1 下载次数: 0

代码说明:

实例截图: 部分源码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using Lqarpjj.Study.Demo.ADLSTool.Class;using System.Diagnostics;using System.IO;using Microsoft.Win32;namespace Lqarpjj.Study.Demo.ADLSTool{ public partial class frmMain : Form { #region 自定义变量 /// /// 静态变量存储信息的地址文件 /// private static string ADSLPath = Application.StartupPath @"ADSL.ini"; private static string ConnectionsPath = Application.StartupPath @"create.vbs"; /// /// 定义Ini写入对象 /// private IniWrite ini = new IniWrite(ADSLPath); /// /// 判断第一登录 /// private bool IsFirst = true; /// /// /// private MD5.DES.Md5Class md5 = new MD5.DES.Md5Class(); /// /// /// public static string key = null; #endregion /// /// 构造函数 /// public frmMain() { InitializeComponent(); } #region 窗体事件 /// /// 窗体初始 /// /// /// private void frmMain_Load(object sender, EventArgs e) { SetToolTip(); IntiLoad(sender, e); } #endregion #region 控件按钮事件 /// /// 复制账号 /// /// /// private void btnCopyAccount_Click(object sender, EventArgs e) { if (this.chkSpecial.Checked)//判断特殊拨号是否勾选 { //进行加密 UsernameEncode encode = new UsernameEncode(); Clipboard.SetDataObject(encode.EncodeUsername(this.txtAccount.Text, this.txtPassword.Text)); } else { Clipboard.SetDataObject(this.txtAccount.Text); } MessageBox.Show("账号已经复制到剪贴板!", "复制成功"); } /// /// 拨号 /// /// /// private void btnDia_Click(object sender, EventArgs e) { if (this.txtAccount.Text.Trim() == "") { MessageBox.Show("账号不能为空", "输入错误"); txtAccount.Focus(); return; } if (this.txtPassword.Text.Trim() == "") { MessageBox.Show("密码不能为空", "输入错误"); txtPassword.Focus(); return; } this.NetDia(); } /// /// 找不到电话簿? /// /// /// private void lblNotFind_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.CreateConnections(); } /// /// 记住账号联动 /// /// /// private void chkRemAccount_CheckedChanged(object sender, EventArgs e) { if (!this.chkRemAccount.Checked) { this.chkRemPassword.Checked = false; } } /// /// 记住密码联动 /// /// /// private void chkRemPassword_CheckedChanged(object sender, EventArgs e) { if (this.chkRemPassword.Checked) { this.chkRemAccount.Checked = true; } } /// /// 自动登录启动 /// /// /// private void AutoConectTimer_Tick(object sender, EventArgs e) { this.AutoConectTimer.Enabled = false; new frmLinkInfo(this).Show(); base.Hide(); } #endregion #region 自定义方法 /// /// 初始登录 /// /// /// private void IntiLoad(object sender, EventArgs e) { FileInfo info = new FileInfo(ADSLPath); try { if (info.Exists) { this.ReadConfig(); } if (this.chkAutoDia.Checked)//是否自动登录 { this.AutoConectTimer.Start(); } } catch (Exception) { File.Delete(ADSLPath); this.frmMain_Load(sender, e); } } /// ///设置控件提示 /// private void SetToolTip() { ToolTip tip = new ToolTip(); tip.BackColor = System.Drawing.Color.Transparent; tip.SetToolTip(this.btnCopyAccount, "复制账号到剪贴板。如果勾选了特殊拨号,复制的则是加密过的账号。"); tip.SetToolTip(this.btnDia, "手动进行拨号。"); tip.SetToolTip(this.chkAutoDia, "勾选后,下次启动将自动拨号。"); tip.SetToolTip(this.chkSpecial, "如果你原本使用协同拨号器拨号,请勾选此项。"); tip.SetToolTip(this.chkRemPassword, "勾选后,将会保存密码信息,同时保存账号信息。"); tip.SetToolTip(this.chkRemAccount, "勾选后,将会保存账号信息,但不会保存密码信息。"); tip.SetToolTip(this.txtPassword, "在这里输入你的密码。如果有字母,有大小写之分。"); tip.SetToolTip(this.lblNotFind, "如果拨号时提示找不到电话簿,请点击这里。"); tip.SetToolTip(this.txtAccount, "在这里输入你的用户名,如果是特殊拨号不分大小写。"); tip.SetToolTip(this.chkAutoClo, "勾选后拨号成功将自动关闭程序,如果拨号失败,则不会自动关闭。"); } /// /// 写入配置信息 /// private void WriteConfig() { this.ini.Writue("用户设置", "记住账号", this.chkRemAccount.Checked.ToString()); this.ini.Writue("用户设置", "记住密码", this.chkRemPassword.Checked.ToString()); this.ini.Writue("用户设置", "特殊拨号", this.chkSpecial.Checked.ToString()); this.ini.Writue("用户设置", "自动连接", this.chkAutoDia.Checked.ToString()); this.ini.Writue("用户设置", "自动关闭", this.chkAutoClo.Checked.ToString()); this.ini.Writue("用户设置", "首次使用", this.IsFirst.ToString()); if (this.chkRemAccount.Checked) { this.ini.Writue("用户信息", "账号", this.md5.Encryption(this.txtAccount.Text)); this.ini.Writue("加密密钥", "账号", key); } if (this.chkRemPassword.Checked) { this.ini.Writue("用户信息", "密码", this.md5.Encryption(this.txtPassword.Text)); this.ini.Writue("加密密钥", "密码", key); } } /// /// 读取配置信息 /// private void ReadConfig() { this.chkRemAccount.Checked = bool.Parse(this.ini.ReadValue("用户设置", "记住账号")); this.chkRemPassword.Checked = bool.Parse(this.ini.ReadValue("用户设置", "记住密码")); this.chkSpecial.Checked = bool.Parse(this.ini.ReadValue("用户设置", "特殊拨号")); this.chkAutoDia.Checked = bool.Parse(this.ini.ReadValue("用户设置", "自动连接")); this.chkAutoClo.Checked = bool.Parse(this.ini.ReadValue("用户设置", "自动关闭")); this.IsFirst = bool.Parse(this.ini.ReadValue("用户设置", "首次使用")); if (this.chkRemAccount.Checked) { this.txtAccount.Text = this.md5.Decryption(this.ini.ReadValue("加密密钥", "账号"), this.ini.ReadValue("用户信息", "账号")); if (this.txtAccount.Text.Trim() == "") { this.txtAccount.Text = null; } } if (this.chkRemPassword.Checked) { this.txtPassword.Text = this.md5.Decryption(this.ini.ReadValue("加密密钥", "密码"), this.ini.ReadValue("用户信息", "密码")); if (this.txtPassword.Text.Trim() == "") { this.txtPassword.Text = null; } } } /// /// 判断是否是第一次使用本软件 /// private void IsFirstUse() { if (this.IsFirst) { if (MessageBox.Show("检测到您是初次使用本软件,是否自动创建一个名为【宽带连接】的连接?如果已经存在,请选否。", "初次使用", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.CreateConnections(); } this.IsFirst = false; this.WriteConfig(); } } /// /// 连接宽带 /// private void NetDia() { this.IsFirstUse(); new frmLinkInfo(this).Show(); base.Hide(); } /// /// 电话簿 /// private void CreateConnections() { Process[] processArray; StreamWriter writer = new StreamWriter(ConnectionsPath, false, Encoding.Default); writer.Write(this.GetVersion()); writer.Close(); Process process = new Process(); process.StartInfo.FileName = ConnectionsPath; process.StartInfo.CreateNoWindow = true; base.Hide(); process.Start(); process.WaitForExit(); File.Delete(ConnectionsPath); Label_006A: processArray = Process.GetProcesses(); foreach (Process process2 in processArray) { if (process2.ProcessName.ToString() == "rasphone") { goto Label_006A; } } base.Show(); } /// /// 获取版本? /// /// private string GetVersion() { StringBuilder str = new StringBuilder(); str.Append(""); str.Append("set ws=createobject("wscript.shell") "); str.Append(" ws.run "rasphone -a 宽带连接" "); str.Append(" wscript.sleep 200 "); str.Append(" ws.sendkeys "{t}" "); str.Append(" wscript.sleep 200 "); str.Append(" ws.sendkeys "{n}" "); str.Append(" wscript.sleep 200 "); str.Append(" ws.sendkeys "{enter}" "); str.Append(" wscript.sleep 200 "); str.Append(" ws.sendkeys "{enter}" "); if (Registry.LocalMachine.OpenSubKey(@"SoftwareMicrosoftWindows NTCurrentVersion").GetValue("ProductName").ToString() == "Windows 7 Ultimate") { str.Append(""); str.Append("set ws=createobject("wscript.shell")"); str.Append(" ws.run "rasphone -a 宽带连接""); str.Append(" wscript.sleep 200"); str.Append(" ws.sendkeys "{enter}""); str.Append(" wscript.sleep 200"); str.Append(" ws.sendkeys "{enter}""); } return str.ToString(); } #endregion }}

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • C# checklistBox实例方法一例
    C# checklistBox实例方法一例
    2015-01-08下载
    积分:1
  • VS2012保存时自动格式化代码插件(Format On Save .vsix)
    VS2012保存时自动格式化代码
    2020-12-01下载
    积分:1
  • C# 仿酷狗音乐打开关闭效果
    酷狗音乐打开关闭
    2015-06-29下载
    积分:1
  • wpf开发教程 下载(259页)
    wpf开发教程 下载(259页)
    2014-06-17下载
    积分:1
  • IM即时通讯C#开源
    IM即时通讯C#开源
    2014-06-16下载
    积分:1
  • SwfUpload在MVC4下多文件上传缩略图水印例子 示例源码下载
    SwfUpload在MVC4下多文件上传缩略图水印例子 示例源码下载
    2014-03-23下载
    积分:1
  • EzReportBuild 2.0报表组件源码和demo及说明
    2.0版本添加了多报表页功能,每份报表可设置多页,每页可设置不同的纸张大小、数据表、页面规则等,并可对报表页次序即时调整,同时,优化了显示,报表显示更流畅。EzReportBuild 2.0报表组件,可以完成报表设计、预览、打印等功能,提供接口函数,可以将设计、预览等嵌入到自定的winform中调用,使用简单,调用灵活。在你的工程项目里,新建一个窗体,添加按钮,使用:// 单独打开报表编辑器        private void button1_Click(object sender, EventArgs e)        {            _Interface.independent_DesignForm();    }打开设计器设计报表,保存报表后可去掉按钮,该工程项目生成的报表,别的应用不能打开查看。如需复杂数据报表,可先生成一个临时数据库表,然后引入报表系统,由于报表数据为按行读取,所以只要能够设计出数据库各字段和内容,就能够生成相应的报表。打印规则为“内容区域”栏目无论所在位置,紧跟页头栏,所以适当调整“页头区域”、“页脚区域”位置,保证按需求输出。制作每页多行数据报表,“内容区域”为自动计算填充“页头区域”、“页脚区域”之间的空间,应适当调整“内容区域”栏目和页头页脚之间的空间,达到最佳打印效果。如需在表格内添加空行,可在生成的报表数据库表中添加空记录即可。 注意:使用时,将fontawesome-webfont.ttf字体文件与exe文件放置在一起,使用Access数据库时,注意路径,如没有安装AccessDatabaseEngine.exe,可在微软网站下载,或在本压缩文件的soft文件夹中安装。 更新关注:https://www.cnblogs.com/qiaoke/p/10365440.html 设计器截图      预览截图 嵌入程序截图 多种纸张同时预览using System;using System.Drawing;using System.Windows.Forms;namespace Demo_1{ public partial class Form1 : Form { RBuild_Interface _Interface = new RBuild_Interface(); // 新建接口 RBuild_Preview rpb = new RBuild_Preview(); // 预览窗口对象 public Form1() { InitializeComponent(); } // 单独打开报表编辑器 private void button1_Click(object sender, EventArgs e) { _Interface.independent_DesignForm(); } // 单独打开报表预览 private void button2_Click(object sender, EventArgs e) { _Interface.independent_PreviewForm(@"测试报表1.rpt", 2, "", "", "", "地址库.mdb"); } private void button3_Click(object sender, EventArgs e) { // 按钮可以使用 b1.Enabled = true; b2.Enabled = true; b3.Enabled = true; b4.Enabled = true; b5.Enabled = true; b6.Enabled = true; b7.Enabled = true; b8.Enabled = true; _Interface.embedded_PreviewForm(rpb, panel1, @"测试报表1.rpt", 2, "", "", "", "地址库.mdb", true); } private void b1_Click(object sender, EventArgs e) { _Interface.preview_FirstPage(rpb); } private void b2_Click(object sender, EventArgs e) { _Interface.preview_PreviousPage(rpb); } private void b3_Click(object sender, EventArgs e) { _Interface.preview_NextPage(rpb); } private void b4_Click(object sender, EventArgs e) { _Interface.preview_LastPage(rpb); } private void b5_Click(object sender, EventArgs e) { _Interface.preview_Search(new Point(200,200)); } private void b6_Click(object sender, EventArgs e) { _Interface.zoom_Menu(rpb,new Point(300,200)); } private void b7_Click(object sender, EventArgs e) { _Interface.print_Page(rpb); } private void b8_Click(object sender, EventArgs e) { int _now, _tol; _now = _Interface.get_NowPage(rpb); _tol = _Interface.get_TotalPage(); MessageBox.Show("当前页:" _now "--- 总页数:" _tol); } }}
    2019-01-19下载
    积分:1
  • asp.net cms系统源码下载(DTCMS源码)
    DTcms V3.0增强与改进的功能有: 1、系统架构发生了改变;2、去除模型概念与改进扩展字段;3、增加分站功能;4、增加手机短信功能;5、增加生成静态功能;6、全新的后台界面;7、对模板标签的改进;
    2015-04-08下载
    积分:1
  • c奔跑的火柴人游戏源码.zip
    c语言奔跑的火柴人游戏源码.zip
    2019-11-06下载
    积分:1
  • C# .net 400个经典例子下载
    word文档的形式,每个实例都有截图和核心源码,适合初学者学习
    2014-03-10下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载