惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - Dawnxu

修改的Flash + ASP.NET 拍照程序 AjaxPro在Windows 2000 server下不能正常使用的解决方案 MSN 8.0 邀请函! RAR 命令 新版XNet.SqlHelper 很不错的Windows 控件 Developer Express Inc.NET 鼠标按住任意控件拖动窗口 61条面向对象设计的经验原则 两个WEB程序之间的通信 本人还有50份GMail邀请函,要的请留言! 关于俱乐部活动的个人想法! 操作MS SQL Server 存储过程的类(外加ASP.NET MessageBox类) 修改的一个Title提示 大学毕业了再看你会后悔一辈子的 妙用Asp.Net中的HttpHandler [转载]ASP.NET分页的处理方式 WINDOWS2000开机硬盘自动共享 [转载]无组件上传程序ASP.NET版 C#实现的根据年月日计算星期几的函数
[转载]ASP.NET开发经验积累
Dawnxu · 2005-06-03 · via 博客园 - Dawnxu

在开发过程中,通过摸索查资料,收集了一些值得提出来的经验:
a)      相对于原来的for语句foreach具有更好的执行效率,foreach的平均花费时间只有for的30%。通过测试结果在for和foreach都可以使用的情况下,我们推荐使用效率更高的foreach。另外, 用for写入数据时间大约是读取数据时间的10倍左右;
b)      在asp.net程序中,使用sa账号的是一种非常不安全的做法,它具有在数据库上执行任何操作的权限。黑客可以调用类似于xp_cmdshell这样的扩展存储过程进行攻击;
c)      在处理数据交互的时候,尽量将组织SQL语句的处理放到中间层(比如专门的数据操作类、存储过程等),这是防止注入式攻击的有效方法;
d)      避免到服务器的不必要的往返过程。使用 Page.IsPostBack 避免对往返过程执行不必要的处理;
e)      一定要禁用调试模式;
f)      一般情况下,读取大量数据,对返回数据不做大量处理用SqlDataReader.对返回数据大量处理用DatSet比较合适.对SqlDataReader和DataSet的选择取决于程序功能的实现;
g)      数据绑定建议使用<%# ctype(Container.DataItem,DataRowView).Row("字段名") %>。数据量大的时候可提高几百倍的速度;