English 中文(简体)
Index.html in IIS
原标题:Index.html in IIS

In my code I want to thanks to the good path, open the file Index.html in my IIS server.

我实际上正在使用:

        string path = "C://inetpub//wwwroot//Files//Wireframes//" + ((LinkButton)sender).ID;
        System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(path);
        System.IO.FileInfo[] fiArr = di.GetFiles("*", SearchOption.TopDirectoryOnly);

        foreach (System.IO.FileInfo thefile in fiArr)
        {
            if (thefile.Name == "index.html")
            {
                System.Diagnostics.Process.Start(path + "/index.html");
            }

        }
    }

我很想知道,为什么它在当地工作,但当我把我的项目放在我的服务器上时,这并不是什么。

最佳回答

Because:

  1. Your website is in different folder
  2. You don t have a default application assigned to .html extension
  3. Your web app runs under an account which cannot interact with the desktop (ie. NETWORK)

此外,不搜索<代码>*查询index.html,载于GetFiles

Make sure that you understand that you are creating a new process on the machine which hosts your web site and not on machine that is running your browser. You want be able to navigate to a page on hosted on machine B from machine A and have a new browser window opened on machine A from machine B.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签