Need a sample

Ask general questions here.
marcushe
Posts: 112
Joined: Tue Apr 14, 2009 6:38 am

Need a sample

Post by marcushe » Wed May 06, 2009 8:05 am

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Wed May 06, 2009 9:37 am

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

marcushe
Posts: 112
Joined: Tue Apr 14, 2009 6:38 am

Oh

Post by marcushe » Wed May 06, 2009 9:45 am

Oh, sorry for my poor experience.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Wed May 06, 2009 9:59 am

You don't have to be sorry for asking questions, I just wanted to point out that there is material that could help you getting answers much quicker than by posting to the forum :-)

Regards,
Alex
Ranorex Support Team

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Need a sample

Post by Ciege » Wed May 06, 2009 4:26 pm

marcushe wrote:Get the items in a list, such as get all file/folder in a folder.
then read their name one by one .
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.

Code: Select all

string[] BaselineReports = Directory.GetFiles(strBaselineReportsDirectory, "*", SearchOption.AllDirectories);
foreach (string strReportName in BaselineReports)
  {
    //Do what you need with the files here
  }