首页 > 技术文章 > C#修改用户名

xxxteam 2013-09-12 11:31 原文

string strCmdText;
            strCmdText = "useraccount where name='" + 旧密码 + "' rename " + 新密码;
            try
            {
                System.Diagnostics.Process.Start("wmic.exe", strCmdText);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("修改失败,原因:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

 

推荐阅读