User Network ID In Windows 7
Jul 28, 2011I used code below to catch user's network login ID. It is working in XP but not working in Win 7. How to update it? (I use VS2008)
UserID = Page.User.Identity.Name.ToString
I used code below to catch user's network login ID. It is working in XP but not working in Win 7. How to update it? (I use VS2008)
UserID = Page.User.Identity.Name.ToString
In the IIS, it shows that the web app (i'm using) is using an application pool that uses NETWORK SERVICE account for identity. But when I debug/run my web app, User.Identity.Name shows that my windows user login instead. I checked my web.config file, and it does not have Impersonate enabled. In fact, I set it to false, and it still shows the same.
View 1 RepliesBasically, if you go to Start and click Computer and then click on the Network link on the left hand side, you'll notice on the right hand side several categories, one of which is titled "Network Infrustructure", in that category, my router is listed, and in my case, it is "LINKSYS WAG160N Wireless-N ADSL2+ Gateway" and when you right-click and select properties, it lists basic info such as internal/gateway IP address, on mine it is "192.168.1.1"
I would like to know how to retreive this information in code, preferably a Windows API so that i can call it using a legacy VB6 app. Also, even if you just know a .NET version or a Delphi version, However, the answer i'm ultimately seeking is a method to access this via VB6 so that would probably be a WinAPI call (will upvote & select this as answer), however, other methods are also welcome incase i can't find a legacy method (i will upvote these).
I am using windows authentication in website. All LAN users have access to one shared drive. I want to retrieve those files progrmatically. Like reading a file from network drive. If I open the solution and click F5, I am able to access it. Once it is hosted in IIS, its throwing error.
View 3 RepliesI want to use C#/ASP.net to find out whether the user browsing the website is on the same network so that certain links are only displayed while in the office (to those who have access to them).
Anyone accessing from within the office will be doing so by going to it's local IP address (i.e. 192.168.x.x) whereas external users will be browsing to the public domain name.
All I need is some way to differentiate between the two types of user.
We have a website portal hosted in Windows 2003 server. For security reasons we are using different windows Login user say (xxxx) for signin other than Administrator. Now with this user (xxxx) name I installed .net Windows Application. It was working fine. For some reasons I renamed the original windows Login user(xxxx) to different say (yyyy). Now this .net Windows Application is not working with (yyyy) and even it is not allowing me to uninstall it.
View 3 RepliesI have an ASP.NET application where user is Anonymous when he connects to website. Also I have a printing server inside network. I want to let this user to print to the network printer.
In order to print I have to use File.Copy command. When I do this I get "Access denied". So I tried to impersonate the user with credentials of user that is inside domain and has the rights to print to that specific printer.
The problem is this user has to be Administrator, and I cannot let him be the Administrator. When this user is not Administrator then the printing is not working ("Access denied").
I tried to use Network Credentials but I don't know how to set credentials to command File.Copy. This command doesn't have any extensions or overloading for credentials.
My ASP.NET MVC 2 application runs under built-in local NETWORK SERVICE account. I want to set up access permissions for the folder which resides in another computer, but in the same domain. I located that folder right-clicked to open its properties form, clicked to Security tab and pressed Add button which displayed Add user form with correct domain name in the location field. I referred to the account with following syntax:
<domain name><server name>$
because I learned that NETWORK SERVICE account uses machine account when connected to other computers in the domain. However, the system couldn't find the account, so refuses to add the account. Without the domain name it adds a user, but that user seems to be local user, not web server's NETWORK SERVICE account. What am I doing wrong?
By the way, the above syntax worked when I created login for the sql server which is different computer from the web server.
I need one web application where User can select one of all attached Printers in Network.I am getting idea how to start.Is there any API or any ActiveX Control that I can use for that.
View 2 RepliesSometime,ajax request will not be responsed when user's network delay is high.So,if I want to stop the request and tell user "request time out" in the client ,What sould I do with asp.net ajax .
View 2 Repliesget the below error. My application was working fine until I probably modified something, but don't know what.
Server Error in '/' Application.
Method is only supported if the user name parameter matches the user name in the current Windows Identity.
Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Configuration.Provider.ProviderException: Method is only supported if the user name parameter matches the user name in the current Windows Identity.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ProviderException: Method is only supported if the user name parameter matches the user name in the current Windows Identity.]
System.Web.Security.WindowsTokenRoleProvider.GetCurrentWindowsIdentityAndCheckName(String userName) +2195661
System.Web.Security.WindowsTokenRoleProvider.GetCurrentTokenAndCheckName(String userName) +36
System.Web.Security.WindowsTokenRoleProvider.GetRolesForUser(String username) +61
System.Web.Security.RolePrincipal.IsInRole(String role) +182....
I did a winforms applicaion using C#. I has 'n' number of forms.I like to track application usage time from user login to application exit.
View 1 Repliesmy app gets data from sql server using windows authentication but when i create a virtual directly as part of the deployment, the user that tries to authenticate against sql server is ASPNET rather than the windows user as a result authentication fails. I change the "Directory Security" setting in virtual directory properties to disable Anonymous access and leave Windows authentication checked but no luck.
View 1 RepliesI am trying to write a file to a network drive from my asp.Net application and i get this error - Logon failure: unknown user name or bad password. I am able to write to a local drive line C:/temp But when I try to save the file to a network drive such as ServerFolder, I get the error mentioned above.
View 2 RepliesI'm working on my company's intranet site and I wanted to create a function or class that would return the user's domain name and user name so I tried creating a class:
Code:
Imports Microsoft.VisualBasic
Imports System.Web.Security
Public Class DataWhareHouseClass
[Code]....
fixing the class so I can get the user.
I have been tasked with creating an intranet site and have been able to do everything so far (leaves the door open wide, I know ) EXCEPT get the username that the person is logged in as under their own computer.
<system.web>
<pages styleSheetTheme="Black"/>
<customErrors mode="Off"/>
<compilation debug="true" urlLinePragmas="true"/>
<authentication mode="Windows" />
<identity impersonate="true"/>
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
</system.web>
Under my master page I am doing this:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Environment.UserName.Length > 0 Then
username.Visible = True
username.Text = Environment.UserName
Else
username.Visible = False
End If
End Sub
All I am getting is the ASP account name....what am I doing wrong??
If a user has signed into their computer and are connected to an intranet, is there a way to grab the users crendtials and authentication them in asp.net? What specific code would do this?
View 2 RepliesI am using windows Authentication and accessing user name as. IIdentity winId = HttpContext.Current.User.Identity; string name = winId.Name; but i want to get other details like User full name and EmailID.
View 4 RepliesA collegue of mine just spent 2 days trying to get ASP.NET MVC 1 installed on his computer. MVC 2 installed fine today, but 1 would still not comply. The issue was that he was running as a domain user (with both local admin privileges as well as Domain Admin privileges) but UAC was killing the installer because ASPNetMVC1.msi tries to run another MSI that silently fails if UAC is enabled. The fix was to disable UAC, reboot, and the install completed successfully and he was able to open MVC 1 projects again. I'm not sure if this is an MVC installer bug or a Windows 7 bug, but in either case a prompt should have been displayed informing the user of the error, or at the very least logging something to the log file (which we spent about an hour and a half analyzing for errors).
View 1 RepliesI have developed a web service and installed in a server suucess fully, its working fine there.
I tried to work in another server, But I had some error there in the new server.
I trying to access a network folder, Its accessible for the user which I have mentioned in the web config, But I'm having error.
in the web config
<identity impersonate="true" userName="UserName" password="password"/>
On my Intranet page I want to be able to recognize the user by their Windows Domain login. I am using VB 2010 and ASP. I have several VB books but none of them cover this. If it isn't too much to ask could someone show me the way. I have a strong SYS ADMIN background and am pretty sure this will involve LDAP but that is about as far as I am.
View 2 RepliesIs it possible to remotly login into Windows using ASP? What I'm trying to accomplish is, that I could remotly call a ASP page on my server (Apache on Win Vista) that logs in a user on that system. For example remotly I start a Wake-On-Lan to start the computer (server). It boots up to the user login screen where I would have to enter my password to login to the desktop. Because the service is already running at that time, I would like to open a ASP page from my client that I could pass the windows user/password and the ASP-service would login the user on the server machine.
View 1 RepliesIm using forms authentication and im trying to get the current username. I tried using Environment.UserName but I am getting "ASPNET". But if i change my application to windows authentication im getting the true username that is currently logged on. How can I get the true username that is currently logged on in the domain using the forms authentication.
View 3 RepliesI have an issue in the assign premission (access denied error while upload a file in server folder).. in windows 7
View 2 RepliesI have a windows user control in windows control library...I add these user control in web application using below steps.
1.copy the windows control library project's dll file into web application project.
2.In aspx page I have the below code
<object
id="myName"
classid="http:QueryBuilderControlLibrary.dll#QueryBuilderControlLibrary.UserControl1"
VIEWASTEXT/>
I can get the proper output..but the styles not same as user control...styles not displayed properly..I need the same design of the user control in web application