Solved

c# List user drives for Citrix XenApp program

Posted on 2011-09-05
6
770 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
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.

839 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