How do I call a function inside a VBScript file from C#? The function has 2 parameters.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are a few ways you can do this. The simplest would be to execute the VBScript file from a command line inside C#. You would need to pass your parameters in at the command line, but the code would look similar to this:
Here are more examples of how to execute command line functions in C#:
http://www.dotnetperls.com/process-start
You can also get more advanced with these methods:
http://msdn.microsoft.com/en-gb/magazine/cc301954.aspx
http://msdn.microsoft.com/en-us/library/ms974577.aspx