ASP.NET small TIPS two

xiaoxiao2021-03-06  59

1. When the user changes the parameters of the URL of the address bar, prompting the user to do this to put the following code in the Page_Load event try {string straTemp = Request.urlReferR.PatHandQuery;} catch {throw new exception ("You can't Modify parameters! ");} Description: This method belongs to the" bias "method, which is used, if the user modifies the parameters of the URL, the request.urlrefer will get null, and NULL is of course impossible to have the pathandquery property, so it will throw Anomaly

2. When the user accesses a page, open the user's Window Media playback video only needs to add the following line of code in the Page_Load event, you can have response.Appendheader ("refresh", "0; URL =" mmsurl); // MMSURL video resource path for MMS protocol

Author Blog:

http://blog.9cbs.net/kwklover/

转载请注明原文地址:https://www.9cbs.com/read-114464.html

New Post(0)