相关疑难解决方法(0)

你如何在.NET中进行模拟?

是否有一种简单的开箱即用方式来模拟.NET中的用户?

到目前为止,我一直在代码项目中使用这个类来满足我的所有模拟要求.

有没有更好的方法来使用.NET Framework?

我有一个用户凭据集(用户名,密码,域名),表示我需要模拟的身份.

.net c# impersonation

128
推荐指数
5
解决办法
22万
查看次数

从 ASP.NET 网站拒绝访问启动过程

我有一个 ASP.NET MVC4 网站,我正在尝试在服务器上执行一个进程。代码如下:

ProcessStartInfo startInfo = new ProcessStartInfo()
{
    FileName = ExeLocation,
    Arguments = string.Format("\"{0}\"{1}", ScriptLocation, Arguments),
    UseShellExecute = false,
    RedirectStandardOutput = true,
    RedirectStandardError = true,
    WorkingDirectory = AppDir,
    CreateNoWindow = true,
    UserName = ExeUsername,
    Password = ExePassword,
    Domain = ExeDomain
};

using (Process process = Process.Start(startInfo))
{
    using (StreamReader reader = process.StandardOutput)
    {
        output = reader.ReadToEnd();
    }
    using (StreamReader reader = process.StandardError)
    {
        error = reader.ReadToEnd();
    }
    process.WaitForExit();
    if (process.ExitCode != 0)
    {
        throw new Exception(string.IsNullOrEmpty(output) ? error …
Run Code Online (Sandbox Code Playgroud)

c# asp.net windows-server-2012

5
推荐指数
1
解决办法
1480
查看次数

标签 统计

c# ×2

.net ×1

asp.net ×1

impersonation ×1

windows-server-2012 ×1