我使用IIS 6. 我需要確定某個站點是在http還是https下運行。確定網站的協議
我嘗試使用「的DirectoryEntry」從提取的所有屬性:IIS://本地主機/ SVC/1(1是該示例中的網站ID)
下面是結果。 如果有人知道的確定IIS6協議類型編程的任何其他方式使用「的DirectoryEntry」 - 請讓我知道
AccessFlags = 513 AppIsolated = 2 KeyType = IIsWebVirtualDir Path = c:\inetpub\wwwroot AppRoot = /LM/W3SVC/1/ROOT AppFriendlyName = Default Application DefaultDoc = Default.htm,Default.asp,index.htm,iisstart.asp AnonymousPasswordSync = True DirBrowseFlags = 1073741886 CacheISAPI = True CGITimeout = 300 AuthFlags = 1 ContentIndexed = True AspLogErrorRequests = True AspScriptFileCacheSize = 250 AspScriptEngineCacheMax = 125 AspExceptionCatchEnable = True AspTrackThreadingModel = False AspAllowOutOfProcComponents = True AspEnableAspHtmlFallback = False AspEnableChunkedEncoding = True AspEnableTypelibCache = True AspErrorsToNTLog = False AspProcessorThreadMax = 25 AspRequestQueueMax = 3000 AspMaxDiskTemplateCacheFiles = 1000 AspAllowSessionState = True AspBufferingOn = True AspEnableParentPaths = True AspSessionTimeout = 20 AspQueueTimeout = -1 AspCodepage = 0 AspScriptTimeout = 90 AspScriptErrorSentToBrowser = True AppAllowDebugging = False AppAllowClientDebug = False AspKeepSessionIDSecure = False AspEnableApplicationRestart = True AspQueueConnectionTestTime = 3 AspSessionMax = -1 AspLCID = 2048 AnonymousUserName = IUSR_MASTER AspScriptLanguage = VBScript AspScriptErrorMessage = An error occurred on the server when processing the URL. Please contact the system administrator. AnonymousUserPass = wl60A8PT[[email protected] AspDiskTemplateCacheDirectory = %windir%\system32\inetsrv\ASP Compiled Templates HttpCustomHeaders = X-Powered-By: ASP.NET KeyType = IIsCertMapper
任何一個可以告訴我,如果該協議是HTTP或HTTPS? 如果不是......有人知道如何使用C#在IIS 6上檢查它嗎?
你是什麼意思'跑?'我的網站可能有http和https綁定。 – ScottE 2010-09-10 18:31:50