数据目录问题 [英] DataDirectory Issue
问题描述
我正在使用下面的代码从XML文件中获取数据.
DeploymentItem
( ),
,
,
,
检查以下链接:
http://csharp.net-informations.com/xml/how-to -read-xml.htm
http://www.codeproject.com/Questions/196589/Using -C-读取XML文件
http://www.codeproject .com/Articles/34672/Use-of-XML-File-for-Dynamically-Storing-Data-and-R
I am using below code to fetch data from the XML file.
DeploymentItem
("AutomationTestSuite\\Data\\UnloadMed.xml"), DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", "|DataDirectory|\\UnloadMed.xml", "StationMed", DataAccessMethod.Sequential)
Above code is working fine to fetch data from single file. But, I need to fetch same file from different location at runtime. But, I am not able to do it as we cannot pass any variable containing the dynamic paths in the DataSource context.
Let Say, we have 3 folders, FolderA, FolderB & FolderC. All of them contains same file i.e. Unload.xml. Now, I want to modify the DataDirectory path to fetch the same file from different folders at runtime as per the requirement.
So, is there any way out to achieve this. Please help me out.
Thanks In Advance.
check the links below:
http://csharp.net-informations.com/xml/how-to-read-xml.htm
http://www.codeproject.com/Questions/196589/Using-C-to-read-XML-file
http://www.codeproject.com/Articles/34672/Use-of-XML-File-for-Dynamically-Storing-Data-and-R
这篇关于数据目录问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!