熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

獲取服務器和客戶端信息[3]

2013-11-13 12:21:07  來源: .NET編程 
    ——此文章摘自《ASPNET網絡數據庫開發實例精解》定價 特價 詳細>>http://tracklinktechcn/?m_id=dangdang&a_id=A&l=&l_type= width= height= border= nosave>

    serversoftText=RequestServerVariables[SERVER_SOFTWARE];
    serverportText=RequestServerVariables[SERVER_PORT];
    serveroutText=ServerScriptTimeoutToString();
    //獲取服務器的信息如虛擬地址等
    clText=RequestServerVariables[HTTP_ACCEPT_LANGUAGE];
    servertimeText=DateTimeNowToString();
    serverppathText=RequestServerVariables[APPL_PHYSICAL_PATH];
    servernpathText=RequestServerVariables[PATH_TRANSLATED];
    serverhttpsText=RequestServerVariables[HTTPS];
    serversText=SessionContentsCountToString();
    serveraText=ApplicationContentsCountToString();
    //獲取用戶浏覽器信息
    HttpBrowserCapabilities bc= RequestBrowser;
    ieText = bcBrowserToString();
    cookiesText = bcCookiesToString();
    framesText = bcFramesToString();
    javaaText = bcJavaAppletsToString();
    javasText = bcJavaScriptToString();
    msText = bcPlatformToString();
    vbsText = bcVBScriptToString();
    viText = bcVersionToString();
    //獲取浏覽者IP地址
    cipText = RequestServerVariables[REMOTE_ADDR];
    //獲取頁面執行結束時間
    DateTime etime=DateTimeNow;
    //計算頁面執行時間
    runtimeText=((etimestime)TotalMilliseconds)ToString();
    }
    }

[http://developcsaicn/dotnet_ASP/htm>]  [http://developcsaicn/dotnet_ASP/htm>]  []  [http://developcsaicn/dotnet_ASP/htm>]  


From:http://tw.wingwit.com/Article/program/net/201311/15723.html
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.