Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Powershell code failed to run
#11
i don't know it works for me everytime.

Try moving ChilkatDotNet47.dll to the qm program folder(just the dll file)
make sure it is Chilkat 32-bit then use 
Code:
Copy      Help
CsScript x
x.SetOptions("references=$qm$\ChilkatDotNet47.dll")
x.AddCode("")

;call static function
str R=x.Call("Class1.TestFunction")
out R


#ret
//C# code
using System;
using Chilkat;

public class Class1
{
public static string TestFunction()
{
Chilkat.JsonObject json = new Chilkat.JsonObject();

bool success;

//  The only reason for failure in the following lines of code would be an out-of-memory condition..

//  An index value of -1 is used to append at the end.
// int index = -1;

success = json.AddStringAt(-1,"Title","Pan's Labyrinth");
success = json.AddStringAt(-1,"Director","Guillermo del Toro");
success = json.AddStringAt(-1,"Original_Title","El laberinto del fauno");
success = json.AddIntAt(-1,"Year_Released",2006);

json.EmitCompact = false;
//Console.WriteLine(json.Emit());
return json.Emit();
}
}


Messages In This Thread
Powershell code failed to run - by win - 06-15-2019, 12:03 AM
RE: Powershell code failed to run - by win - 06-17-2019, 02:26 PM
RE: Powershell code failed to run - by Gintaras - 06-17-2019, 03:31 PM
RE: Powershell code failed to run - by win - 06-17-2019, 10:51 PM
RE: Powershell code failed to run - by Gintaras - 06-18-2019, 04:45 AM
RE: Powershell code failed to run - by win - 06-18-2019, 07:05 AM
RE: Powershell code failed to run - by Gintaras - 06-18-2019, 07:11 AM
RE: Powershell code failed to run - by win - 06-18-2019, 08:17 AM
RE: Powershell code failed to run - by Kevin - 06-20-2019, 04:44 AM
RE: Powershell code failed to run - by win - 06-20-2019, 05:30 AM
RE: Powershell code failed to run - by Kevin - 06-20-2019, 11:54 AM
RE: Powershell code failed to run - by win - 06-20-2019, 12:50 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)