ÔÚ ¼ÆËã»ú¹ÜÀí->InterNetÐÅÏ¢·þÎñ -> ĬÈÏÍøÕ¾ -> ÓÒ¼ü -> н¨ -> ÐéÄâĿ¼ £¨±ðÃû£ºÏ൱ÓÚÎļþ¼Ð£©-> Ñ¡ÔñÔ´ÎļþµÄ·¾¶£¬Ð½¨Íê³É
ÓÒ¼üµã»÷¸Õ¸Õн¨µÄÐéÄâĿ¼£º
ÐéÄâĿ¼£º¹´Ñ¡ ¶ÁÈ¡¡£Ö´ÐÐȨÏÞ£º´¿½Å±¾¡£ºóÀ´ÓÖÓöµ½ÁËÕâÑùµÄ´íÎó£º ÔÚ
Ó¦ÓóÌÐò¼¶±ðÖ®ÍâʹÓÃ×¢²áΪ allowDefinition='MachineToApplication' µÄ½ÚÊÇ´íÎóµÄ¡£ ¸ù¾ÝÍøÉϲ鵽µÄ×ÊÁÏ£¬ÔÚÕâÀïÓÐÒ»¸ö Ó¦ÓóÌÐòÃû£¬µã»÷ ´´½¨£¬ÎÊÌâ¾Í½â¾öÁË¡£
Îĵµ£ºÆôÓÃĬÈÏÄÚÈÝÎĵµ¡£ÕâÀïÖ»ÐèÒª·ÅµÚÒ»¸öÒª·ÃÎ浀 .aspx Ò³Ãæ¾Í¿ÉÒÔÁË¡£
asp.net £ºÑ¡Ôñ asp.net °æ±¾£¬ÎÒÑ¡µÄÊÇ£º2.0
ÒÔÉϵÄÉèÖÃÍêºó£¬ÓÖÅöµ½ÁËÁíÒ»¸ö´íÎó£º
Óû§ 'NT
AUTHORITY\NETWORK SERVICE' µÇ¼ʧ°Ü¡£
ÕâÀïµÄ½â¾ö·½·¨£¬²Î¿¼±ðÈ˵ģº
µÚÒ»²½£º°Ñ'NT AUTHORITY\NETWORK SERVICE' Ìí¼Óµ½Administrator×éÖÐ
ÎҵĵçÄÔ-->ÓÒ¼ü-->¹ÜÀí-->±¾µØÓû§ºÍ×é
Ñ¡Ôñ“×é”-->Ë«»÷Administrators-->µ¥»÷“Ìí¼Ó”-->µ¥»÷“¸ß¼¶”-->µ¥»÷“Á¢¼´²é
ÕÒ”-->ÔÚÏÂÃæµÄÁбíÖÐÑ¡ÔñNetwork ServiceÓû§-->Á½´Îµ¥»÷“È·¶¨”-->¼ÓÈë¡£
µÚ¶þ²½ ÔÚÆóÒµ¹ÜÀíÆ÷Ö ......
ÔÚ±àдASP³ÌÐòµÄʱºò£¬Í¨³£¶¼»áÓõ½<!--#include virtual/file="path/filename"-->°ÑÒ»¶ÎÏà¶Ô¶ÀÁ¢µÄÎļþ´úÂëǶÌ×µ½µ±Ç°Ò³ÃæÖÐÀ´¡£
¡¡¡¡Ê¹ÓÃ"file"µÄʱºò£¬µÈºÅºóÃæʹÓõÄÊÇÏà¶Ô·¾¶¡£Ê¹ÓÃ"virtual"µÄʱºò£¬µÈºÅºóÃæʹÓõÄÊǾø¶Ô·¾¶¡£ºÜ¶àÈ˶¼²»ÖªµÀvirtualÕâ¸ö°üº¬¾ø¶Ô·¾¶¡£ ......
Ê×ÏÈÉêÃ÷£ºÕâ¸öÊÇÎÒתÔصģ¬ÖÂÁ¦ÓÚΪÏñÎÒÒ»ÑùµÄÐÂÊÖÌṩ°ïÖú£¡
1¡¢IISÏÂ301ÉèÖà InternetÐÅÏ¢·þÎñ¹ÜÀíÆ÷ -> ÐéÄâĿ¼ -> Öض¨Ïòµ½URL£¬ÊäÈëÐèҪתÏòµÄÄ¿±êURL£¬²¢Ñ¡Ôñ“×ÊÔ´µÄÓÀ¾ÃÖض¨Ïò”¡£
2¡¢ASPϵÄ301תÏò´úÂë
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “http://www.xuehi.com/articles/301/”
%>
3¡¢ASP.NetϵÄ301תÏò´úÂë
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.xuehi.com/articles/301/“);
}
</script>
4¡¢PHPϵÄ301תÏò´úÂë
header(”HTTP/1.1 301 Moved Permanently”);
header(”Location: http://www.xuehi.com/articles/301/”);
exit();
5¡¢CGI PerlϵÄ301תÏò´úÂë
$q = new CGI;
print $q->redirect(”http://www.new-url.com/”);
6¡¢JSPϵÄ301תÏò´úÂë
&l ......
Ê×ÏÈÉêÃ÷£ºÕâ¸öÊÇÎÒתÔصģ¬ÖÂÁ¦ÓÚΪÏñÎÒÒ»ÑùµÄÐÂÊÖÌṩ°ïÖú£¡
1¡¢IISÏÂ301ÉèÖà InternetÐÅÏ¢·þÎñ¹ÜÀíÆ÷ -> ÐéÄâĿ¼ -> Öض¨Ïòµ½URL£¬ÊäÈëÐèҪתÏòµÄÄ¿±êURL£¬²¢Ñ¡Ôñ“×ÊÔ´µÄÓÀ¾ÃÖض¨Ïò”¡£
2¡¢ASPϵÄ301תÏò´úÂë
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “http://www.xuehi.com/articles/301/”
%>
3¡¢ASP.NetϵÄ301תÏò´úÂë
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.xuehi.com/articles/301/“);
}
</script>
4¡¢PHPϵÄ301תÏò´úÂë
header(”HTTP/1.1 301 Moved Permanently”);
header(”Location: http://www.xuehi.com/articles/301/”);
exit();
5¡¢CGI PerlϵÄ301תÏò´úÂë
$q = new CGI;
print $q->redirect(”http://www.new-url.com/”);
6¡¢JSPϵÄ301תÏò´úÂë
&l ......
Ê×ÏÈÉêÃ÷£ºÕâ¸öÊÇÎÒתÔصģ¬ÖÂÁ¦ÓÚΪÏñÎÒÒ»ÑùµÄÐÂÊÖÌṩ°ïÖú£¡
1¡¢IISÏÂ301ÉèÖà InternetÐÅÏ¢·þÎñ¹ÜÀíÆ÷ -> ÐéÄâĿ¼ -> Öض¨Ïòµ½URL£¬ÊäÈëÐèҪתÏòµÄÄ¿±êURL£¬²¢Ñ¡Ôñ“×ÊÔ´µÄÓÀ¾ÃÖض¨Ïò”¡£
2¡¢ASPϵÄ301תÏò´úÂë
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “http://www.xuehi.com/articles/301/”
%>
3¡¢ASP.NetϵÄ301תÏò´úÂë
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.xuehi.com/articles/301/“);
}
</script>
4¡¢PHPϵÄ301תÏò´úÂë
header(”HTTP/1.1 301 Moved Permanently”);
header(”Location: http://www.xuehi.com/articles/301/”);
exit();
5¡¢CGI PerlϵÄ301תÏò´úÂë
$q = new CGI;
print $q->redirect(”http://www.new-url.com/”);
6¡¢JSPϵÄ301תÏò´úÂë
&l ......
aspÔÚµ÷ ÓÃÎļþµÄʱºòÒ»°ãÓà includeÓï¾äÈ磺<! #include file="filename.asp" -->ÔÚµ÷ÓÃÎļþµÄʱºò¶ÔÓÚ¾²Ì¬ÎļþÒ»°ãÓÃiframeÓÃinclude²»Æð×÷Óã¬ÔÚһЩ¶¯Ì¬µÄÎļþÃûµÄʱºòÒ»°ãÓà Èç¹ûÒª¶¯Ì¬µÄ°üº¬ÎļþÇëʹÓà ÈçÏ£º
server.transfer Îļþ
»ò
server.execute Îļþ
¶ø²»ÄÜÓ¦ÓÃÈç<! #include file="µ÷ÓõIJÎÊý.asp" -->
......
<%
set conn= server.createobject("ADODB.connection")
conn.open "driver={sybase driver 10};"
"srvr=SYBASE;"
"UID=sa;"
"pwd=sybase;"
sql="select no from tab_stud"
set rs=conn.Execute("sql")
response.write rs
%>
string connStr = "Provider=SAOLEDB.10;uid=dba;pwd=sql;Links=TcpIp(host=192.168.1.2;serverport=2638);eng=mysadb";
OleDbConnection oleConn = new OleDbConnection(connStr);
OleDbCommand oleComm = new OleDbCommand("select count(*) from t_test");
oleComm.Connection = oleConn;
......
<%
set conn= server.createobject("ADODB.connection")
conn.open "driver={sybase driver 10};"
"srvr=SYBASE;"
"UID=sa;"
"pwd=sybase;"
sql="select no from tab_stud"
set rs=conn.Execute("sql")
response.write rs
%>
string connStr = "Provider=SAOLEDB.10;uid=dba;pwd=sql;Links=TcpIp(host=192.168.1.2;serverport=2638);eng=mysadb";
OleDbConnection oleConn = new OleDbConnection(connStr);
OleDbCommand oleComm = new OleDbCommand("select count(*) from t_test");
oleComm.Connection = oleConn;
......
<%
set conn= server.createobject("ADODB.connection")
conn.open "driver={sybase driver 10};"
"srvr=SYBASE;"
"UID=sa;"
"pwd=sybase;"
sql="select no from tab_stud"
set rs=conn.Execute("sql")
response.write rs
%>
string connStr = "Provider=SAOLEDB.10;uid=dba;pwd=sql;Links=TcpIp(host=192.168.1.2;serverport=2638);eng=mysadb";
OleDbConnection oleConn = new OleDbConnection(connStr);
OleDbCommand oleComm = new OleDbCommand("select count(*) from t_test");
oleComm.Connection = oleConn;
......
Èç¹ûÔÚÒ»¸öÍøÕ¾µÄÒ³ÃæÖÐÏëµ÷ÓÃÆäËûÍøÕ¾Ò³ÃæÄÚÈÝ£¬Ö±½ÓÓÃһϴúÂë¾Íok£¬http://www.wanyusoft.com/index.asp Õâ¸ö·¾¶¾ÍÊÇËùÒªµ÷ÓõÄÒ³Ãæ·¾¶¡£
<%
response.write(getHTTPPage("http://www.wanyusoft.com/index.asp"))
function getHTTPPage(url)
dim http
set http=createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function
Function bytes2BSTR(vIn)
dim wanyusoft_strReturn
dim i,ThisCharCode,NextCharCode
wanyusoft_strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
wanyusoft_strReturn = wanyusoft_strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
wanyusoft_strReturn = wanyusoft_strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = wanyusoft_strReturn
End Functio ......