我正在尝试使用PipeSecurity
来保护NamedPipeServerStream
. 当我调用this.pipeServer.SetAccessControl(pipeSecurity)
下面的代码段时,出现以下异常:
Attempted to perform an unauthorized operation.
at System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType type, String name, SafeHandle handle, SecurityInfos securityInformation, SecurityIdentifier owner, SecurityIdentifier group, GenericAcl sacl, GenericAcl dacl)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity.Persist(SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
at System.IO.Pipes.PipeSecurity.Persist(SafeHandle handle)
Run Code Online (Sandbox Code Playgroud)
代码:
this.pipeServer =
new NamedPipeServerStream(
pipeName,
PipeDirection.InOut,
1,
PipeTransmissionMode.Byte,
PipeOptions.Asynchronous);
PipeSecurity pipeSecurity = new PipeSecurity();
WindowsIdentity identity = WindowsIdentity.GetCurrent();
WindowsPrincipal principal = new WindowsPrincipal(identity);
if (principal.IsInRole(WindowsBuiltInRole.Administrator))
{
// Allow the …
Run Code Online (Sandbox Code Playgroud) 理想情况下,我想在 RabbitMQ 中的队列变空时删除它们。基本上,我希望队列包含积压的消息,然后当发生某些事情时,这些消息将被发送,直到队列为空。一旦队列为空,我想删除它。
这可能吗?我正在使用节点。
我瞎搞这个惊人的帆船项目在这里.
我设法让我的Macbook Pro 100%正常运行,几乎没有任何困难.
现在我正试图让它在Azure Ubuntu 14.04盒子上工作,并在运行它之后npm start
只调用node app.js
我得到这个错误:
Error creating a connection to Postgresql using the following settings:
{ host: 'localhost',
port: 5432,
schema: true,
ssl: false,
adapter: 'sails-postgresql',
user: 'electron_release_server_user',
password: '[redacted]',
database: 'electron_release_server',
identity: 'postgresql' }
* * *
Complete error details:
{ error: password authentication failed for user "electron_release_server_user"
at Connection.parseE (/home/azureuser/electron-release-server/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)
at Connection.parseMessage (/home/azureuser/electron-release-server/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)
at Socket.<anonymous> (/home/azureuser/electron-release-server/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:172:18)
at …
Run Code Online (Sandbox Code Playgroud) 这是我的模板:
<template name="textGoesHere">
{{#if currentUser}}
<div id="boxdiv">
<textarea id="box">{{user.text}}</textarea>
</div>
{{/if}}
</template>
Run Code Online (Sandbox Code Playgroud)
这是我的流星事件:
'change #box': function (e) {
Meteor.call('click', $("#box").val());
}
Run Code Online (Sandbox Code Playgroud)
由于某种原因,只有当您更改文本区域的内容后单击文本区域之外时,才会触发此事件。但显然,当文本区域更改时应该调用该事件,这是我正在寻找的功能。
互联网上的每个地方都说“这就是您设置 .gitignore 的方式”。“你想要一个这样你就可以忽略文件。” “等等等等等等。” 但我的问题是“为什么?” 为什么我不需要包含 repo 中的某些文件?我知道您不希望其中包含敏感信息的文件,但是生成的文件呢?那些我们被认为忽略的其他类型的文件呢?我知道这是我们应该做的事情……但为什么呢?
为了为新用户(不认为自己是开发人员)简化 VS Code 的外观和感觉,我想永远隐藏调试侧栏:
当前发生的情况是,每次我按 F5 时,调试侧栏都会弹出,即使我用cmd+B
. 有什么办法可以强迫它隐藏起来吗?
javascript ×2
node.js ×2
.net ×1
amqp ×1
azure ×1
c# ×1
git ×1
github ×1
html ×1
jquery ×1
meteor ×1
named-pipes ×1
postgresql ×1
rabbitmq ×1
sails.js ×1