3
我有一個C#網站。它引用了幾個編譯的dll。 我的dll需要訪問網站上的文件夾。 如何從dll中找到網站的根路徑?如何從dll找到網站的根路徑?
我已經試過
System.Environment.CurrentDirectory - > 「C:\ Program Files文件\微軟的Visual Studio 9.0 \ Common7 \ IDE」
Assembly.GetExecutingAssembly()的位置 - > C: \ WINDOWS \ Microsoft.NET \框架\ V2.0.50727 \臨時ASP.NET文件......
我打算用
System.Web.HttpContext.Current.Server.MapPath()
但System.Web.HttpContext.Current爲空。
謝謝!
非常好,正是我需要的。謝謝! – 2010-03-12 04:17:36