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

推荐订阅源

L
LangChain Blog
博客园 - 司徒正美
美团技术团队
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Troy Hunt's Blog
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
B
Blog
NISL@THU
NISL@THU
月光博客
月光博客
博客园 - 【当耐特】
AWS News Blog
AWS News Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
腾讯CDC
L
Lohrmann on Cybersecurity
The Cloudflare Blog
L
LINUX DO - 最新话题
S
Security @ Cisco Blogs
S
Secure Thoughts
Spread Privacy
Spread Privacy
有赞技术团队
有赞技术团队
The Last Watchdog
The Last Watchdog
Project Zero
Project Zero
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
H
Hacker News: Front Page
S
SegmentFault 最新的问题
Schneier on Security
Schneier on Security
aimingoo的专栏
aimingoo的专栏
P
Privacy & Cybersecurity Law Blog
博客园 - 三生石上(FineUI控件)
Forbes - Security
Forbes - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
InfoQ
T
Tailwind CSS Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
G
GRAHAM CLULEY
W
WeLiveSecurity
小众软件
小众软件
Recorded Future
Recorded Future
Cyberwarzone
Cyberwarzone
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org

博客园 - XXXCccddd

数据库SQL的效率 javascript去空格函数 精妙SQL语句 在AS.net中实现单点登陆 Session操作 Server.Transfer 和 Response.Redirect 区别 vs.net web项目使用visual source safe进行源代码管理 数据库设计规范 常用函数表 xmlhttp实现无刷新页面 XP风格样式表 Using Forms Authentication in ASP.NET - Part 2 Using Forms Authentication in ASP.NET - Part 1 如何关闭系统所有Excel进程 [转]每一项都是js中的小技巧,但十分的实用! asp.net中常用的一些小技巧 Visual SourceSafe应用守则(转) 应用系统架构设计-补全篇(转) 系统设计说明书(架构、概要、详细)目录结构
ASP.NET开发经验积累(转)
XXXCccddd · 2005-11-18 · via 博客园 - XXXCccddd

Posted on 2005-11-18 14:47  XXXCccddd  阅读(247)  评论()    收藏  举报

在开发过程中,通过摸索查资料,收集了一些值得提出来的经验:

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("字段名") %>。数据量大的时候可提高几百倍的速度;

以上摘自

hedonister的专栏的 Web开发学习体会