0
說我有以下c#代碼,但現在我需要轉換爲PowerShell。我得到了DllImport部分,但c#代碼也有它的靜態外部件。我是否需要在Powershell中具有相同的聲明?如果是的話,你能指導我在PowerShell中糾正語法嗎?將c#代碼轉換爲需要使用dllimport的powershell
感謝
[DllImport(@"C:\PDFConv\bin\Conv2PDF.dll", SetLastError = true)]
static extern UInt32 ProcessConv(UInt32 val, string lpSourcePath, String lpSourceFile, string lpDestPath, string lpDestFile);
private void btnConvert_Click(object sender, EventArgs e)
{
ProcessConv(1, "C:\\source", "test.docx", "C:\\dest\\pdf", "test.pdf");
}
http://www.leeholmes.com/blog/2009/01/19/powershell-pinvoke-walkthrough/ –