intranet

Getting the logged in username in ASP.NET MVC3 intranet application

别来无恙 提交于 2019-12-01 15:44:04
I am working on a MVC 3 intranet application ( windows authentication ). The application must display the profile page of the user once a user logs in. In order to do that the username of the logged in user must be passed in as a route parameter in the following route in Global.asax.cs. routes.MapRoute( "Initial", "{controller}/{action}/{emailAlias}", // URL with parameters new { controller = "Home", action = "Home", userId = **<USERNAME>**} ); Here, for the I've used some alternatives. At first I used Environment.Username . Which works well in development. But not after publishing. Because

Getting the logged in username in ASP.NET MVC3 intranet application

懵懂的女人 提交于 2019-12-01 14:38:43
问题 I am working on a MVC 3 intranet application ( windows authentication ). The application must display the profile page of the user once a user logs in. In order to do that the username of the logged in user must be passed in as a route parameter in the following route in Global.asax.cs. routes.MapRoute( "Initial", "{controller}/{action}/{emailAlias}", // URL with parameters new { controller = "Home", action = "Home", userId = **<USERNAME>**} ); Here, for the I've used some alternatives. At

Lazarus: How to list all the available network connection on a system?

泪湿孤枕 提交于 2019-12-01 09:37:32
I am writing a program on a Linux system using Lazarus IDE. The program is supposed to connect to the Internet or Intranet. So, I want to display to the user list of all the available network connections that they can use to connect to the Internet or Intranet like wifi, if there are two active network cards on the system, then this program should display their available connections. At the moment, I don't know where to start or what tool(s) to use. Any hints, clues or advice will be greatly appreciated. You can use ifconfig to list all available network interfaces and their status. Edit: For

ASP.NET Getting Current User Name

纵然是瞬间 提交于 2019-12-01 04:10:21
I am trying to build an application on our company's intranet using ASP.NET and VB.NET. Neither of these functions return anything once my application is published to IIS. They work fine in development (ie: pressing F5 I get my regular network username), but once published they return '' (an empty string). HttpContext.Current.User.Identity.Name Page.User.Identity.Name I'm looking for something -- anything -- that will grab the current users login name. Please note that I CANNOT change these settings in my web.config, because of other functionality requirements. <authentication mode="Windows"/>

Opening excel files from the internet opens a blank excel window

馋奶兔 提交于 2019-12-01 04:04:35
A method in dumping a GridView to an Excel file to download/open from the internet was recently broken with new Windows Updates. My code dumps from a GridView to an XLS file using StringWriter, HTMLTextWriter and RenderControl. A common approach using the following code from http://www.aspsnippets.com/Articles/Export-GridView-to-Excel-in-ASPNet-with-Formatting-using-C-and-VBNet.aspx Protected Sub ExportToExcel(sender As Object, e As EventArgs) Response.Clear() Response.Buffer = True Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.xls") Response.Charset = ""

ASP.NET Getting Current User Name

坚强是说给别人听的谎言 提交于 2019-12-01 01:50:47
问题 I am trying to build an application on our company's intranet using ASP.NET and VB.NET. Neither of these functions return anything once my application is published to IIS. They work fine in development (ie: pressing F5 I get my regular network username), but once published they return '' (an empty string). HttpContext.Current.User.Identity.Name Page.User.Identity.Name I'm looking for something -- anything -- that will grab the current users login name. Please note that I CANNOT change these

Opening excel files from the internet opens a blank excel window

↘锁芯ラ 提交于 2019-12-01 01:43:19
问题 A method in dumping a GridView to an Excel file to download/open from the internet was recently broken with new Windows Updates. My code dumps from a GridView to an XLS file using StringWriter, HTMLTextWriter and RenderControl. A common approach using the following code from http://www.aspsnippets.com/Articles/Export-GridView-to-Excel-in-ASPNet-with-Formatting-using-C-and-VBNet.aspx Protected Sub ExportToExcel(sender As Object, e As EventArgs) Response.Clear() Response.Buffer = True Response

Get the username of the user accessing ASP.NET intranet page within local network

牧云@^-^@ 提交于 2019-11-30 10:15:14
We have an ASP.NET intranet site, available to users who are either physically at and logged into a local machine or else to users who connect remotely via VPN. Is there a way to automatically get the username of whoever is accessing the page based on the name used to either log into the local machine or that used for the VPN? This is possible if you're using Windows Authentication in your pages. You can use either Page.User.Identity.Name or the more complete System.Web.HttpContext.Current.User.Identity.Name . Read more about it here: Enabling Windows Authentication within an Intranet ASP.NET

MVC3 Windows Authentication override User.Identity

佐手、 提交于 2019-11-30 03:54:42
I am building a intranet application using MVC3 with a MSSQL backend. I have authentication and roles (through a custom roles provider) working properly. What I am trying to do now is overriding User.Identity to allow for items like User.Identity.FirstName. But I cannot find any code that will show me how do this in WindowsIdentity I have tried writing a custom provider: public class CPrincipal : WindowsPrincipal { UserDAL userDAL = new UserDAL(); public CPrincipal(WindowsIdentity identity) : base(identity) { userInfo = userDAL.GetUserProfile(identity.Name.Split('\\')[1]); this.identity =

Windows authentication for Intranet/Internet

你离开我真会死。 提交于 2019-11-30 02:44:52
I am developing an ASP.net web application for my company. Some users use this site in the internal network (Intranet) and some use the Internet site. I am using Windows Authentication mode. I need to find a way to not prompt Windows Authentication mode for an Intranet user and prompt Windows Authentication mode for an Internet user. How can I do this? Pierre-Luc Simard Based on what your are describing, Windows Authentication in IIS will do the trick. First some links: Technet as an article about the Windows Authentication in IIS here MSDN tells you how to use Windows Authentication with ASP