Data Files

If you access any files in your .NET methods you should add those files to the data files section of the Silk Performer project. You can do this through the Add Dependencies dialog box of the Silk Performer menu. If you are running a test on a remote agent, the files will be copied to the data directory of the agent. To ensure you have the right file path to your files, use the Bdl.GetDataFilePath method. This method returns the path to each data file using the filenames as parameters.

Adding the C:\myfiles\file1.txt File to the Data Files

[Transaction(Etranstype.TRANSTYPE_MAIN)]
public void TMain()
{
  string sFilename = Bdl.GetDataFilePath("file1.txt");
  System.IO.FileStream fs = System.IO.File.Open(sFilename,
  System.IO.FileMode.Open);
  ...
  fs.Close();
}

The .NET test driver DLL is automatically added to the data files of the project so that the DLL is available to remote agents.