小编Iva*_*res的帖子

How to use @section scripts in a partial view MVC.Core

In ASP.NET Core MVC it is possible to define a script section for a page like this:

@section scripts {
    <script>
        alert('hello');
    </script>
}
Run Code Online (Sandbox Code Playgroud)

And if the the layout contains :

@RenderSection("Scripts", required: false)
Run Code Online (Sandbox Code Playgroud)

your script(s) will be rendered. This come in handy per example to guarantee that the scripts will be rendered after all javascript includes like jQuery.

But how to render a script in a partial view?

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

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

如何使用 powershell 将作者添加到 Windows 任务

我正在使用 powershell 创建一个窗口任务,一切正常,但我找不到如何添加作者姓名。将ScheduledTask注册为描述的参数,但不适用于作者。

导出的 Windows 任务

 <RegistrationInfo>
    <Date>2016-05-17T16:45:54.3423362</Date>
    <Author>NEED TO SET THIS</Author>
    <URI>RunLauncherTask</URI>
  </RegistrationInfo>
Run Code Online (Sandbox Code Playgroud)

ai 用于创建任务的代码

$principal = New-ScheduledTaskPrincipal -UserId (Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -expand UserName)
$allTasks = Get-ScheduledTask | Select TaskName
$action = New-ScheduledTaskAction -Execute "C:\Launcher.exe"
$trigger = New-ScheduledTaskTrigger -AtLogOn
$task = New-ScheduledTask -Action $action -Trigger $trigger -Principal $principal
$username = $principal.UserId
$taskName = 'RunLauncherTask' +  $username.Replace('\','-')
$settings = New-ScheduledTaskSettingsSet -DontStopIfGoingOnBatteries -AllowStartIfOnBatteries
Register-ScheduledTask $taskName -Action $action -Settings $settings
Run Code Online (Sandbox Code Playgroud)

如何设置作者?

windows powershell windows-task-scheduler taskscheduler

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

Angular 6 全局枚举?

我已经在组件类型脚本文件中声明了一个枚举,它很好并且在该组件中工作得很好,但现在我想在另一个组件中使用它。

根据我读到的内容,我尝试了一些方法,但没有结果。

我可以在哪里声明全局枚举以便我可以在所有组件中使用它?

枚举示例:

 enum AttendusTypeEnum {
          Todo = 1,
          Sent = 2,
          Corrected = 3
    };
Run Code Online (Sandbox Code Playgroud)

提前致谢。

enums electron angular

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