Registration Form
If anybody wants to register only user of specific intranet then they will check if user is exist on intranet domain or not. If available then add record to UserInfo.Xml file of app_data folder.
If user is already exists then show message for that.
Users is a dataset contain username and useremail.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Drawing;
using System.DirectoryServices.AccountManagement;
namespace MobileEnabledWebFormsApp.Mobile
{
public partial class RegistrationForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
loginlink.Visible = false;
}
protected void btnAddUser_Click(object sender, EventArgs e)
{
//Add new Record to XML File
string domain = "Domain Name";
string uname = txtUserName.Text.Trim();
if (UserExists(uname, domain))
{
Users users = new Users();
users.ReadXml(Server.MapPath("~/App_Data/UsersInfo.xml"));
//Check if user allready exists or not
if (users != null && users.Tables.Count > 0 && users.Tables[0].Rows.Count > 0)
{
int i;
bool flag = false;
for (i = 0; i < users.Tables[0].Rows.Count; i++)
{
if (users.Tables[0].Rows[i].ItemArray[0].ToString() == uname)
{
flag = true;
}
}

Join the conversation! Your thoughts help the community grow.