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

Windows user name in a smart client

I'm trying to get the login name for the user, and this is the code I use:

string userName = WindowsIdentity.GetCurrent().Name;

This works fine when the program is launched locally or from a network
drive. However, when I run the program as a smart client from our intranet
server the program fails on this line. How do I determine the windows user
when running my program as a smart client?

Thanks,

Erik.

Nov 17 '05 #1
2 1824
Does Environment.Username work?

"Erik" wrote:
I'm trying to get the login name for the user, and this is the code I use:

string userName = WindowsIdentity.GetCurrent().Name;

This works fine when the program is launched locally or from a network
drive. However, when I run the program as a smart client from our intranet
server the program fails on this line. How do I determine the windows user
when running my program as a smart client?

Thanks,

Erik.


Nov 17 '05 #2
Nvm, I found the problem. I forgot to configure the security policy in .NET
to trust my intranet zone.

Erik.
Nov 17 '05 #3

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

Similar topics

8
by: Bob Everland | last post by:
I have an application that is ISAPI and the only way to secure it is through NT permissions. I need to have a way to login to windows authentication so that when I get to the ISAPI application no...
0
by: josephrthomas | last post by:
hi, i am utilizing a web service in a C# windows application for a smart client. there is a method public int ValidateUser(string userName, string password) { object results =...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
2
by: Martin Eyles | last post by:
I would like to embed a windows controls or smart client controls in a web page, in a similar way to which a java applet or a flash applet or an active x control is embedded. I read something...
2
by: Jeff | last post by:
Please note this is NOT a rant or complaint! And yes, I'm over-simplifying, but intentionally. Here goes... With ASP.NET Web applications I like that I can access data from anywhere without...
4
by: Pini | last post by:
Hi all, I have a massive windows application that refernces a lot of assemblies and doing a lot of DAL anf IO operations. I want to expose this application to the interner so that a user can...
6
by: =?Utf-8?B?UGFyYWcgR2Fpa3dhZA==?= | last post by:
Hi All, We have a requirement where we have to develop a custom Login Page which will accept user's NT credentials ( Username , password, domain name). This then needs to be passed to a website...
5
by: Max2006 | last post by:
Hi, I am trying to limit my wcf service endpoint to response to only given windows user or group. How can I do that? Is there any way to configure that in the .config file? Thank you, Max
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.