pruebens Posted March 6, 2003 Posted March 6, 2003 I'm trying to retrieve the currently logged in user and put it into a cookie on the client's machine. However when I try this all I end up getting is the server's "generic" account. I'm obviously doing something wrong so hoepfully someone can point me in the right direction. Here is my code: If Request.Browser.Cookies Then If Request.Cookies("LastVisit") Is Nothing Then Dim cookLastVisit As New HttpCookie("LastVisit", Now.ToString) cookLastvisit("UserName") = System.Environment.UserName cookLastVisit.Expires = DateTime.Now.AddDays(1) Response.Cookies.Add(cookLastVisit) Else Dim cookLastVisit As HttpCookie = Request.Cookies("LastVisit") Response.Cookies("LastVisit").Value = Now.ToString Response.Cookies("LastVisti").Expires = DateTime.Now.AddDays(1) End If Else Response.Write("Your browser does not accept cookies") End If Quote
Daspoo Posted March 6, 2003 Posted March 6, 2003 pruebens: I may be wrong here (stranger things have happened), but perhaps if you try "Page.User.Identity.Name.ToString" to grab the login of the user currently logged in. My boss mentioned that to my team and I once and I believe that is what it is for. Hope this is right and it helps! :cool: Quote 3,450,897,223 posts away from crazy...
pruebens Posted March 6, 2003 Author Posted March 6, 2003 That worked beautifully! Now is there a way to snag something say the currently installed Printers? Quote
*Gurus* Derek Stone Posted March 6, 2003 *Gurus* Posted March 6, 2003 System.Drawing.Printing.PrinterSettings.InstalledPrinters Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.