nmduc073 posted on March 28, 2009 05:57

::483 view(s)
Lệnh lấy đường dẫn tới Module:
ModulePath
Lệnh lấy đường dẫn tới Portal:
PortalSettings _portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];
_portalSettings.HomeDirectory
Lấy đường dẫn tới Application:
Request.ApplicationPath
Ngoài ra có thể chia cắt lại đường dẫn ở ModulePath để lấy đường dẫn Application cũng được.
Để lấy chính xác đường dẫn thì cần thêm Server.MapPath cho mấy thằng trên.
Ví dụ cụ thể:
Module: /MySiteDNN1/DesktopModules/MyImportFileDemo/
Portals: /MySiteDNN1/Portals/0/
Application: /MySiteDNN1
[Read the rest of this article...]