我正在使用C#。以下是我的示例代碼。在.NET中只獲取Referrer頁面不完整的地址
private void Page_Load(object sender, System.EventArgs e)
{
string str = Request.UrlReferrer.ToString();
Label1.Text = str;
}
結果在Label1.Text是http://localhost:82/data/WebForm1.aspx。
現在我想要的結果在Label1.Text
「WebForm1.aspx的」 你能幫幫我嗎?
謝謝。
感謝這也工作,只是爲了確認,如果我的網址包含一些查詢字符串,那麼我的結果將是WebForm1.aspx或不 – 2010-01-22 13:49:12
LocalPath將刪除關閉。 – 2010-01-22 14:32:00
非常感謝親愛的您的幫助! – 2010-01-22 14:45:34