473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

how to get terminal client's disk dirves list after it has logged on

Hi i was developing a C# code using wtsapi32.dll. I was developing a wrapper class.

I am now stuck in a case in which i have to get the list of client;s disk drives on the terminal application.

I have used this method

Expand|Select|Wrap|Line Numbers
  1. public static extern bool WTSQueryUserConfig(
  2.             System.IntPtr pServerName, 
  3.             System.IntPtr pUserName, 
  4.             WTS_CONFIG_CLASS wtsInfoClass,
  5.             out System.IntPtr ppBuffer,
  6.             out uint pBytesReturned);
  7.  
  8. and for WTS_CONFIG_CLASS i have provided WTS_CONFIG_CLASS.WTSUserConfigfDeviceClientDrives having value 8 in enum.
Now when i execute this method i get true in return.. but i am unable to get the drives list.

I have tried to get drives list like this:

Expand|Select|Wrap|Line Numbers
  1. StringBuilder userDrive = new StringBuilder("");
  2.             if( WTSQueryUserConfig(pServerName,pUserName,
  3.                   WTS_CONFIG_CLASS.WTSUserConfigfDeviceClientDrives,
  4.             out pBuffer,
  5.             out pBytesReturned) )
  6.             {
  7.                 for(int i = 0;i < (int)pBytesReturned;i++)
  8.                 {
  9.                     userDrive.Append(Marshal.PtrToStringAnsi(pBuffer) + "\n");
  10.  
  11.         }
  12.  
  13.             }
  14.             return userDrive.ToString();
Please help me where did i went wrong..

Thank you
Dec 21 '07 #1
0 972

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Henry Craven | last post by:
Hi Everyone.. Been forever since I've posted to the Access newsgroups, and even longer since I've needed to post a question, but I've never had to use or try Access on a Terminal Server so I'm...
5
by: TPoise! | last post by:
Using: .NET 1.1, Visual Studio 2003, C#, Microsoft Windows 2000 Server (SP4 and all latest windows updates), Terminal Server running in application mode. I have a C# application that I've...
8
by: OHM | last post by:
Hi peoples, I dont know where to place this question, so as I know you guys are all resourceful experts, I thought I would try here. I am writing some code which will be run usingh remote...
6
by: Atley | last post by:
I have a Terminal Services server running Windows 2000 Server. I need to be able to identify, in my application on that server, which client computer is addressing that server and running that...
5
by: cityrock | last post by:
Hello friends. It has come time for me to face a dilema i have been thinking about for a long time, but actually doing nothing. Now its time to act. The situation is "simple", and i have just...
7
by: mike | last post by:
We have numerous Access 97 apps that we run on our Terminal Server, but two apps in particular is giving us a problem. The problem we are running into is when you select a drop down menu, it errors...
10
by: gary0gilbert | last post by:
An unusual spin to this recurring disk or network error in a Terminal Server environment. Access 2000, Terminal Server 2000, file server is windows 2000. All users have a separate copy of the...
16
by: =?Utf-8?B?RHdlZWJlcmVsbGE=?= | last post by:
I created an Access 2007 application for my customer. The application is shared by three employees on a server. It maintains a contact list including financial data and social security numbers. ...
4
by: gaurav kashyap | last post by:
Dear all, I am using Microsoft Windows XP.Using putty.exe,I connected to LINUX server and a terminal window gets opened.Here i logeed in as root. What i want to do is open another terminal...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.