> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scripts in .NET languages

> Specifics for writing Scanning Station scripts in C#.Net, VisualBasic.Net, and JScript.Net.

When you write scripts in .NET languages, a few things differ from VBScript and JScript.

## Accessing objects

Use the `Workspace` and `ExportBatch` keywords to access Scanning Station object elements.

## Framework and assemblies

* Compile .NET assemblies using **.NET Framework 4.0 or later**. Set the target framework in your Visual Studio project properties.
* You can add external assemblies — standard or user-compiled — and every class inside becomes available in scripts and global modules. See [External assemblies](/vantage/documentation/scanning-station/admin/external-assemblies).
* Scanning Station objects don't support multithreading.

## Debugging

* Use the [`System.Diagnostics.Debugger.Break`](http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.break.aspx) method to break into the debugger.
* Debugging also requires a `.pdb` file with debug information. These files can be very large — we recommend keeping them outside the project. Make sure the script is compiled with the debugging information included. In Microsoft Visual Studio, you can [attach to the process](http://msdn.microsoft.com/en-us/library/vstudio/3s68z0b3\(v=vs.100\).aspx) where the .NET code runs.

## `using` directives

You can put `using`-style directives at the top of a script, alongside comments and blank lines. The syntax matches the language:

* **C#.Net:** `using`
* **JScript.Net:** `Import`
* **VisualBasic.Net:** `Imports`

For example, in C#.Net:

```csharp theme={null}
using System.Drawing;
Image img = Image.FromFile(@"D:\2.png");
```

<Note>
  A `using` directive only works if it appears before the first line of executable code. For example:

  ```csharp theme={null}
  using System.IO;
  File.Create(@"C:\sample.txt");
  ```
</Note>

## Functions and optional parameters

* Functions from global modules are called directly in .NET scripts — you don't need to prefix them with the global module name.
* To skip an optional parameter, pass `System.Type.Missing` instead.

## Related topics

* [Using scripts](/vantage/documentation/scanning-station/admin/using-scripts)
* [External assemblies](/vantage/documentation/scanning-station/admin/external-assemblies)
* [Objects available from event scripts](/vantage/documentation/scanning-station/admin/available-objects)
* [Administrator mode](/vantage/documentation/scanning-station/admin/admin-mode)
