C#取得Web程序和非Web程序的根目录的N种取法总结
非Web程序 1.AppDomain.CurrentDomain.BaseDirectory 2.Environment.CurrentDirectory 3.HttpRuntime.BinDirectory The path to the current application's/bin dir
非Web程序 1.AppDomain.CurrentDomain.BaseDirectory 2.Environment.CurrentDirectory 3.HttpRuntime.BinDirectory The path to the current application's/bin dir
仔细一看,SSO返回的ticket也不相同,才发现原来IIS重启了,最后解决方案如下: 新建一个类继承IHttpModule 实现代码如下: /// /// Stops the ASP.NET AppDomain being restarted (which clears /// Session
如果你曾经修改了ASP.NET应用程序(dll文件),与修改了bin文件夹或Web.config文件(添加/删除/重命名的文件等),而该网站在运行,你可能已经注意到,这将导致在AppDomain的重新启动。所有的会话状态会丢失和网站再次成功启动,任何登录的用户将被退出(假设你不使用持久Cookie身
实现代码如下:/// /// 生成google网站地图 /// /// public static boolBuildGoogleSitemap() { try { string RootDirectory = AppDomain.CurrentDomain.BaseDirectory; Xm