急!!!在线等待回复:C#怎么写来实现:禁止/启用计算机本地用户 調用windows api函數應該能實現...具體哪個函數就不清楚了.去查查 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 c#能实现这个 ? 没有听说过 建议 api来实现 先去看操作系统的帮助:net user 然后,用System.Diagnostics.Process试试: Process Proc = new Process();Proc.StartInfo.FileName = "net.exe";Proc.StartInfo.RedirectStandardError = true;Proc.StartInfo.RedirectStandardOutput = true;Proc.StartInfo.RedirectStandardInput = true; Proc.StartInfo.Arguments = " user " + username + " " + password + " /add /active:yes " + "/expires:never /fullname:" + username @" /usercomment:临时添加";Proc.Start();Proc.WaitForExit();Proc.Close(); thanks,The123(一个正确的问题比一个正确的答案重要得多(Edit and Co)! 屏幕录像问题 求助各位高手 选择性查询数据 急急急·短息猫的C#开发包!【快】 为什么在对象浏览器中查看不到dll文件中的方法? 请问c#中如何保留有效数字? 关于动态多播地址的问题,请各位大侠如内帮忙 comboBox的显示问题。。。。。。 我的vs.net为什么不能打开c#工程啊!!!!!!!!!! Mysql win7 32位找不到Mysql Server安装文件? 如何抓取需要用户名和密码的网页?? 智能客户端开发步骤,谁能给一个DEMO,加点说明,比如在。NET里新建边个工程。。。
然后,用System.Diagnostics.Process试试:
Process Proc = new Process();
Proc.StartInfo.FileName = "net.exe";
Proc.StartInfo.RedirectStandardError = true;
Proc.StartInfo.RedirectStandardOutput = true;
Proc.StartInfo.RedirectStandardInput = true;
Proc.StartInfo.Arguments = " user " + username + " " + password + " /add /active:yes " + "/expires:never /fullname:" + username @" /usercomment:临时添加";Proc.Start();
Proc.WaitForExit();
Proc.Close();