Showing posts with label ASP. Show all posts
Showing posts with label ASP. Show all posts

Sunday, 2 March 2014

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed



Process 1:
1)    Open IIS (Internet Information Services) Manager
2)    View the “Application Pools” node
3)    Either create a new Application Pool (call it anything you like) OR Select the Application Pool for the application you are trying to run.
4)    Select the “Advanced Settings” option
5)    Select the Identity under the “Process Model” group and change the Identity settings to NetworkService.
6)    Then Click OK.
Then run this application Right click on this website >> Manage Application >> Browse.
OR
Process 2:
Repeat the steps 1 to 4
5.  Select the Identity under the “Process Model” group and set the "Load User Profile" option to "True".
6. Then Click OK.
Then run this application Right click on this website >> Manage Application >> Browse.

Friday, 29 November 2013

How to Find MAC Address or Physical Address of Your Computer in ASP.NET using C#?

Add Default aspx page for design purpose.


Default2.aspx


Default2.aspx.cs
(Write the below code in to code behind page or .cs file) 



using System.Xml.Linq;
using System.Windows.Forms;
using System.Net.NetworkInformation;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //get all network interfaces
        NetworkInterface[] netinterface = NetworkInterface.GetAllNetworkInterfaces();
        //display the physical address of the first network interface in the array,
        //which should correspond to our mac address
        Label1.Text = netinterface[0].GetPhysicalAddress().ToString();
    }
   
}
 Descriptions:


Let’s review what this code is actually doing. First, we create an array of NetworkInterface objects and then populate that using the GetAllNetworkInterfaces method. Then, we display the physical or MAC address of the first NetworkInterface in the array which will correspond to your MAC address. Depending on your hardware you may want to use a different index of the array, however this will suffice for most machines.


Output: