“クラスは自動化をサポートしていません” Request.ServerVariables(“ remote_host”)を呼び出すとエラーが発生する

StackOverflow https://stackoverflow.com/questions/152817

質問

現在、ユーザーのIPを詳細に保存するeコマースサイトの基本的なCookieを作成中です。

次に、閲覧したページをデータベースに記録し、最近閲覧したページのリストを引き出します。

ただし、次のコードに問題があります。

dim caller
caller = Response.Cookies("caller")
if caller = "" then 
    caller = Request.ServerVariables("remote_host")
end if  

これを実行すると、次のエラーメッセージが表示されます。

" Sun ONE ASP VBScriptランタイム(0x800A01AE) クラスは自動化をサポートしていません"

アイデアはありますか? Googleには明らかなものは何もありません。

役に立ちましたか?

解決

値を確認するときはRequest.Cookiesである必要があります。:

dim caller
caller = Request.Cookies("caller")
if caller = "" then 
    caller = Request.ServerVariables("remote_host")
end if
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top