1. ASPを使用してWebサイトの仮想物理パスを決定する方法
回答:Mappathメソッドを使用します
palig = centerfontsize = 4face = arialb
thephysicalpath tothisvirtualwebsiteis
bfont
fontcolor =#ff0000size = 6face = arial
%= server.mappath()%
fontp
2。ユーザーが使用しているブラウザをどのように知ることができますか
回答:coestObjectメソッドを使用します
strbrowser = request.servervariables(http_user_agent)
ifinstr(strbrowser、msie)0 -then
Response.redirect(formsieonly.htm)
それ以外
Response.redirect(forall.htm)
endif
3. 1日あたりの繰り返し訪問の平均数を計算する方法
回答:解決策
%startdate = datediff(d、now、01011990)
ifstrdate0thensstartdate = startdate-1
avgvpd = int((usercnt)startdate)%
結果を表示します
%response.write(avgvpd)%
thatisit.thispagehavebeenviedsincenovember10,1998
4.ランダム画像を表示する方法
%DIMP、PPIC、DPIC
PPIC = 12
ランダム化
p = int((ppicrnd)+1)
dpic = graphixrandompics&p&.gif
%
見せる
imgsrc =%= dpic%
5.前のページに戻る方法
回答:ahref =%= request.servervariables(http_referer)%preivouspagea
または、次のような写真を使用します。
imgsrc = arrowback.gifalt =%= request.servervariables(http_referer)%
6.相手のIPアドレスを決定する方法
回答:%= request.servervariables(remote_addr)%
7.写真にリンクする方法
回答:%@言語= vbscript%
%Response.Expires = 0
StrimageName = graphixerrorserroriamge.gif
Response.redirect(strimageName)
%
8。パスワード入力ダイアログボックスを強制します
回答:この文をページの先頭に置く
%Response.Status = 401Notauthorized
Response.End
%
9.あるページから別のページに変数を渡す方法
回答:非表示型を使用して変数を渡します
%formmethod = postaction = mynextpage.asp
%foreachiteminrequest.form%
inputnamee =%= item%type = hidden
value =%= server.htmlencode(request.form(item))%
%次%
形状
10.なぜASPプログラムでMSGBoxを使用するのですか?プログラムエラーには、許可がないと述べています
回答:ASPはサーバーによって実行されるため、ダイアログボックスをサーバーに表示できる場合、プログラムを実行し続ける前に誰かがOKを押すまで待つ必要があります。一般的に、サーバーには誰もいないので、Microsoftはこの機能を禁止し、許可がないことを伝えなければなりません。ただし、ASPとクライアントのスクリプトは、次のようにダイアログボックスを表示できます