我试图获得一个非常简单的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) 在我的代码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) 我有这个文本文件
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)
问题是如何读取这个数组中的每一列?如果我想访问列的特定值呢?就像第一列的第二个值。
我有一张分辨率为 1920x1080 的图像,我想知道是否可以在 Debian 中使用 shell 命令获取 HTML 版本中一个像素的颜色
例子:
getcolorpixel -x 1900 -y 1000 --source 1.png
Run Code Online (Sandbox Code Playgroud)
应该返回类似的东西 #232323
我怎样才能做到这一点?