I vote for the external application 🙂 You will end up with several methods after a while, so it's better to keep them in an assembly. You will then be able to unit test your code and so on. Here are the steps (roughly) you have to follow (sorry if this is stuff you already know):
1) Get Visual Studio if you don't have it already.
https://www.visualstudio...ad-visual-studio-vs.aspx . The community version is free, but strictly speaking it cannot be used in enterprises. Use it for practicing...
2) Create a new class library. File -> New project, Class library. Remember to choose your prefered language (vb or c#).
3) Put the code that you wrote in you example above, in a class file. You will by default see a file there called Class1.cs. Rename it first and add you code.
4) Choose Build in the menu, Build solution
5) Take the resulting .dll file and place it on the server. It will have the name YourProjectName.dll
6)Create an assembly execute task. Find your assembly, select your class, and then your method. (make sure it is a static method)
7)You will see the parameters at the bottom. You can feed the job name dynamically in there.
When you later make it more advanced, and code against the VC api, you have to include those assemblies, and copy those to the server also, but we can get to that later.
Thomas
Edited by user
2015-08-14T12:37:01Z
|
Reason: Not specified