Solved

c# List user drives for Citrix XenApp program

Posted on 2011-09-05
6
776 Views
Last Modified: 2012-05-12
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

0
Comment
Question by:socom1985
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 36484246
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....)
0
 
LVL 1

Author Comment

by:socom1985
ID: 36484319
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.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 36484334
>>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 ?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:socom1985
ID: 36484337
yes both miss the drives..
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 36484361
I'd misunderstood what was not working.  No other ideas.
0
 
LVL 1

Author Closing Comment

by:socom1985
ID: 37255147
I still slow but it's the best way i guess.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several days of searching and hunting for limited documentation, I wanted to share this guide to hopefully save someone the hassle of trying to figure this out on their own. I have tested this on Xendesktop 7.1 and PS 4.5 running simultaneous…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question