【正文】
rity is more secure than using SQL Server standard your application uses anonymous access, create a single user with very limited permissions, and perform queries by connecting as this not create SQL statements by concatenating 6 strings that involve user input. Instead, create a parameterized query and use user input to set parameter values. If you must store a user name and password somewhere to use as the database login credential, store them securely. If practical, encrypt or hash them. For details, see Encrypting and Decrypting Data. 6. Create Safe Error Messages If you are not careful, a malicious user can deduce important information about your application from the error messages it displays. Follow these guidelines: Do not write error messages that echo information that might be useful to malicious users, such as a user the application not to show detailed errors to users. If you want to display detailed error messages for debugging, check first that the user is local to the Web server. For details, see How to: Display Safe Error the customErrorsconfiguration element to control who can view exceptions from the custom error handling for situations that are prone to error, such as database access. 7. Keep Sensitive Information Safely Sensitive information is any information that you need to keep private. A typical piece of sensitive information is a password or an encryption key. If a malicious user can get to the sensitive information, then the data protected by the secret is promised. Follow these guidelines: If your application transmits sensitive information between the browser and the server, consider using Secure Sockets Layer (SSL). Use Protected Configuration to secure sensitive information in configuration files such as the or files. For more information, see Encrypting Configuration Information Using Protected you must store sensitive information, do not keep it in a Web page, even in a form that you think people will not be able to view (such as in server code).Use the strong encryption algorithms supplied in the System Security Cryptography namespace. 8 . Use Cookies Securely Cookies are an easy and useful way to keep userspecific information available. However, because cookies are sent to the browser39。Keep Sensitive Information Safely。Know Your Users。 如果文件上載是您的應用程序的一部分,則對它們的大小加以限制。包含 finally 塊,以便萬一失敗就可以在其中釋放資源。惡意用戶可以使應用程序太忙而無法為其他用戶提供服務,或者僅僅使應用程序出現故障。盡可能避免使用永久的 Cookie。例如,不要將用戶的密碼存儲在 Cookie 中,即使是暫時存儲也不要這樣做。使用 命名空間中提供的強加密算法。如果惡意用戶可以獲得敏感信息,則該信