Regarding reading and Writing xmlfile after deployment
-
hello froum I am writing the elements to xml file on runtime,and also using them. It is working properly.
XmlDocument xmlDoc = new XmlDocument();
string path = AppDomain.CurrentDomain.BaseDirectory + @"\XMLFind.xml";
xmlDoc.Load(path);
XmlNodeList xmlNS = xmlDoc.GetElementsByTagName("testword");The xml file is in the bin folder. but the problem is after creating setup the xml file is visible to every body so it can be deleted accidently. If the xml file is placed in the project then while using the output (after creating its setup) it gives the runtime error Could not find the C:\Program Files\hts\SetupFinal\XMLFind.xml. can anybody help me... Regards Rahul Adya
-
hello froum I am writing the elements to xml file on runtime,and also using them. It is working properly.
XmlDocument xmlDoc = new XmlDocument();
string path = AppDomain.CurrentDomain.BaseDirectory + @"\XMLFind.xml";
xmlDoc.Load(path);
XmlNodeList xmlNS = xmlDoc.GetElementsByTagName("testword");The xml file is in the bin folder. but the problem is after creating setup the xml file is visible to every body so it can be deleted accidently. If the xml file is placed in the project then while using the output (after creating its setup) it gives the runtime error Could not find the C:\Program Files\hts\SetupFinal\XMLFind.xml. can anybody help me... Regards Rahul Adya
rahuladya wrote:
but the problem is after creating setup the xml file is visible to every body so it can be deleted accidently.
There is no way to secure it. Just check the file existence before you read it and tell user if it is not available.
Navaneeth How to use google | Ask smart questions
-
rahuladya wrote:
but the problem is after creating setup the xml file is visible to every body so it can be deleted accidently.
There is no way to secure it. Just check the file existence before you read it and tell user if it is not available.
Navaneeth How to use google | Ask smart questions
hello navneeth Yes i know but the issue is not here, we can secure it by adding it to solution explorer and after creating setup it will not be visible to anybody. The problem is how to find the xml file present in the project on runtime because the directory path will be changed after deployment. Rahul adya
-
hello navneeth Yes i know but the issue is not here, we can secure it by adding it to solution explorer and after creating setup it will not be visible to anybody. The problem is how to find the xml file present in the project on runtime because the directory path will be changed after deployment. Rahul adya
rahuladya wrote:
because the directory path will be changed after deployment.
Place it in the application directory.
Application.ExecutablePath
will give you the current directory where application's exe resides.Navaneeth How to use google | Ask smart questions