Working Environment:win7,Ranorex2.02
Target:
Get the items in a list, such as get all file/folder in a folder.
then read their name one by one .
Class List/ListItem seems can do such thing, however ,i have limited experience on c# and .net program.
Need a sample
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Please, have a look on the Ranorex samples, they show how to enumerate list items in a list. And I recommend reading a C# tutorial as well, you can find hundreds if you ask Google (e.g. this one: http://www.csharp-station.com/Tutorial.aspx).
Regards,
Alex
Ranorex Support Team
Regards,
Alex
Ranorex Support Team
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Need a sample
Not sure if this is exactly what you want or not, but this C# code will get all files & folders from a folder into an array and then allow you to parse them.marcushe wrote:Get the items in a list, such as get all file/folder in a folder.
then read their name one by one .
Code: Select all
string[] BaselineReports = Directory.GetFiles(strBaselineReportsDirectory, "*", SearchOption.AllDirectories);
foreach (string strReportName in BaselineReports)
{
//Do what you need with the files here
}