小编Moh*_*din的帖子

使用PHP脚本更改Active Directory用户密码

我试图获得一个非常简单的PHP脚本来更改我的Active Directory域中的用户密码.

这是我在网上找到的一些脚本:

<?php
$uid = 'Mohammed Noureldin';
$newPassword = '5omeGoodP@ssword';
$bindDn = 'CN=Administrator,OU=UsersOU,DC=example,DC=local';
$bindPassword = 'An0therGoodP@ssword';
$baseDn = 'OU=UsersOU,DC=example,DC=local';
$protocolVersion = 3;

$ldap = ldap_connect('localhost');
if (!ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, $protocolVersion))
{
    exit('Failed to set protocol version to '.$protocolVersion);
}
// bind anonymously so that we can verify if the server really is running
ldap_bind($ldap);
if (ldap_errno($ldap) !== 0)
{
    exit('Could not connect to LDAP server');
}

// now bind with the correct username and …
Run Code Online (Sandbox Code Playgroud)

php ldap active-directory

2
推荐指数
1
解决办法
1万
查看次数

如何从异步 Lambda 表达式(未包装为任务)返回真实类型?

在我的代码postsVM中,类型为IEnumerable<Task<PostViewModel>>.
我怎样才能返回IEnumerable<PostViewModel>(没有Task)呢?

var postsVM = posts.Select(async p => new PostViewModel
{
    PostId = p.Id,
    PostContent = p.Content,
    PostTitle = p.Title,
    WriterAvatarUri = fileService.GetFileUri(p.Writer.Profile.AvatarId, Url),
    WriterFullName = p.Writer.Profile.FullName,
    WriterId = p.WriterId,
    Liked = await postService.IsPostLikedByUserAsync(p.Id, userId),
    LikesCount = await postService.GetPostLikesCountAsync(p.Id)
});
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net .net-core asp.net-core

1
推荐指数
1
解决办法
511
查看次数

通过c#从文本文件中读取列

我有这个文本文件

688.63        C         1          C        0          0         0
698.70        C         1          C        0          0         0
708.89        C         1          C        0          0         0
716.78        C         1          C        0          0         0
718.97        C         1          C        0          0         0
728.27        C         1          C        0          0         0
728.89        C         1          C        0          0         0
738.82        C         1          C        0          0         0
759.00        C         1          C        0          0         0
Run Code Online (Sandbox Code Playgroud)

问题是如何读取这个数组中的每一列?如果我想访问列的特定值呢?就像第一列的第二个值。

c# arrays text-files

0
推荐指数
1
解决办法
2万
查看次数

使用 Linux (Debian) 获取图像中像素的颜色

我有一张分辨率为 1920x1080 的图像,我想知道是否可以在 Debian 中使用 shell 命令获取 HTML 版本中一个像素的颜色

例子:

getcolorpixel -x 1900 -y 1000 --source 1.png
Run Code Online (Sandbox Code Playgroud)

应该返回类似的东西 #232323

我怎样才能做到这一点?

linux shell image

0
推荐指数
1
解决办法
1469
查看次数