Hi,
I was trying to get local system's username in my code behind. I tried every almost possible way.
Here is the scenario:
My project is web based and I don't have a login screen....I need to get the local system's username when some user opens the website....
I tried. -
environment.Username
-
environ("username")
-
System.Windows.Forms.SystemInformation.UserName
-
system.Security.Principal.WindowsIdentity.GetCurrent.Name
-
and some functions as well posted at this site: http://www.developerfusion.co.uk/show/4409/
But no luck.....Its getting the username from the server instead of the user's computer.....
And I am using VS 2008.
I would really appriciate....I f someone can provide me a better solution for this..
Thanks.
6 2111
Well, if you are using integrated windows authentication in IIS, this will get the domain user name:
But if you allow Anonymous access, you might just get the IUSR_<machinena me> account. I'm not sure what happens if you use Basic/Forms authentication.
How can I turn on windows authentication in vista ultimate?
I found this it was under programs and turn windows features on or off..
I'm not sure of your whole setup. Windows authentication works against a domain.
You need to understand more about IIS authentication. Look that up. Vista uses IIS 7.
Hey I turned on the windows authentication and ran the same thing again...
but I am not getting any username....
Any guesses...what could b the problem???
Like I said, Windows authentication works against a domain. You aren't going to be able to get just anyone's local username, because you don't have access to it through the web. You need to either set up a domain, or use basic authentication. But basic authentication still refers to accounts on the server, not the client.
I atlast got this one working........ ..
I went to server and turned on windows authentication in IIS and turned off the asyncronous option.......an d thats all I need to do to get the clients username and no doubt client should be in the same domain.
Thanks for the help guyz.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Simon Harvey |
last post by:
Hi chaps,
I've made a pretty simple service in c# using VS.net. It compiles correctly
and I've followed what little documentation there is to create a setup
project in order to install the service.
When I try to do the install, everything seems to go well apart from right
at the end, it asks me for a account name and a password.
I'm...
|
by: Rob |
last post by:
Hi,
I am working on a project that requires a Windows Service which
performs the following file transfer functions.
1. It monitors a specific local directory on a Windows 2003 Server.
2. When it finds files with a specific extension, it queries a SQL
Server database to determine what workstation will be the destination
of a File.Copy....
|
by: ruju00 |
last post by:
I am getting an error in Login() method of the following class
FtpConnection
public class FtpConnection
{
public class FtpException : Exception
{
public FtpException(string message) : base(message){}
public FtpException(string message, Exception innerException) :
base(message,innerException){}
|
by: ljlevend2 |
last post by:
Is there any way to create a local server during runtime? For example, if
you add an existing Web Site to a Solution from within Visual Studio (by
right clicking the solution in the Solution Explorer, then selecting Add -
Existing Web Site...), then Visual Studio will create an ASP.NET Development
Server on a random port (e.g.,...
|
by: WT |
last post by:
Hello,
Using VS2005.
I have an assembly library that can be called from a Web site asp.net
application or from a winform application.
From this library I need to retrieve a path using simply a key like
'libPath'.
As far as winform and asp.net share the same common base class for settings,
SettingsBase, how to manage this ?
For winform...
| |
by: JamesB |
last post by:
I am writing a service that monitors when a particular app is started.
Works, but I need to get the user who is currently logged in, and of course
Environment.UserName returns the service logon (NT_AUTHORITY\SYSTEM).
I understand that when the service starts, no user may be logged in, but
that's ok, as the app I am monitoring can only be run...
|
by: Chris Marsh |
last post by:
Hi all
I have one machine (A) which is not on a domain. There is an local user
account on A (userA) that has access to a certain folder. I have another
machine (B). An application on B initialises a FileSystemWatcher to watch
the previously mentioned folder on A.
My question is: how do I ensure that the FileSystemWatcher is operating...
|
by: Just_a_fan |
last post by:
I can sign in manually in the help system or in a browser but then when
I try to get a help from a forum entry via the help system, it tells me
I cannot sign in or the site is broken and throws up this horrible
screen telling me either the system is down or I don't have the right
username/password but WON'T LET ME ENTER IT! Gee, THANKS!!!!
...
|
by: tiijnar |
last post by:
Hi,
To get windows username Im using the following code.
public class GetWindowUsername {
public String getUser() {
String userName = System.getProperty("user.name");
System.out.println("Window's Username: "+userName);
return userName;
}
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |