小编Psy*_*n25的帖子

带有 digitalocean 空间的 Django 静态 url

I have an droplet on digitalocean which for the most part is working great, however i have enabled the cdn option in digitalocean spaces (similar to aws s3 storage) and in trying to load static files using the cdn url, i cannot seem to get the url working correctly so suspect i am missing the obvious?

For example when i change the STATIC_URL in settings to the cdn no change is seen in the web page source? If i change …

django amazon-s3 digital-ocean

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

带参数的 Powershell 反射调用

我目前正在使用 PowerShell 学习反射,并且正在努力寻找如何使用反射将参数传递给测试 DLL 中的静态 void 函数,已经研究了几个小时,很可能在 google 或 StackOverflow 上找到了答案?如果这里的大师能帮助我,那就太棒了?

DLL 代码示例:

using System;
using System.Diagnostics;

namespace ExampleProject
{
    public class Class1
    {
        public static void RunProcess(string fullFileName)
        {
            var p = new Process
            {
                 StartInfo =
                 {
                     FileName = fullFileName
                 }
            }.Start();
        }  
    }
}
Run Code Online (Sandbox Code Playgroud)

当前的Powershell代码:

$data = "C:\temp\mytestlib.dll')
$assem = [System.Reflection.Assembly]::Load($data)
$class = $assem.GetType("ExampleProject.Class1")
$method = $class.GetMethod("RunProcess")
$fullName = "C:\\Windows\\System32\\calc.exe"
$method.Invoke($null,$fullName)
Run Code Online (Sandbox Code Playgroud)

收到错误:

Exception calling "Invoke" with "2" argument(s): "Parameter count mismatch."
At line:6 char:1
+ $method.Invoke($null,$fullName)
Run Code Online (Sandbox Code Playgroud)

然而添加 …

c# powershell

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

标签 统计

amazon-s3 ×1

c# ×1

digital-ocean ×1

django ×1

powershell ×1