如果从VS2012执行,但在IIS上托管时无法正常工作

问题描述 投票:-1回答:1

我正在从MVC网站执行此代码。如果我从VS 2012运行此代码IIS表示它正在工作,但如果我在IIS服务器上托管该网站,它不起作用。我试过调试但是有一些错误代码。如果我也模仿我的身份并传递我的身份,但一切都是徒劳的。

码:

    System.Diagnostics.Process proc = new System.Diagnostics.Process();

    Char[] chr = Password.ToCharArray();

    System.Security.SecureString pwd = new System.Security.SecureString();

    foreach (char c in chr)
    {
        pwd.AppendChar(c);
    }

    proc.StartInfo.FileName = path to WZZip.exe

    //proc.StartInfo.Arguments = -ys20480 pathtosplit landingZone;  
    proc.StartInfo.UserName = UserName;  //Comes from config file
    proc.StartInfo.Password = pwd;        //Comes from config file
    proc.StartInfo.Domain = Domain;      //Comes from config file
    proc.StartInfo.RedirectStandardError = true;
    proc.StartInfo.RedirectStandardOutput = true;
    proc.StartInfo.UseShellExecute = false;
    bool result = proc.Start();
c# asp.net asp.net-mvc iis iis-express
1个回答
1
投票

通过iis运行exe时你应该从一些问题开始:

A)我是否应该绕过保护IIS服务器和Windows系统的内置安全性?

B)如果你允许可执行文件使用路径进入操作系统或IIS服务器谁还可以使用它,即“HAcker”?

C)对Windows和IIS服务器进行了更改,以保护系统免受“攻击”并限制表面区域以获取攻击。正在为系统和IIS服务器执行哪些安全监视?您将为可执行文件实施哪些安全保护?

如果你可以为A - C的风险辩护,你可以“解决”这些限制。

如果您了解风险Technet有工具来帮助解决http://blogs.technet.com/b/elevationpowertoys/的一些问题。

对于Windows Vista Windows 7 Windows 2008,您拥有标准用户以及权限和权限限制

一个线程http://forums.iis.net/p/1178151/1981859.aspx#1981859谁可以做什么。

您可以搜索(Google或Bing)“Windows桌面安全更改”“会话(0)对系统和服务的更改和影响”

您还可以从Microsoft下载中心获取“Vista开发人员故事”的副本。

您应该检查MSDN库的应用程序兼容性以及如何使用用户访问控制(UAC)进行设计。

许多安全更改已添加到Windows 2003和IIS 6.0服务器。

最后,您可以在IIS中添加MIME类型

  • 打开IIS管理器。
  • 浏览到ThinApp EXE所在的IIS站点或子文件夹。
  • 右键单击该站点或子文件夹,然后选择“属性”。
  • 选择HTTP HEADERS选项卡。
  • 单击MIME TYPES按钮。
  • 在扩展框中,键入“.exe”。
  • 在MIME TYPE框中,键入“application / octet-stream”。
  • 单击确定。
© www.soinside.com 2019 - 2024. All rights reserved.