摘要: 一.C#运用ProcessStartInfo安装服务,卸载服务,启用服务,关闭服务的操作!.C#运用ProcessStartInfo安装服务,卸载服务,启用服务,关闭服务的操作! . /// <summary>. /// 从CMD运行里面启用服务 . /// </summary>. /// <param name="sender"></param>. /// <param name="e"></param>. protected void Button4_Click1(object 阅读全文
posted @ 2012-03-21 22:51 摩根船长 阅读(743) 评论(0) 推荐(0) 编辑
摘要: 我们在程序中经常会用到MessageBox。 MessageBox.Show()共有21中重载方法。现将其常见用法总结如下:1.MessageBox.Show("Hello~~~~");最简单的,只显示提示信息。2.MessageBox.Show("There are something wrong!","ERROR"); 可以给消息框加上标题。3.if (MessageBox.Show("Delete this user?", "Confirm Message",MessageBoxButto 阅读全文
posted @ 2012-03-21 21:52 摩根船长 阅读(757) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace TestFolderBrowserDialog{ public partial class Form1 : Form { public Form1() { InitializeComponent(); ... 阅读全文
posted @ 2012-03-21 15:53 摩根船长 阅读(102345) 评论(1) 推荐(2) 编辑
摘要: //绑定双击单元格事件private void DgvDataBackup_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {//得到当前激活单元格的值TxtTaskName.Text = DgvDataBackup.CurrentCell.Value.ToString();//得到当前激活行指定列的值TxtTaskName.Text = DgvDataBackup.CurrentRow.Cells["ColTaskName"].Value.ToString();} 阅读全文
posted @ 2012-03-21 15:13 摩根船长 阅读(1026) 评论(0) 推荐(0) 编辑
摘要: 一、数据集基本应用1.表格新增记录方式一:利用BindingSource的AddNew//新增记录,推荐使用,光标位置处于当前新增记录,且正处理编辑状态DataRow thisRow = ((DataRowView)usersBindingSource.AddNew()).Row;thisRow["OID"] = 5;thisRow["CNAME"] = "新增用户";thisRow["sex"] = "m";方式二:利用DataTable的NewRow//新增记录(不建议使用,因为这种方式Ro 阅读全文
posted @ 2012-03-21 11:32 摩根船长 阅读(17652) 评论(1) 推荐(4) 编辑