dimanche 28 juin 2015

Accessing Network Path in Windows Service C#

I have developed a windows service using local system as Account. I have used network path of file

FileInfo fi = new FileInfo(@"\\epm-server\penDocuments_LabMeds\" + Convert.ToString(dr["mrn"]) + "\\SyncedXML\\" + Convert.ToString(dr["xmlfile"]));
if (!fi.Exists)
    boolFileNotFound = true;

A dynamic path of a file that is built from database.

It works fine when I run Windows Service in Debug Mode, but when I install it then fileNotExists returns TRUE always like the file doesnt exist but infact it does exist.

This is bugging me a lot now. Kindly help me why its not working. Its a server path. Its getting opened in my PC.

Thanks

Aucun commentaire:

Enregistrer un commentaire