总结自己在.NET中常用的方法

//打开IE并跳到指定的网页 
ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe"); 
startInfo.Arguments = "www.vuel.cn"; 
Process process1 = new Process(); 
process1.StartInfo = startInfo; 
process1.Start(); 

//打开计事本 
System.Diagnostics.Process.Start("notepad.exe"); 

//将字符串写到粘贴板 
System.Windows.Forms.Clipboard.SetDataObject(textBox1.Text); 

//清空粘贴板 
System.Windows.Forms.Clipboard.Clear(); 

//将texBox设为只读 
textBox.ReadOnly = true; 

//将字符串按指定的基数转为Int型 
Convert.ToInt32("111111111",2) int可为8,16之类,右边函数既为255 

//将long类按指定的基数转为String型 
Convert.ToString(255,2) int可为8,16之类,右边函数既为"1111111" 

//将String转为int型 
int.Parse(string str)

//离开控件时产生的事件
this.Textbox_Leave += new System.EventHandler(this.Textbox_Leave);
Textbox_Leave(object sender,EventArgs 3)

//Forms窗口的IsMdiContainer属性为true时,窗口为主窗口(MDI容器)

//弹出信息框
MessageBox.Show( "您输入的用户号或密码不正确!");
if (MessageBox.Show("确实要退出系统吗?","询问",MessageBoxButtons.YesNo) == DialogResult.Yes)
    {
        this.Close();
    } 
 
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值