![](/img/trans.png)
[英]How to detect the url opening from web browser(chrome) or webview(mobile app) using jquery/javascript in the website?
[英]How to Disable Website URL in a Web browser?
我希望任何用戶都不要編輯我的網站URl。
表示當用戶登錄myWebsite時,他/她位於studenthome.aspx上,並且URL(www.XXXXXX.com/studenthome.aspx)不可編輯。
當我在Internet上搜索並以javascript代碼獲取結果但我想要c#代碼時會出現此問題。 謝謝
C#用作服務器端語言,您無法使用C#訪問用戶的瀏覽器功能。 您需要使用客戶端語言(JavaScript)來執行此操作。
如果您使用JavaScript獲取代碼,則可以使用ScriptManager.RegisterStartupScript(this,typeof(Page), "key", "your script", true);
用c#編寫ScriptManager.RegisterStartupScript(this,typeof(Page), "key", "your script", true);
無論如何,它都會出現在Web瀏覽器中。要進行加密,您可以使用任何腳本編碼器工具對JavaScript進行編碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.