Azeddin_Margani
7 years agoContributor
Unable to open the file error when trying to open .txt file
I'm getting "Unable to open the file" error when trying to open .txt file. I'm using the following code:
function RetrieveExistingPaitent()
{
var sPath = "C:\Files\MyFile.txt";
// Opens the specified file for reading
var myFile = aqFile.OpenTextFile(sPath, aqFile.faRead, aqFile.ctUnicode);
Log.Message("File by lines:");
// Reads text lines from the file and posts them to the test log
while(! myFile.IsEndOfFile())
{
s = myFile.ReadLine();
Log.Message(s);
}
// Closes the file
myFile.Close();
}