ÓÃasp.netÉú³Éhtml¾²Ì¬Ò³µÄÁ½ÖÖ·½·¨~~~
µÚÒ»ÖÖ·½·¨ÊǶÔÒ»¸öaspxÒ³ÃæÉú³ÉhtmlÎļþ£¬ÏȶԷþÎñÆ÷·¢ËÍÇëÇóaspxÒ³Ãæ£¬È¡·þÎñÆ÷·µ»ØµÄhtmlÁ÷£¬Ð´µ½Ò»¸öhtmlÎļþÀaspxÒ³ÃæÏÔʾµÄÊÇʲô£¬Éú³ÉµÄhtmlÒ³Ãæ¾ÍÊÇʲô
£±¡¢asp·½·¨£º
sub createHTML
dim xmlhttp,strhtml,objAdoStream,i,myurl
set xmlhttp=server.CreateObject("Microsoft.XMLHTTP")
Randomize
i=Int((100 * Rnd) + 1)' ²úÉú1µ½100Ö®¼äµÄËæ»úÊý£¬Ç¿ÖÆ´ÓÊý¾Ý¿âÈ¡Êý¾Ý
myurl="aspÒ³ÃæÎļþÃû.asp?i=" &i
xmlhttp.open "GET",myurl,false
xmlhttp.send
strhtml=xmlhttp.responsebody
set objAdoStream = Server.CreateObject("ADODB.Stream")
objAdoStream.Type = 1
objAdoStream.Open
objAdoStream.Write strhtml
objAdoStream.SaveToFile server.MapPath("default.htm"),2
objAdoStream.Close
response.Write("³ÉÉúÍê±Ï")
end sub
£²¡¢VB.NET×ö½Å±¾µÄʱºòµÄasp.net·½·¨£º£¨ÔØ×Ô£ºhttp://erqie.bokee.com/5641140.html£©
ÒýÓÃÃüÃû¿Õ¼ä
Imports System.Net
Imports System.IO
Dim strHtml As String
Dim sr As StreamReader
Dim sw As StreamWriter
Dim code As Encoding = Encoding.GetEncoding("utf-8")
Dim HttpWebRequest As WebRequest
Dim HttpWebResponse As WebResponse
HttpWebRequest = WebRequest.Create("http://localhost/test.aspx")
HttpWebResponse = HttpWebRequest.GetResponse
sr = New StreamReader(HttpWebResponse.GetResponseStream, code)
strHtml = sr.ReadToEnd
sw = New StreamWriter(Server.MapPath("a.htm"), False, code)
sw.WriteLine(strHtml)
sw.Flush()
sw.Close()
Response.WriteFile(Server.MapPath("a.htm"))
£³¡¢ÓÃC#×ö½Å±¾µÄasp.netµÄ·½·¨£¬Õâ¸öÊÇÎÒ×Ô¼ºÐ´µÄ£¬ÔÚ¡¶Visual C#.NET·¶ÀýÈëÃÅÓëÌá¸ß¡·µÄP311£¬ÓжÔWebRequestºÍHttpRequest¡¢HttpWebRequest¡¢HttpWebResponseËĸöÀàµÄ¼òµ¥ËµÃ÷
private bool CreateList
Ïà¹ØÎĵµ£º
ÓÐÈËÒ²ÎÊÁ˸öÔÚÏßͳ¼ÆµÄÎÊÌ⣬ÎҵļûÒâÊÇÕâÑùµÄ£º
ÔÚApplication_StartʼþÖмÓÈëÒÔÏ´úÂ룺
Application.Lock();
Application.["UserCount"]=0;
Application.Unlock();
Session_Startʼ ......
»¶Ó½øÈë.NETÉçÇøÂÛ̳£¬Óë200Íò¼¼ÊõÈËÔ±»¥¶¯½»Á÷ >>½øÈë
ASP.NET Êý¾Ý¿Ø¼þ:GridView,DataList,Repeater ,DetailsView,FormView¡£
ASP.NET Êý¾Ý¿Ø¼þ×ÛÊö£º
1.ǰ3¸öÓÃÓÚ³ÊÏÖ¶àÌõ¼Ç¼,ºóÃæ2¸öÓÃÓÚ³ÊÏÖµ¥ÌõÊý¾ÝÃ÷ϸ,¼´³£ÓõļǼÃ÷ϸ¡£
2.GridViewºÍDetailsView¿Ø¼þµÄ²¼¾Ö¹Ì¶¨,×Ô¶¨ÒåÊý¾ÝÏÔʾµÄ²¼¾Ö¹¦ÄÜÓÐÏÞ,Ò»°ã ......
ǰÑÔ£ºµ±Ò»¸öHttpÇëÇó·¢Ë͸øÒ»¸öaspxÒ³ÃæÊ±,·þÎñÆ÷½øÐÐÁËÄÄЩ²Ù×÷£¿ÓÖÈçºÎÀ´½âÎöÕâ¸öÇëÇó£¿ASP.NETÔÚ½ÓÊÕÇëÇóºóÊÇÔõôÔËÐеģ¬ÈçÔõô±àÒëÒÔ¼°ÔõôÑùÓÃÍйܵĴúÂëÀ´ÔËÐеģ¿.....Àí½âÕâЩÎÊÌ⣬ʹÎÒÃÇ¿ÉÒÔ¸ü¼ÓºÃµÄ¿ª·¢ASP.NET¡£
¡¡¡¡1.µ±ÎÒÃÇÔÚä¯ÀÀÆ÷ÖÐÇëÇóÒ»¸öASP.NETÍøÕ¾µÄij¸öÒ³ÃæµÄʱºò£¬È磬ÎÒÃÇÔÚä¯ÀÀÆ÷ÖÐÊäÈë" ......
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
< ......
asp.netÖГÏß³ÌÕý±»ÖÐÖ¹”Òì³£µÄ½â¾ö·½·¨
ÔÚÏîÄ¿À︺ÔðÒì³£´¦Àí²¿·Ö£ºÒì³£ÐÅÏ¢µÄдÈ룬¶ÁÈ¡£¬²é¿´£¬Òò´Ë¾Í¿ÉÒÔ¿´µ½¸÷ÖÖÒì³££¬ÊÜÒæ·Ëdz
¿´µ½ÓÐN¶àµÄ“Ïß³ÌÕý±»ÖÐÖ¹”Òì³££¬¶øÇÒÀ´×Ôͬһ¸öÒ³Ãæ¡£
System.Threading.ThreadAbortException: Ïß³ÌÕý±»ÖÐÖ¹¡£
at System.Threading.Thread.AbortInternal( ......