///定义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#)实例源码下载
于 2014-07-16 发布
0 464
实例截图: 部分源码: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 }}
下载说明:请别用迅雷下载,失败请重下,重下不扣分!
-
C# 学生请假管理系统(源码+数据库)
【调试步骤】 1. 附加数据库 2. 无须修改源码,直接运行源码即可看到如下截图
- 2019-06-23下载
- 积分:1
-
截取屏幕/桌面,截图并保存图片到本机 实例完整源码下载
截取屏幕/桌面,截图并保存图片到本机 实例完整源码下载
- 2013-10-03下载
- 积分:1
-
基于51的蓝牙遥控小车
蓝牙模块:hc-06 51单片机 驱动模块:L28N
- 2021-05-07下载
- 积分:1
-
正则提取网页中的图片示例源码
正则提取网页中的图片示例源码
- 2014-04-01下载
- 积分:1
-
asp.net网上多媒体音乐商店的源代码(含ppt文档以及数据库)
数据库应用系统的实例源代码和ppt,一个B/S体系结构的数据库应用系统的开发,要完成后台服务器上数据库的建立与维护以及面向前端浏览器用户的Web应用程序开发 两大部分的任务。对于前者要求建立起尽量满足一致性、完整性、安全性要求的数据库,而对于后者则要求应用程序符合功能完备、操作简便、界面友好等特点。
- 2019-12-04下载
- 积分:1
-
c# 语音卡电话呼叫系统 源码
说明:visual C#编写实现语音卡电话呼叫系统,本实例使用了语音卡中的newsig.dll和tc08a32.dll组件,运行前需将其拷贝到Debug文件夹中。本语音卡程序展示了一个完整的电话来电的处理过程,比如来电接听、响铃、未接电话、遇忙转换等,另外也演示了如何按数字键盘后在屏幕上显示拨打的号码,检测通道总数,并为每个通道分配语音缓冲区,初始化语音卡硬件,作者有版权,仅供学习与参考。
- 2017-06-18下载
- 积分:1
-
UI缩放功能实现
【实例简介】UI缩放功能实现
根据不同分辨率,控件能够自动缩放
- 2021-11-30 00:45:50下载
- 积分:1
-
MFC中文帮助文档(chm格式)
该MFC参考含盖了Microsoft基本类库中的类、全局函数、全局变量和宏的内容。参考中“类层次结构图”是为了方便查找某个类的基类。该MFC参考通常不描述通过继承的函数或操作符。若要寻求这些函数的信息,请参阅类层次结构图中该类的基类信息。每个类的说明文档包括:该类的概括、类成员的种类、以及该成员函数、重载操作符或数据成员的基本用途。仅撰写应用程序或派生类在一般情况下对于公共和保护类成员的使用说明。寻求完整的类成员的列表,请参阅该类的头文件。本书目录 · 层次结构图 直观的描述MFC中各类的关系。 · MFC类 详细解说MFC库中的每个类和头文件信息。 · MFC宏和全局 详细解说MFC库中的每个宏、全局函数、全局变量。 · 结构、风格、回调函数和消息映射 详细解说MFC库中的各个结构、风格、回调函数和消息映射。 示例:CWinApp::AddToRecentFileListvirtual void AddToRecentFileList( LPCTSTR lpszPathName );参数:lpszPathName 文件的路径。说明:调用这个成员函数以把lpszPathName加入MRU文件列表。你必须在使用这个成员函数之前调用LoadStdProfileSetting成员函数以载入当前的MRU文件列表。当框架打开一个文件或者执行Save As命令用新名字保存文件时,它就调用这个成员函数。示例:// 这个例子将路径名 c: emp est.doc 加入// File菜单中的最近使用(MRU)文件列表AfxGetApp()->AddToRecentFileList("c:\temp\test.doc");请参阅:CWinApp::LoadStdProfileSettings
- 2014-08-22下载
- 积分:1
-
C++| 匠心之作 从0到1入门学编程文档资料(黑马程序员)
这份文档资料是黑马程序员C/C 的视频课程资料,内部包含《C 基础入门》、《C 提高编程》、《C 核心编程》、《通讯录管理系统》、《基于STL的演讲比赛流程管理系统》、《职工管理系统》、《机房预约系统》文档资料,很适合新手入门!
- 2019-05-07下载
- 积分:1
-
c++ 制作 万年历 实例源码(C语言基础巩固与提高)
巩固C语言基础,开发的万年历程序。
- 2019-06-02下载
- 积分:1