一个最主要的问题就是中文显示的问题,赶紧在web.config中加上:

<globalization fileEncoding="GB2312"  requestEncoding="GB2312"  responseEncoding="GB2312"/>
好点了,但是类别什么的中文显示还是有问题。 到处都配置了,还是不管用。没有方法,读读代码。跟踪了好长一段时间,终于找到了问题。

 就是在Project “Dottext.Framework”的data\SqlDataProvider.cs中,update数据库的时候,SqlHelper.MakeInParam("@Text",SqlDbType.Text,0,entry.Body),而SqlDbType.Text是不支持Unicode的。要改成SqlHelper.MakeInParam("@Text",SqlDbType.NText,0,entry.Body)。然后编译就通过了。

posted @ 2004-08-09 21:35 James 阅读(844) 评论(1) 编辑
SP2我没有按照,听说SP2会和我们公司的产品有冲突,因为天生带一个Firewall,并且确实激活。

明天MS会一个Exchange的package,据内部人士说是这样,明天看看。
posted @ 2004-08-09 21:03 James 阅读(416) 评论(0) 编辑
http://www.mentalis.org/soft/projects.qpx

这里由SSL和SecureSocket的实现的例子,还有一个比较业余的Package Monitor. 虽然C#不是作网络安全的好工具,但是自己作一些小Tool,还是够用的。
posted @ 2004-08-09 21:00 James 阅读(767) 评论(1) 编辑

对于Virtual的使用,有时候总有些犹豫,特别是最近学的东西太杂,今天化了点时间,把C#里面的Virtual彻底搞明白了。

virtual出问题主要是由于声明对象的类和对象实际所属的类不是一个类,一般都是父类和子类的关系。比如:
ClassParent obj = new ClassSub(),这是根源。

virtual和非virtual关键是在运行时候,而不是在编译时候。

1, 如果方法不是virtual的,编译器就使用声明的类对应的类型,也就是说,不是virtual的,在编译时候,就定了。比如下面的例子:子类的方法都没有执行,执行的全部都是父类的方法。运行的结果是
father
boy
girl

using System; 


public class ClassFather 



public string s1; 

// virtual public void VirFun() 

public void VirFun() 

{ Console.WriteLine( s1 );} 

}
 


public class ClassBoy : ClassFather 



public new void VirFun() 

base.VirFun();} 

}
 


public class ClassGirl : ClassFather 



public new void VirFun() 



base.VirFun(); 

Console.WriteLine( s1 ); 

}
 

}
 


public class Test 



public static void Main() 



ClassFather a 
= new ClassFather(); 

a.s1 
= "father"

a.VirFun(); 


ClassFather b 
= new ClassBoy(); 

b.s1 
= "boy"

b.VirFun(); 


ClassFather c 
= new ClassGirl(); 

c.s1 
= "girl"

c.VirFun(); 

}
 

}
 

2, 如果方法是Virtual的,然后子类使用了override, 编译器就生产代码。然后,在运行的时候,进行检测,看对象属于哪个类,然后调用这个类的方法。 这个是最常用的方法,基本上所有书上说的就是这个,我就不多此一举了。

3,如果一个父类的方法是virtual,子类不是用override,而是用new来覆盖了,那么运行子类的时候,还是执行声明的类的方法。比如下面的例子中,girl类对象就是。
using System; 


public class ClassFather 



public string s1; 

virtual public void VirFun() 

{ Console.WriteLine( s1 );} 

}
 


public class ClassBoy : ClassFather 



public override void VirFun() 

base.VirFun();} 

}
 


public class ClassGirl : ClassFather 



public new void VirFun() 



base.VirFun(); 

Console.WriteLine( s1 ); 

}
 

}
 


public class Test 



public static void Main() 



ClassFather a 
= new ClassFather(); 

a.s1 
= "father"

a.VirFun(); 


ClassFather b 
= new ClassBoy(); 

b.s1 
= "boy"

b.VirFun(); 


ClassFather c 
= new ClassGirl(); 

c.s1 
= "girl"

c.VirFun(); 

}
 

}



没有VS.Net,代码写的有些不那么美观,将就看吧。来这里好长时间了,没有写点.Net的文章,担心那天把我驱逐出去,写这篇来说说一些概念性的东西吧。
posted @ 2004-08-09 20:50 James 阅读(6107) 评论(3) 编辑

Microsoft Security Bulletion Feed

For others, you could get the index here

posted @ 2004-08-09 20:35 James 阅读(507) 评论(0) 编辑