var competitive=new {technique,business}

2007/8/18

杂记

DataReader:当DataReader为 SequentialAccess 时不可随机访问

js调试:
1,compilation debug="true" strict="false" explicit="true"
2,IIS配置中使用ASP调试
3,在浏览器中允许客户端调试

ProcessRequestInternal的主要工作是:
1. 创建HttpContext实例。
2. 对第一次请求进行初始化(EnsureFirstRequestInit)。
在EnsureFirstRequestInit中通过调用System.Web.HttpRuntime.FirstRequestInit进行一些初始化工作,比如:将Web.Config配置读到到RuntimeConfig中,从bin目录中装载所有dll文件。
3. 创建HttpWriter实例。
4. 通过调用HttpApplicationFactory.GetApplicationInstance创建HttpApplication实例。
在HttpApplicationFactory.GetApplicationInstance中有三个关键方法:
HttpApplicationFactory._theApplicationFactory.EnsureInited();
HttpApplicationFactory._theApplicationFactory.EnsureAppStartCalled(context);
HttpApplicationFactory._theApplicationFactory.GetNormalApplicationInstance(context);

O/R MAP:
MDA代码自动生成
dlinq更像是ActivRecord由表生成对象,列对应于属性,相对于xsd仍然还需要编写BLL不知可用性如何(如IDE的支持)
linq操作的是内存,把sql语句转移到了语言中

FCKeditor:
将文件夹权限改为程序标识用户可以读写,新建Bin文件夹拷入dll文件,在测试页面测试,更改连接及上传页面Theme=""

VSS:
先要建立与服务器的连接(net use)否则报invalid handle错误

多线程:
lock实际上是monitor的行为,Monitor.Enter(object)其中object是clr为每个类维护的变量,当进入后设为正离开后为负

权限:
在配置文件中权限级别顺序执行,子文件夹优先级高

2007/7/26

PowerDesign-概念数据模型(CDM)

PowerDesign是由一位在法国的中国人带领开发的建模工具,它支持UML、CDM、PDM等多种模型。个人使用起来感觉模型比visio少,不过在数据库建模这方面功能比较强。在网上搜了一阵只找到两个CHM帮助文档,不过对概念及应用讲得不多,后来开到cnblog上有一位老兄的博客专门讲解了PowerDesign就把几个网页整理做成了一个pdf文件,希望对大家有帮助。在此感谢Kevin Yin的辛勤劳动。

2007/6/18

Keeping Pulse on Your Site With ASP.NET 2.0 Health Monitoring[zz]

一篇图文并茂的讲解WebEvent的文章:
Keeping Pulse on Your Site With ASP.NET 2.0 Health Monitoring

2007/5/28

加密Web.Config[zz]

原文
1、打开记事本,然后将下面的代码复制到一个新文件中。
保存 my.aspx 到你的web目录 ,运行一下窗体显示 “ NT AUTHORITY\NETWORK SERVICE ”。成功!
2、(关键一步)运行cmd,执行以下 aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AUTHORITY\NETWORK SERVICE" 说明:注册默认的 RsaProtectedConfigurationProvider 的RSA 密钥容器, NetFrameworkConfigurationKey 是 RsaProtectedConfigurationProvider 的默认provider。 成功!
3、现在,可以加密web.config ,运行: 加密:aspnet_regiis -pe "connectionStrings" -app "/Myweb" 说明:"connectionStrings" 是要加密的节,"/Myweb"是的web目录 解密:aspnet_regiis -pd "connectionStrings" -app "/Myweb" 成功!
4、这样就可以在程序里调用了(不用解密, 哈哈): ... string connstr= ConfigurationManager.ConnectionStrings["myConnstr"].ConnectionString.ToString(); ...

同样的,也可以用创建自己的RSA 密钥容器,如下:
(1)、创建 "MyKeys" 密钥容器,运行:aspnet_regiis -pc "MyKeys" -exp
(2)、在web.config里加入以下: 保存。
(3)、授予帐户对计算机级别的 "MyKeys" RSA 密钥容器的访问权限,运行: aspnet_regiis -pa "MyKeys" "NT AUTHORITY\NETWORK SERVICE"
(4)、现在,可以加密web.config ,运行: 加密:aspnet_regiis -pe "connectionStrings" -app "/Myweb" -prov "MyProvider" 说明:"connectionStrings" 是要加密的节,"/Myweb"是的web目录,"MyProvider" 自己密钥容器 解密:aspnet_regiis -pd "connectionStrings" -app "/Myweb" -prov "MyProvider"

在ASP.NET 2.0中配置MachineKey

原文

概述:

MachineKey原始配置状态:

<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="SHA1" decryption="Auto" />

validation和validationkey用于产生hashcode来防止篡改,decryption和 decryptionKey用于加密解密。只有默认情况下viewstate是防篡改的,而formauthentiaction是防篡改和加密的,只有在WebFarm或跨程序进行form认证的情况下才需要修改validationkey和decryptionKey。如果使用了角色管理并使用了role cache 那么会产生一个role cookie默认情况下使用与form认证一样的机制进行加密。

ViewState:

<pages enableViewStateMac="true"(防篡改) viewStateEncryptionMode="Auto" (加密) />时server根据比较由validationKey产生的hashcode来防止篡改。该值同样在formauthentication,role manager和anonymous identification中用到。

当validation为AES和3DES并且page中viewStateEncryptionMode设为auto或always时会根据decryptionKey的值加密解密viewstate.

Form Authentication Tickets:

设置decryption并配置forms配置节中的protection属性

<system.web>
<authentication mode="Forms">
<forms name=".AuthCookie" loginUrl="login.aspx" protection="All"/>
</authentication>
</system.web>

MemberShip:

<membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15" hashAlgorithmType=""> <providers> <clear /> <add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresUniqueEmail="false" passwordFormat="Encrypted" .../> </providers> </membership>

Anonymous Identification:

<anonymousIdentification enabled="true" cookieName=".ASPXANONYMOUS" cookieTimeout="100000" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="Encrypted" cookieless="UseCookies" domain="" />

Role Cookies:

<roleManager enabled="true"
cacheRolesInCookie="true"
cookieProtection="All" ... />

产生加密码的代码:

using System;
using System.Text;
using System.Security;
using System.Security.Cryptography;

class App {
static void Main(string[] argv) {
int len = 128;
if (argv.Length > 0)
len = int.Parse(argv[0]);
byte[] buff = new byte[len/2];
RNGCryptoServiceProvider rng = new
RNGCryptoServiceProvider();
rng.GetBytes(buff);
StringBuilder sb = new StringBuilder(len);
for (int i=0; i<buff.Length; i++)
sb.Append(string.Format("{0:X2}", buff[i]));
Console.WriteLine(sb);
}
}

2007/5/24

Ruby On Rails

1,One Step Install--InstantRails

2,关于Ruby On Rails 的图书清查看我的迅雷博客。

2007/5/20

HttpHandler,HttpModule,LightBox

1,HTTP Handlers and HTTP Modules in ASP.NET

2,在 ASP.NET 中执行 URL 重写

3,LightWindow,LightBox,GrayBox