在ASP.NET中,我想創建指向特定Uri的鏈接,並通過電子郵件將此鏈接發送給用戶,例如http://www.BlaBla.com/CustomerPortal/Order/9876
。我可以在代碼隱藏中動態創建Uri /CustomerPortal/Order/9876
的第二部分。我的問題是:如何創建基本Uri http://www.BlaBla.com
而不在我的應用程序中進行硬編碼?基本上我想有這樣的:如何動態創建資源的完全限定超鏈接?
http://localhost:1234/CustomerPortal/Order/9876 (on my development machine)
http://testserver/CustomerPortal/Order/9876 (on an internal test server)
http://www.BlaBla.com/CustomerPortal/Order/9876 (on the production server)
那麼,有沒有辦法問哪裏運行應用程序服務器:「請告訴我的應用程序的基本URI」?或者其他方式?
預先感謝您!
好和簡單的解決方案!謝謝! – Slauma 2010-06-12 12:03:04
@Slauma歡迎您 – Dewfy 2010-06-12 12:05:02