在Winform中启动asp.net开发服务器 [英] Starting the asp.net dev server in a winform

查看:91
本文介绍了在Winform中启动asp.net开发服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好,我正在编写一个程序,该程序编写一个asp.net页并显示它,它的目的是成为创建我正在创建的C#论坛的一部分的工具.

Ok, I'm making a program that writes an asp.net page and displays it, it is meant to be a tool to create a part of a C# forum I'm making.

问题是我无法在没有运行开发服务器的情况下显示asp页面,但发现了一些代码,但仍然无法从其他应用程序中显示asp.net页面,它可以正常显示html,这是什么?我做错了,这里是我的代码:

The problem is that I can't display the asp page with out the dev server running and I found some code but I still can't get asp.net pages from other applications to display, it displays html just fine, what di d I do wrong here is my code:

// settings

string PortNumber = "1162"; // arbitrary unused port #

string LocalHostUrl = string.Format("http://localhost:{0}", PortNumber);

string PhysicalPath = Environment.CurrentDirectory; // the path of compiled web app

string VirtualPath = "test";

string RootUrl = LocalHostUrl + VirtualPath;

// create a new process to start the ASP.NET Development Server

Process process = new Process();

/// configure the web server

process.StartInfo.FileName = @"C:\Program Files (x86)\Common Files\microsoft shared\DevServer\9.0\" + "WebDev.WebServer.exe";

process.StartInfo.Arguments = string.Format("/port:{0} /path:\"{1}\" /virtual:\"{2}\"", PortNumber, PhysicalPath, VirtualPath);

process.StartInfo.CreateNoWindow = true;

process.StartInfo.UseShellExecute = true;

webBrowser1.Url = new Uri(LocalHostUrl);

// start the web server

process.Start();

推荐答案

Hi There-

Hi There-

谢谢你的帖子.我建议您将查询发布在链接上方的asp.net论坛中: http://forums.asp.net/

Thank you for the post. I would suggest you to kindly post the query in asp.net forum located over the link : http://forums.asp.net/

希望有帮助.

谢谢-

Ashawani


这篇关于在Winform中启动asp.net开发服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆