Friday, October 17, 2008

统计油耗的在线工具

最近写了个统计油耗的在线工具,主要是想玩玩python和google app engine. 刚刚有点成型,希望以后自己能不断完善。里面顺便也调用了google chart api.

http://gastics.appspot.com/

Thursday, July 31, 2008

如何快速测试数据库连接

在一台没有任何开发环境的服务器上,怎样以最简便的方法测试你的数据库连接字符串是否正确?
我这里介绍的方法不需要任何开发工具,一个干净的Windows即可。

1. 创建一个文本文件。
2. 修改文件的后缀名为 udl
3. 双击该文件运行

后面的不用我多说乐吧,这个方法好几年前就用过了,不过后来一直想不起来后缀名应该是什么,今天终于在google上找到。

Monday, February 25, 2008

configuration数据库的信息

今天一个同事问我怎么得到一个farm的configuration数据库的信息,我搜索了一下,发现:

using Microsoft.SharePoint;

using Microsoft.SharePoint.Administration;

using (SPSite site = new SPSite("http://basesmcdev/tester1"))
{

SPProcessIdentity pi = site.WebApplication.Farm.TimerService.ProcessIdentity;
string userName = pi.Username;
object configDB = pi.GetType().GetProperty("ConfigurationDatabase", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(pi, null);
SPServer server = (SPServer)configDB.GetType().GetProperty("Server").GetValue(configDB, null);
string serverName = server.Name;

}


但是我没有测试过。很诡异的办法。

Monday, January 21, 2008

如何禁止掉SharePoint页面个性化?

转:


如何禁止掉SharePoint页面个性化?

如何彻底禁止对SharePoint页面的个性化?

使用SharePoint Designer打开,或者创建一个新的Master Page,找到SPWebPartManager控件,如下所示,修改它的属性“Personalization-Enabled”为“false”即可。

image

让SharePoint站点使用此Master Page之后,就会看到“编辑页面”这个按钮已经变成灰色,无法选择了:

image