c# List user drives for Citrix XenApp program

socom1985
socom1985 used Ask the Experts™
on
I have an application which should have a dialog with only the user drives. When I use the normal windows fileopen dialog I also see the local drives on the server.. But the customer should only see his own drives.. I tried to make an own dialog but I don't know how to list the user drives. With the following code I can see only local drives and network drives.


// Store the list of drives into an array of string
            string[] DriveList = Environment.GetLogicalDrives();
            // Loop through the array
            for (int i = 0; i < DriveList.Length; i++)
            {
                // Show each drive
                MessageBox.Show(DriveList[i]);
            }

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Freelance programmer / Consultant
Commented:
Have a look at DriveInfo.GetDrives(); - that might be more what you want because you can then see what the type of drive is (Fixed, Network....)

Author

Commented:
Hey thx but same thing happends :( . I found out that I can connect to the drives via \\client\c$

To find out which letters are in use i check if a file exists.. but this is not as fast as I want. so any further ideas are much appriciated.
AndyAinscowFreelance programmer / Consultant

Commented:
>>Hey thx but same thing happends

Your original method returns an array of strings.  The alternative I suggested will return an array of DriveInfo objects.  You can then loop through the array and test what sort of drive it is, eg. Fixed, Network... and filter out the types of drives you require.

Or do you mean both miss drives you require to be shown ?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
yes both miss the drives..
AndyAinscowFreelance programmer / Consultant

Commented:
I'd misunderstood what was not working.  No other ideas.

Author

Commented:
I still slow but it's the best way i guess.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial