一直在想測試用戶行爲分析的時候,通過程序(本地服務程序)獲取IE上的Url地址,對當前的url分析,並結合我的情況分析我的行爲方式。現在瀏覽網站的時候偶然看到了幾行代碼,不知道原始出處,就暫時轉載記錄下來。
System.AppDomain objAPDom = System.AppDomain.CurrentDomain;
object obj = objAPDom.GetData("APP_LAUNCH_URL");
“name”的值 | 屬性 |
---|---|
"APPBASE" | ApplicationBase |
"APP_CONFIG_FILE" | ConfigurationFile |
"DYNAMIC_BASE" | DynamicBase |
"DEV_PATH" | (無屬性) |
"APP_NAME" | ApplicationName |
"CACHE_BASE" | PrivateBinPath |
"BINPATH_PROBE_ONLY" | PrivateBinPathProbe |
"SHADOW_COPY_DIRS" | ShadowCopyDirectories |
"FORCE_CACHE_INSTALL" | ShadowCopyFiles |
"CACHE_BASE" | CachePath |
(應用程序特定的) | LicenseFile |
錯誤代碼:
//應用程序域
System.AppDomain objAPDom = System.AppDomain.CurrentDomain;
object obj = objAPDom.GetData("APP_LAUNCH_URL");
if (obj == null)
{
strURL = "";
}
else
{
strURL = obj.ToString();
}