ASP»ñÈ¡µ±Ç°ÎļþÃûµÄ·½·¨ ÀûÓú¯ÊýInstrRev()
¡¡¡¡ÔÚASP±à³ÌµÄ¹ý³ÌÖУ¬»ñÈ¡µ±Ç°²Ù×÷µÄÎļþµÄÎļþÃû£¬ÊÇÒ»¸ö·Ç³£³£Óõ͝×÷£¬ASPºÃÏñûÓÐ×Ô¼ºÄÚÖú¯Êý£¬ËùÒÔÕâ¸ö²Ù×÷ÎÒÃÇÐèÒª×Ô¼º±àº¯ÊýÀ´Íê³É¡£½ñÌìÒ»¸öÀÏÅóÓÑÎÊÎÒÔõô×ö£¬ÎÒã¶ÁËһϣ¬»¹ÔÚÏëÓÐûÓÐÄÚÖú¯Êý£¬ÊµÔÚûÏëÆðÀ´£¬²»ÖªµÀÊÇÕæµÄûÓл¹ÊÇÎÒ²»ÖªµÀ¡£ºÇºÇ~²»¹ÜÁË£¬×îºóÎÒ»¹ÊÇ×Ô¼ºÐ´ÁËÒ»¸öСº¯ÊýÀ´Íê³ÉµÄ£¬²»¹ý²»ÊÇÎÒµÄÔ´´£¬ÍüÁËÔÚÄĶù¿´µ½µÄ·½·¨£¬Ò»Ö±¼ÇÔÚÐÄÀï¡£
½éÉÜÒ»ÏÂInstrRevº¯Êý
InstrRevº¯Êý£º´Ó×Ö·û´®µÄ×îºóÒ»¸ö×Ö·ûËÑË÷Æð£¬ÏòÇ°ÃæÖð¸öËÑË÷Ç°Ãæ×Ö·û´®£¬·µ»Ø×Ö·ûÔÚ×Ö·û´®µ±Öеĵڼ¸Î»¡£
¾ÙÀýÀ´ËµÃ÷ÆäÓ¦Óãº
ASP/Visual Basic´úÂë
<%
Dim strTXT,pos
strTXT=www.baidu.com
pos=instrRev(strTXT,".")
Response.Write pos
%>
InstrRevº¯ÊýËÑË÷µÄÆðʼÊǵ¹Ðò£¬µ¹×ÅËÑË÷µ½comǰµÄÄǸö“.”¡£·µ»ØÕâ¸öµãÔÚ×Ö·û´®ÖеÄλÖ㬴Ó0¿ªÊ¼¼ÆÊý£¨ÀàËÆÊý×飩£¬Õâ¸öµãΪµÚ12룬ËùÒÔ·µ»ØµÄ½á¹û½«ÊÇ11¡£
ͨ¹ý´ËÔÀí£¬ÎÒÃDz»¹â¿ÉÒÔÈ¡µÃASPÒ³ÃæµÄÎļþÃû£¬»¹¿ÉÒÔ»ñÈ¡ÓòÃûºó׺ÃûµÈÐÅÏ¢£¬Ó¦Óû¹ÊDZȽϹ㷺µÄ¡£
ÏÂÃæÕ⼸¾ä´úÂë¾ÍÊÇʵÏÖ»ñÈ¡µ±Ç°ÎļþÃû£¨·Åµ½ASPÒ³ÃæÀ¾ÍÄÜ´òÓ¡³öµ±Ç°ÎļþÃû£©£º
ASP/Visual Basic´úÂë
Dim strURL,intPos,intStrLen,strFileName
strURL = Request.Servervariables("url")
intPos = InstrRev(strURL,"/")
intStrLen = len(strURL)
strFileName = Right(strURL,intStrLen-intPos)
Response.Write strFileName
Èç¹ûÏ£Íûº¯ÊýÀ´»ñÈ¡£¬µ÷ÓÃÈçÏÂgetFileName()º¯Êý¼´¿ÉʵÏÖ£º
ASP/Visual Basic´úÂë
Function getFileName()
Dim strURL,intPos,intStrLen,strFileName
strURL = Request.Servervariables("url")
intPos = InstrRev(strURL,"/")
intStrLen = len(strURL)
strFileName = Right(strURL,intStrLen-intPos)
getFileName = strFileName
End Function
Ïà¹ØÎĵµ£º
<!--#include file="config.asp" -->
<!--#include file="Fun.asp" -->
<%
'Êý¾Ý¿â¹ÜÀíÀà
class Datas
'±¸·Ý
public sub Bk()
Set fso=server.createobject("scripting.filesystemobject")
fso.CopyFile Server.MapPath(SiteDataPath),Server.MapPath(SiteDataBakPath)
......
ÔÚaspÊý×鶨ÒåÖÐ,¿ÉÒÔÖ±½Ó¶¨Òå,Ò²¿ÉÒÔʹÓÃArrayº¯Êý¶¨Òå..
ÏÈ¿´ÓÃArray()º¯Êý¶¨ÒåÀý×Ó:
<%
dim MyArray
MyArray=Array("ÌìÑÄ·çÔÆ","СС³ÌÐòÔ±")
%>
<p><%=MyArray(1)%></p>
·µ»Ø½á¹û:СС³ÌÐòÔ±
Ö±½Ó¶¨Òå:
<%
dim MyArray(2)
MyArray(0)="ÌìÑÄ·çÔÆ"
MyArray(1)="СС³ ......
WebService·þÎñ¶Ë¿ª·¢
1¡¢´´½¨WebService¹¤³Ì£¬Ñ¡ÔñXFire Core¿â
2¡¢´´½¨ÒµÎñ½Ó¿ÚºÍÆäʵÏÖÀࣨÍê³ÉÒµÎñ·½·¨µÄ¶¨ÒåºÍʵÏÖ£©
3¡¢ÐÞ¸ÄÅäÖÃÎļþservice.xml
4¡¢Èç¹ûÐèҪʹÓÃWSDL£¬ÔòÐèÒªµ¼Èëxalan.jarÎļþÖÁWEB-INF/libÖÐ
5¡¢µ¼³ö½Ó¿ÚÖÁjar°üÖÐΪ¿Í»§¶Ë×ö×¼±¸
WebService¿Í»§¶Ë¿ª·¢
1¡¢´´½¨Web¹¤³Ì£¬Ìí¼Ó¹¹½¨Â·¾¶£¬Ñ¡ÔñX ......
ÒÔmysql5.1ΪÀý
ÏÈÏÂÔØmysql-connector-odbc²¢°²×°
1¡¢Ö±½ÓÁ¬½Ó
conn.asp
<%
strconnection="driver={mysql odbc 5.1 driver};database=test1;server=localhost;uid=root;password=root"
set conn = server.createobject("adodb.connection")
conn.open strconnection
%>
2¡¢DSNÁ¬½Ó
ÐèÒªÏÈÔÚÊý¾ÝÔ´ (OD ......