在Windows服務里面,如果訪問文件,采用絕對路徑可以.如果采用相對路徑,和生成的服務文件在同一目錄下面.
using System.Reflection;
using System.IO; string assemblyFilePath = Assembly.GetExecutingAssembly().Location;
string assemblyDirPath = Path.GetDirectoryName(assemblyFilePath);
niList = Utility.GetXmlInfo(assemblyDirPath + "
\\FtpHelp.xml");
posted on 2008-10-07 13:20
天書 閱讀(1258)
評論(0) 編輯 收藏 引用