Share this page

# Code a .NET script

You can create an empty .NET or .NET+ Vuser script, in which to place .NET code. This script type lets you incorporate your existing .NET application into VuGen. To create an empty .NET Vuser script, select .NET or .NET+, as applicable, in the Create a New Script dialog box.

In a .NET Vuser script the default language is C#.

If your script is generated from a recorded session, VuGen enables you to change the script language from C# to VB.NET by selecting Visual Basic .NET Language from Record > Recording Options > General > Script and regenerating the script.

Tip: You can edit the script in Visual Studio by clicking the button on the toolbar.

The following example shows the Action section of an empty .NET script:

Copy code

    namespace Script
                 {
                  public partial class VuserClass
                  {
                     public int Action()
                  {
                  // Add your code here
                  return 0;
                    }
                 }
                }

Note: Enter the business process code in the Action method. Add initialization code to the vuser_init method, and cleanup code to the vuser_end method.

## See also

- .NET protocols
- .NET+ protocol
- Manually program a script

https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 26.1-26.3 All View Local Help Center View Online Help Center Version: