I have a problem with finding the file after my program installation on another computer. I'm using C# and this is a part of my code:
// template path
string tmpPath = @"|DataDirectory|\Templete.docx";
// output path
string outputName = @"|DataDirectory|\Output.pdf";
// shadow file name
string shadowFile = @"|DataDirectory|\temp.docx";
// Create shadow File
File.Copy(tmpPath, shadowFile, true);
// open word
word.Application app = new word.Application();
Document doc = app.Documents.Open(shadowFile);
I use"|DataDirectory|"
, it worked for finding the database but here I use it again to find my word file and it throws me this error:
System.ArgumentException: 'Illegal characters in path.'