推奨:Googleに似たASP AJAX検索のヒントの簡単な分析メインファイルは次のとおりです。html実装関数、テキストボックス、入力コンテンツ、プロンプト検索のコンテンツを実装し、テキストボックスに入力したコンテンツをデータベースに照会し、クライアントconn.aspデータベース関数、実装、および実装、および
HTMLを生成する多くのニュースシステムがありますが、それらはすべてテンプレートを使用しています。この関数は、ASPページによって生成されたHTMLコードをHTMLファイルに保存するため、元のページを変更する必要はありません。
HTMLを生成するニュースシステムを完成させます。 ^_^
コードは短いので、ここではコメントしません
<%
'ターゲットページにファイル、つまり#includeページが含まれている場合、このプログラムに問題があります。
'注:このファイルは、Filenameによって指されたファイルと同じディレクトリに配置する必要があります
| 以下は引用されたコンテンツです。 dim hughchiu_rtcode 関数get_exe_code(filename) dime execode DIM TMP_STR dim re、re1、content、fso、f、aspstart、aspend 薄暗いms、m execode = fso = createObject(scripting.filesystemObject)をset f = fso.opentextfile(server.mappath(filename))を設定します content = f.readall f.close f =何も設定しません FSO =何も設定しません re = new regexpを設定します re.ignorecase = true re.global = true re.pattern = <%@[^%]%> content = re.replace(content、) re.global = false re.pattern = <! - s*#include*files*= s*([^])s* - > する ms = re.execute(content)を設定します Ms.Count <> 0の場合 M = MS(0)を設定します tmp_str = get_exe_code(m.submatches(0)) content = re.replace(content、tmp_str) それ以外 終了します ifを終了します ループ M = Nothingを設定します MS =何も設定しません re.pattern =^s*= Aspend = 1 ASPSTART = Instr(Aspend、Content、<%)2 re1 = new regexpを設定します re1.ignorecase = true re1.global = false re1.pattern = respons.write(。) aspstart> aspend 1を実行します execode = execode&vbcrlf&hughchiu_rtcode = hughchiu_rtcode && lepplay(mid(content、aspstart-aspend-2),,)、vbcrlf、 &vbcrlf&)&& vbcrlf aspend = strunt(aspstart、content、%>)2 tmp_str = mid(content、aspstart、aspend-aspstart-2) する ms = re1.execute(tmp_str)を設定します Ms.Count <> 0の場合 M = MS(0)を設定します tmp_str = re1.replace(tmp_str、hughchiu_rtcode = hughchiu_rtcode && m.submatches(0)) それ以外 終了します ifを終了します ループ M = Nothingを設定します MS =何も設定しません execode = execode&re.replace(tmp_str、hughchiu_rtcode = hughchiu_rtcode&) ASPSTART = Instr(Aspend、Content、<%)2 ループ re1 =何も設定しません re =何も設定しません execode = execode&vbcrlf&hughchiu_rtcode = hughchiu_rtcode && cheplage(falling(mid(content、aspend)、)、vbcrlf、&vbcrlf&) && vbcrlf get_exe_code = <%&execode&%> エンド関数 関数ASP2HTML(ファイル名) 薄暗いコード code = chepplace(leplage(get_exe_code(filename)、hughchiu_rtcode = hughchiu_rtcode && vbcrlf、)、<%、)、%>、) 'Response.Write(コード) execute(code) 'Response.Write(hughchiu_rtcode) asp2html = hughchiu_rtcode エンド関数 %> |
使用例:
| 以下は引用されたコンテンツです。 f.writeLine(asp2html(youpage.asp)) f.close f =何も設定しません FSO =何も設定しません |
共有:スタートアップスクリプトを通じてASPの力を知覚しますほとんどの言語スクリプトと同様に、ASPを学ぶ最良の方法は、ASPを試して、独自のシステムを使用してPWSまたはIISをインストールすることです。学習中に、自分のサーバーでASPコンポーネントと機能をテストできます。学習を促進するために、いくつかのファックをまとめました