473,383 Members | 1,803 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,383 software developers and data experts.

How to retrieve current Windows User Handle from ASP

Hi all,

is it possibile to retrieve the current Windows User Handle from ASP code?

I would like to retrieve the correspondent in ASP for thi piece of ASP.NET
code:

WindowsIdentity id = HttpContext.Current.User.Identity as WindowsIdentity;
if (id != null)
{
IntPtr handle = id.Token;
}

I need to pass "handle" variable to a .NET method (using interop).

Thank you so much.

Bye
Jul 19 '05 #1
2 3643
I don't think ASP provides any intrinsic way to access the user token - you
might be able to do it in a COM object.

Cheers
Ken

"Stefano" <st*******************@giasoft.it> wrote in message
news:OC****************@TK2MSFTNGP12.phx.gbl...
Hi all,

is it possibile to retrieve the current Windows User Handle from ASP code?

I would like to retrieve the correspondent in ASP for thi piece of ASP.NET
code:

WindowsIdentity id = HttpContext.Current.User.Identity as WindowsIdentity;
if (id != null)
{
IntPtr handle = id.Token;
}

I need to pass "handle" variable to a .NET method (using interop).

Thank you so much.

Bye

Jul 19 '05 #2
I use Basic Authentication (over SSL), so I retrieved the Base64 string from
ASP code, using HTTP_AUTHORIZATION servervariable.

In this way, I can decode the string and so I can have the user's
credentials.

So, I solved my problem.

But... I'm curious... what about retrieving user token by COM object?

Thanks!

Bye
"Ken Schaefer" <ke*******@THISadOpenStatic.com> ha scritto nel messaggio
news:%2****************@TK2MSFTNGP12.phx.gbl...
I don't think ASP provides any intrinsic way to access the user token - you might be able to do it in a COM object.

Cheers
Ken

"Stefano" <st*******************@giasoft.it> wrote in message
news:OC****************@TK2MSFTNGP12.phx.gbl...
Hi all,

is it possibile to retrieve the current Windows User Handle from ASP code?
I would like to retrieve the correspondent in ASP for thi piece of ASP.NET code:

WindowsIdentity id = HttpContext.Current.User.Identity as WindowsIdentity; if (id != null)
{
IntPtr handle = id.Token;
}

I need to pass "handle" variable to a .NET method (using interop).

Thank you so much.

Bye


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

79
by: Klaus Bonadt | last post by:
In order to protect software from being copied without licence, I would like to use something like a key, which fits only to the current system. The serial number of the CPU or the current...
8
by: Dutchy | last post by:
Dear reader, In an attempt to obtain the path to the quick-launch-folder in order to create a shortcut to my application-updates during installation , I thought to: 1- check if quick launch...
34
by: kevin.watters | last post by:
Hi all, I have a need for a short program: Given a drive letter, it would recursively search through all directories, "generating" each filename that it encounters (need to pass each filename...
1
by: John Yung | last post by:
Hi, I have a client (C# MS Excel Project) calling a Web Service to retrieve and update data. One of the business requirement is the client's NT Login ID, IP Address and computer name must be log...
13
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end...
0
by: padhuwork | last post by:
Hi, I want to create a Windows DLL using VC++ 6.0 which connects to SQL Server. After establishing the connection, I want to retrieve records from table (query) and out put the recordset to a...
1
by: ranju | last post by:
I am trying to spawn a process (say an exe file) with different user crendentials than that of the current user. 1) Called LogonUserEx() to logon the user and recieve a handle to the token that...
11
by: kudruu | last post by:
Hi, I am trying to find a way to populate a list of active Com ports on a computer. There may be around 30 on one computer and all connected to different Buses but I am looking for one in...
8
by: active | last post by:
Guess I'm looking for someone who likes to work difficult puzzles. I can't seem to ever retrieve a palette handle from the clipboard. Below is a simple test program that demonstrates the...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.