vs2008ÖÐasp.netµÄwebÓ¦ÓóÌÐò¸ÄwebÍøÕ¾
vs2008ÖÐн¨b/s½á¹¹µÄÏîÄ¿ÓÐÁ½ÖÖÀàÐÍ£¬Ò»ÖÖÊÇweb application,¼´webÓ¦ÓóÌÐò£¬ÁíÍâÒ»ÖÖÊÇwebÍøÕ¾£¬Ð½¨ÏîĿʱÈç¹ûÑ¡ÔñµÄ²»ÕýÈ·£¬ÔÚºóÐøµÄ¿ª·¢¹ý³ÌÖоͲ»¿É±ÜÃâµÄ»áÓöµ½ÒªÐÞ¸ÄÏîÄ¿ÀàÐ͵ÄÇé¿ö¡£¾¹ýÔÚÍøÉϱ¬×ßÒÔ¼°²âÊÔ£¬ÒÔÏÂÊǽâ¾öasp.netÓ¦ÓóÌÐò¸ÄÍøÕ¾ÏîÄ¿µÄ·½·¨¼°±³¾°ÖªÊ¶£º
1.vs2008µÄÏîÄ¿ÀàÐÍÊÇͨ¹ýguidÀ´È·¶¨µÄ
ÔÚ½â¾ö·½°¸ÎļþÖÐ(.sln)£¬ÓüÇʱ¾´ò¿ª¿´µÄ»°¿ÉÒÔ¿´µ½Project("ºóÃæ¸úµÄÊÇguidÖµ£¬ÍøÕ¾ÀàÏîÄ¿µÄguidºÍÓ¦ÓóÌÐòÀàÏîÄ¿µÄguidÖµÊDz»Ò»ÑùµÄ£¬ÎÒÃÇ¿ÉÒÔËæ±ãн¨Ò»¸öÍøÕ¾£¬È»ºó°Ñproject("ºóÃæµÄguidÖµ¸´ÖƳöÀ´±¸Óá£
Èç¹ûÄãµÄ½â¾ö·½°¸ÎļþÖеÄÖµÊÇProject("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"),ÄÇôÕâ¾ÍÊÇÒ»¸öÓ¦ÓóÌÐòÀàÐ͵ÄÏîÄ¿£¬ÍøÕ¾ÀàÏîÄ¿µÄÖµÓ¦¸ÃÊÇ£ºProject("{E24C65DC-7377-472B-9ABA-BC803B73C61A}")£¬ÎÒÃÇÒª×öµÄ¾ÍÊÇÒª°ÑÏîÄ¿ÀàÐ͸ijÉÕâ¸öÍøÕ¾µÄguidÖµ¡£
2.ÍøÕ¾ÀàÏîÄ¿±Èasp.netÓ¦ÓóÌÐòÏîÄ¿¶à³öÀ´Ò»Ð©²ÎÊýÖµ
ÍøÕ¾ÀàÏîÄ¿ÔÚ½â¾ö·½°¸ÎļþÖжà³öÀ´Ò»Ð©ÐéÄâ·¾¶ÒÔ¼°±àÒë·½ÃæµÄ²ÎÊýÐÅÏ¢£¬Ó¦ÓóÌÐòÀàÏîĿûÓÐÕâЩÄÚÈÝ£¬ËùÒÔÎÒÃÇ»¹ÊÇҪн¨Ò»¸ö¿ÕµÄÍøÕ¾ÏîÄ¿£¬½«ÒÔÏÂÄÚÈݸ´ÖƵ½ÔÀ´µÄÓ¦ÓóÌÐòÏîÄ¿µÄ²ÎÊýÏ£º
ProjectSection(WebsiteProperties) = preProject
TargetFramework = "3.5"
Debug.AspNetCompiler.VirtualPath = "/WebSite1" ----------------------->ÕâÀïÐèÒª¸Ä
Debug.AspNetCompiler.PhysicalPath = ".\XinRong_Steel_Tube\" ----------------------->ÕâÀïÐèÒª¸Ä
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\WebSite1\" ----------------------->ÕâÀïÐèÒª¸Ä
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/WebSite1" &nbs
Ïà¹ØÎĵµ£º
Ê®Ììѧ»áASP.net֮ʵսϵÁУ¨C#ºÍVb.netË«°æ±¾£©
µÚÒ»Ìì
ÎÒÈÏΪASP.NET±ÈASPÄѺܶ࣬ϣÍû´ó¼Ò×öºÃ×¼±¸¡£ÄÑÄÑÔÚʵÏÖͬһ¸öЧ¹ûÓкܶ෽·¨£¬´ó¼Ò»òÐí»áÒÉ»ó¡£Ê®Ììѧ»áϵÁн̳̻áÇåÎúµÄд³ö¸÷ÖÖ·½·¨£¬Èôó¼ÒÄÜÉÙÒ»µã¿²¿À¡£ÔÚASPÀïÃ棬´ó¼Ò¼¸ºõ¶¼ÊÇʹÓÃVB£¬Êý¾Ý¿âÂҲÎÞ·ÇÊÇSQLºÍACCESS¡£ÔÚASP.NETÀïÃ棬Êý¾Ý¿â»¹ÊÇÕ ......
ǰ̨´úÂë
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UpdateProgress.aspx.cs" Inherits="UpdateProgress" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" Ta ......
ÔÚÒ³Ãæ»ùÀàÖÐÔö¼ÓÒÔÏ·½·¨,Äܹ»»ñµÃ±Èoverride void OnError(EventArgs e)¸ü¸ßµÄ´íÎó´¦ÀíÓÅÏȼ¶ºÍ¿ØÖÆȨ,override void OnError(EventArgs e)·½Ê½ÖÐOnError±»Ö´ÐÐÍê±Ïºó»ùÀà(Page)µÄOnErrorÔÚºóÐø±»µ÷ÓÃ,µ±Ç°Ò³ÃæË漴ɥʧ¿ØÖÆȨ.
protected void Page_Error(object sender, EventArgs e)
{
&nb ......
ÎÒÃÇ»¹¿ÉÒÔ²ÉÓÃÒ»ÖÖ¸ü¼Ó¼ò±ãµÄ·½
·¨À´ÊµÏÖÉÏÊö³ÌÐòµÄ¹¦ÄÜ¡£Õâ¾ÍÊǽ«SqlConnection¶ÔÏó°üº¬µ½usingÇø¿éÖУ¬ÕâÑù³ÌÐò»á×Ô¶¯µ÷ÓÃDispose()·½·¨ÊÍ·Å
SqlConnection¶ÔÏóËùÕ¼ÓõÄϵͳ×ÊÔ´£¬ÎÞÐèÔÙʹÓÃSqlConnection¶ÔÏóµÄClose()·½·¨¡£
·¶Àý³ÌÐò´úÂëÈçÏ£º
public partial class _Default : System.Web.UI.Page
{
......
Process p = new Process();
p.StartInfo.FileName = "cmd.exe"; //設¶¨³ÌÐòÃû
p.StartInfo.Arguments = "/c " command; //設¶¨³Ìʽ執ÐÐ參數
p.StartInfo.UseShellExecute = false; //關閉ShellµÄʹÓÃ
p.StartInfo.RedirectStandardInput = true; //Öض¨Ïò標準 ......