SCRIPT HELP

Status
Not open for further replies.

mauro1

Customer
Joined
Aug 11, 2024
Messages
1
Reaction score
0
Goodmorning,
there's somebody who can help me creating a C# script that can operate the command c:\gate\gate.bat ?

Thank you!
 
Yes, but what does the gate script do? Perhaps you can use the C# to do the steps directly instead of talking to the batch script.
 
In which context do you need to trigger this batch file? When a call comes in? When a call reaches a specific extension?

You can do many things with a CFD app, but you can't easily launch a program like this, because the C# code you write in a CFD app is limited to specific DLL references, and for example the Process class is not included, so you can't launch a program. To do that you would need to use reflection, which is possible, but tricky.... Maybe a simpler approach would be doing what @ConceptsWeb is suggesting, i.e. doing what's in that batch file directly from the CFD app.
 
Considering that the `Process` class is not available (which is necessary for launching a separate executable), another possible solution—though not straightforward unless you have programming experience—would be to develop a REST API. The CFD/Script could then call this API, which would handle the execution of the required task.
 
Considering that the `Process` class is not available (which is necessary for launching a separate executable), another possible solution—though not straightforward unless you have programming experience—would be to develop a REST API. The CFD/Script could then call this API, which would handle the execution of the required task.
I agree with @VoIPTools here. This would be a much simpler approach than using reflection to invoke the method, which requires a deep C# programming experience.
 
  • Like
Reactions: Evolute IT
Status
Not open for further replies.

Forum statistics

Threads
111,953
Messages
589,914
Members
164,849
Latest member
BillyAkansel