this.Close();
}
}
private void LoadInfo()
{
ui = SerializeHelper.DeserializeUserInfo();
if (ui != null)
{
this.txtUser.Text = ui.Username;
this.txtPwd.Text = ui.Password;
this.cboType.SelectedIndex = ui.Type == "41" ? 0 : 1;
this.txtPath.Text = ui.Path;
}
else
{
this.cboType.SelectedIndex = 0;
}
}
}
}
C#实现发送短信到手机功能常见两种方式:
使用短信网关,有第三方的,也有和移动电信等签约的 。后者一般是大客户才开放 。前者你百度搜“短信通”就可以找到很多家提供这种服务的公司 。提供的接口一般是http协议的调用 。在C# WINFORM里就可以使用WebClient类来调用了 。具体的接口你还是得看不同公司提供的文档 。
使用短信猫 。是一个硬件设备 , 可以插SIM卡,然后通过短信猫提供的API去调用…具体还是得看那个API…我用过一个是提供一个dll给你import的 。其他应该也一样
Visual C#实现短信息发送的具体实现步骤:
Visual C#发送短信息的关键就是通过Web引用新浪网提供的发送短信息的Web Service,并在引用完成后 。调用此Service的sendXml方法即可 。以下就是Visual C#引用Web Service发送短信息的具体实现步骤:
1. 启动Visual Studio .Net 。
2. 选择菜单【文件】|【新建】|【项目】后,弹出【新建项目】对话框 。
3. 将【项目类型】设置为【Visual Basic项目】 。
4. 将【模板】设置为【Windows应用程序】 。
5. 在【名称】文本框中输入【短信】 。
6. 在【位置】的文本框中输入【E:/VS.NET项目】 , 然后单击【确定】按钮 , 这样在"E:/VS.NET项目"目录中就产生了名称为"短信"的文件夹,并在里面创建了名称为"短信"的项目文件 。
7. 把Visual Studio .Net的当前窗口切换到【Form1.cs(设计)】窗口,并从【工具箱】中的【Windows窗体组件】选项卡中往Form1窗体中拖入下列组件,并执行相应的操作:
四个Label组件 。
四个TextBox组件 。
一个Button组件,其作用是发送短信息 。并在这个Button组件拖入Form1的设计窗体后,双击它,则系统会在Form1.cs文件分别产生这个组件的Click事件对应的处理代码 。
8. 把Visual Studio .Net的当前窗口切换到Form1.vb的代码编辑窗口,并用下列代码替换Form1.cs中的InitializeComponent过程对应的代码,下列代码作用是初始化窗体中加入的组件:
private void InitializeComponent ( )
{
this.textBox1 = new System.Windows.Forms.TextBox ( ) ;
this.textBox2 = new System.Windows.Forms.TextBox ( ) ;
this.textBox3 = new System.Windows.Forms.TextBox ( ) ;
this.button1 = new System.Windows.Forms.Button ( ) ;
this.label1 = new System.Windows.Forms.Label ( ) ;
this.label2 = new System.Windows.Forms.Label ( ) ;
this.label3 = new System.Windows.Forms.Label ( ) ;
this.label4 = new System.Windows.Forms.Label ( ) ;
this.textBox4 = new System.Windows.Forms.TextBox ( ) ;
this.SuspendLayout ( ) ;
this.textBox1.Location = new System.Drawing.Point ( 144 , 16 ) ;
this.textBox1.Name = "textBox1" ;
this.textBox1.Size = new System.Drawing.Size ( 184 , 21 ) ;
this.textBox1.TabIndex = 0 ;
this.textBox1.Text = "" ;
this.textBox2.Location = new System.Drawing.Point ( 144 , 69 ) ;
this.textBox2.Name = "textBox2" ;
this.textBox2.PasswordChar = ''''''''*'''''''' ;
this.textBox2.Size = new System.Drawing.Size ( 184 , 21 ) ;
this.textBox2.TabIndex = 1 ;
this.textBox2.Text = "" ;
this.textBox3.Location = new System.Drawing.Point ( 144 , 122 ) ;
this.textBox3.Name = "textBox3" ;
this.textBox3.Size = new System.Drawing.Size ( 184 , 21 ) ;
- vbnetmysql
- mysql和VBs
- vbs连接mysql数据库 vb可以连接mysql
- 如何取消手机短信呼叫服务器? 手机怎么取消短信呼服务器
- 手机短信服务器出错了怎么办 短信服务器失败是怎么回事
- 手机短信服务器 短信服务器修复工具怎么用
- 手机短信是如何通过服务器接收的? 手机短信怎么有服务器接收
- 手机短信是如何通过服务器端口传输的? 手机短信怎么有服务器端口
- 手机短信是如何与服务器建立连接的? 手机短信怎么有服务器连接
- 手机短信是如何实现服务器传输的? 手机短信怎么有服务器
