entry.DirectoryEntry

今天调case。碰到exception has been thrown by the target of an invocation 的问题

Entry.DirectoryEntry uEntry = new Entry.Directory(LDAP://cn=......);

uEntry.Invoke(oldPassword,newPassword);

在W2K8都没有问题,到了W2K8R2出了问题。

try catch 后,看exception 的详细信息,居然说密码复杂度不够,

受教了。

posted @ 2011-02-21 17:32 Enki 阅读(290) | 评论 (0)编辑 收藏

求质数


#include <iostream>
#include <cmath>
using namespace std;

int main()
{
const int MAX = 100;

for(int i=3;i<=MAX;i+=2)
{
float val=i;
                  //把要验证的数求平方根
int mid =static_cast<int>(sqrt(val));
int j;
                  //这里,如果要验证的数对于从公约数3开始,每次加2的数求余,
                  //若能除尽,说明不是质数。除不尽,就是质数。
for(j=3;j<=mid;j+=2)
{
if(i%j==0)
break;
}
if(j>mid)
cout<<i<<endl;
}
}

posted @ 2011-02-18 15:12 Enki 阅读(245) | 评论 (0)编辑 收藏

Some translate

1. It hurts to love someone and not be loved in return. But what is more painful is to love someone and never find the courage to let that person know how you feel, and then regret it.
爱他,他不爱,心痛。爱他,他不知,无心痛。

2. Maybe God wants us to meet a few wrong people before meeting the right one so that when we finally meet the right person, we will know how to be grateful for that gift.
或许上天注定:“众里寻他千百度,蓦然回首,那人却在,灯火阑珊处。”

3. Love is when you take away the feeling, the passion, and the romance in a relationship and find out that you still care for that person.
爱就是当你摒弃一切感觉、热情和浪漫时,发现你依然爱着那人。

4. A sad thing in life is, you meet someone who means a lot to you, only to find out in the end that it was never meant to be, and you just have to let go.
世间最伤感之事莫过于无花空折枝,“此情可待成追忆,只是当时已惘然。”

5. When the door of happiness closes, another opens. But often at times we look so long at the closed door that we do not see the one which has been opened for us.
通常一扇幸福之门关上时,会有另一扇敞开。但往往我们徘徊在紧闭的门前太久,而忽略了那扇敞开的。

posted @ 2011-02-17 20:24 Enki 阅读(184) | 评论 (0)编辑 收藏

开始写点东西吧

想把所学的写下来。
好记性不如烂笔头,绝对的真理。

posted @ 2011-01-17 11:58 Enki| 编辑 收藏

仅列出标题
共2页: 1 2 
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

留言簿

随笔档案

文章档案

搜索

最新评论

阅读排行榜

评论排行榜