trust coding
trust coding
CODING
AdminLogin.aspx
<%@PageLanguage="C#"AutoEventWireup="true"MasterPageFile="~/
Administrator.master" CodeFile="AdminLogin.aspx.cs" Inherits="AdminLogin" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="tpalogin" runat="server">
<asp:Label style="position:absolute; top: 216px; left: 445px;" ID="Label1"
runat="server" Text="Administrator" Font-Size="14pt"
Font-Names="Verdana" Font-Bold="True"
ForeColor="#CC3300"></asp:Label>
<asp:Panel style="position:absolute; width: 360px; top: 258px; left: 259px; height: 207px;"
ID="Panel1" runat="server" BorderWidth="4px" BorderColor="#CC3300"
BorderStyle="Solid">
<asp:Label style="position:absolute; top: 35px; left: 21px;" ID="Label2" runat="server"
Font-Bold="True" Font-Names="Verdana" Font-Size="Medium"
Text="Admin Id"></asp:Label>
<asp:TextBox style="position:absolute; top: 35px; left: 146px; width: 185px; height: 25px;
text-align: center;" ID="TextBox1" runat="server" Font-Names="Bookman Old Style" Font-
Size="16"></asp:TextBox>
<asp:Label style="position:absolute; top: 95px; left: 21px;" ID="Label3"
runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="Medium"
Text="Password"></asp:Label>
<asp:TextBox style="position:absolute; top: 95px; left: 146px; width: 185px; height: 25px;"
ID="TextBox2" runat="server" TextMode="Password"
Font-Names="Bookman Old Style" Font-Size="16"></asp:TextBox>
<asp:Button STYLE="position:absolute; background-color: Transparent; background-image:
url('Images/red.jpg'); top: 149px; left: 72px; width: 97px; height: 32px;"
ID="Button1" runat="server" Text="Submit" Font-Size="15pt" ForeColor="#CC3300"
Font-Names="Imprint MT Shadow" onclick="Button1_Click" Font-Bold="True" />
<asp:Button STYLE="position:absolute; background-color: Transparent; background-image:
url('Images/red.jpg'); top: 149px; left: 187px; width: 97px; height: 32px;"
ID="Button2" runat="server" Text="Clear" Font-Size="15pt" ForeColor="#CC3300"
Font-Names="Imprint MT Shadow" onclick="Button2_Click" Font-Bold="True" />
</asp:Panel><asp:LinkButton ID="LinkButton3" runat="server" Font-Bold="True"
Font-Names="Imprint MT Shadow" Font-Size="Large" Font-Underline="False"
ForeColor="Black" STYLE="position:absolute; top: 434px; left: 764px; width: 149px;"
PostBackUrl="~/Default.aspx">Back to Home</asp:LinkButton>
<cc1:DropShadowExtender ID="DropShadowExtender1" runat="server" Opacity=".1"
TargetControlID="Panel1" Rounded="true" Radius="3"> </cc1:DropShadowExtender>
<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"
WatermarkCssClass="watermarked" WatermarkText="Administrator ID"
TargetControlID="Textbox1">
</cc1:TextBoxWatermarkExtender><cc1:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender2" runat="server" WatermarkCssClass="watermarked"
WatermarkText="Password" TargetControlID="Textbox2">
</cc1:TextBoxWatermarkExtender><asp:ScriptManager ID="ScriptManager1"
runat="server"></asp:ScriptManager></asp:Content>
AdminLogin.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class AdminLogin : System.Web.UI.Page
{
string upid, uppwd;
protected void Button1_Click(object sender, EventArgs e)
{
upid = TextBox1.Text.ToUpper();
uppwd = TextBox2.Text.ToUpper();
if (TextBox1.Text == "") {
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Administrator ID";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else
{
if (TextBox2.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Administrator Password";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (upid == "ADMIN" && uppwd == "ADMIN")
{ Response.Redirect("CloudReport.aspx"); }
else
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Administrator ID/Password Correcly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}}}}
protected void Button2_Click(object sender, EventArgs e)
{TextBox1.Text = "";
TextBox2.Text = "";
}}
AdminOwnerDetails.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class AdminOwnerDetails : System.Web.UI.Page
{
SqlConnectioncon=new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SqlDataAdapter adp = new SqlDataAdapter("Select ownerid from Registration", con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DropDownList1.Items.Add(ds.Tables[0].Rows[i]["ownerid"].ToString());
}}}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedItem.Text == "--Select--")
{
Panel2.Visible = false;
}
else
{
Panel2.Visible = true;
SqlDataAdapter adp = new SqlDataAdapter("Select * from Registration where ownerid='" +
DropDownList1.SelectedItem.Text + "'", con);
DataSet ds = new DataSet(); adp.Fill(ds);
Label5.Text = ds.Tables[0].Rows[0]["oid"].ToString();
Label8.Text = ds.Tables[0].Rows[0]["ownerid"].ToString();
Label11.Text = ds.Tables[0].Rows[0]["gender"].ToString();
Label14.Text = ds.Tables[0].Rows[0]["age"].ToString();
Label17.Text = ds.Tables[0].Rows[0]["mobile"].ToString();
Label20.Text = ds.Tables[0].Rows[0]["emailid"].ToString();
Label23.Text = ds.Tables[0].Rows[0]["date"].ToString();
}}}
AdminOwnerDetails.aspx
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Text;
using System.Security.Cryptography;
public partial class ClientRegistration : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
Class1 cs = new Class1();
int ownerid, Securitykey = 0;
string owrid, yes, yes1;
string owrid1, owrpwd, yes2,blacked;
string pas1;
string gMailAccount = "[email protected]";
string password = "alliswell1";
string to;
string subject = "secret key for login";
string message;
string Securitykey1;
string ranno,ranno1;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TextBox6.Text = DateTime.Now.ToShortDateString();
TextBox3.Attributes.Add("OnKeyPress", "ValidateNumeric()");
TextBox4.Attributes.Add("OnKeyPress", "ValidateNumeric()");
Panel1.Visible = false;
Label9.Visible = false;
Panel2.Visible = false;
Panel3.Visible = false;
Label13.Visible = false;
Button7.Visible = false;
}
ownerid = cs.idgeneration();
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client ID.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (TextBox2.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client Password.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else {
if (RadioButtonList1.SelectedIndex == -1)
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Select Gender";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{
if (TextBox3.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter your age.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (TextBox4.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter your contact number.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (TextBox5.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter your Email ID.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else
{
SqlDataAdapter adp = new SqlDataAdapter("select * from Registration", con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
owrid = ds.Tables[0].Rows[i]["ownerid"].ToString();
if (owrid == TextBox1.Text)
{yes = "yes";
goto Outer;}
else
{yes = "no";}}
Outer:
yes1 = "yes";
if (yes != "yes")
{
SqlCommand cmd = new SqlCommand();
con.Open();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "SPRegistration";
cmd.Parameters.Add("@oid", SqlDbType.Int, 0);
cmd.Parameters["@oid"].Value = ownerid;
cmd.Parameters.Add("@ownerid", SqlDbType.VarChar, 50);
cmd.Parameters["@ownerid"].Value = TextBox1.Text;
cmd.Parameters.Add("@ownerpwd", SqlDbType.NVarChar, 50);
cmd.Parameters["@ownerpwd"].Value = TextBox2.Text;
cmd.Parameters.Add("@gender", SqlDbType.NVarChar, 10);
cmd.Parameters["@gender"].Value = RadioButtonList1.SelectedItem.Text;
cmd.Parameters.Add("@age", SqlDbType.Int, 3);
cmd.Parameters["@age"].Value = TextBox3.Text;
cmd.Parameters.Add("@mobile", SqlDbType.BigInt, 15);
cmd.Parameters["@mobile"].Value = TextBox4.Text;
cmd.Parameters.Add("@emailid", SqlDbType.NVarChar, 50);
cmd.Parameters["@emailid"].Value = TextBox5.Text;
cmd.Parameters.Add("@date", SqlDbType.NVarChar, 10);cmd.Parameters["@date"].Value
= TextBox6.Text;
owrid1 = ds.Tables[0].Rows[i]["ownerid"].ToString();
owrpwd = ds.Tables[0].Rows[i]["ownerpwd"].ToString();
blacked = ds.Tables[0].Rows[i]["Black"].ToString();
if (TextBox7.Text == owrid1 && TextBox8.Text == owrpwd && blacked=="True")
{
yes2 = "yes";
con.Open();
SqlCommand blsa = new SqlCommand("Update Registration set Count='0' where ownerid='"
+ TextBox7.Text + "'", con);
blsa.ExecuteNonQuery();
con.Close();
}}
if (yes2 == "yes")
{
Session["ownerid"] = TextBox7.Text;
//Response.Redirect("OwnerMain.aspx");
//Panel2.Visible = true;
Button7.Visible = true;
//this.Button1.Attributes.Add("onclick", "javascript:return OpenPopup()");
//onClick="genericPopup(this.href,300,300,no)"
//Response.Write("<script>window.close()</script>");
}
else
{
SqlDataAdapter adpb = new SqlDataAdapter("select ownerid,Count from Registration where
ownerid='"+ TextBox7.Text+"'", con);
DataSet dsb = new DataSet();
adpb.Fill(dsb);
Label14.Text=dsb.Tables[0].Rows[0]["Count"].ToString();
if ("0" == Label14.Text)
{
con.Open();
SqlCommand bla = new SqlCommand("Update Registration set Count=Count+1 where
ownerid='" + TextBox7.Text + "'", con);
bla.ExecuteNonQuery();
con.Close();
string count = string.Empty;
count = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + Label14.Text + "');",
true);
}
if ("1" == Label14.Text)
{
con.Open();
SqlCommand bla = new SqlCommand("Update Registration set Count=Count+1 where
ownerid='" + TextBox7.Text + "'", con);
bla.ExecuteNonQuery();
con.Close();
string count = string.Empty;
count = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + Label14.Text + "');",
true);
}
if ("2" == Label14.Text)
{con.Open();
SqlCommand bla = new SqlCommand("Update Registration set Count=Count+1 where
ownerid='" + TextBox7.Text + "'", con);
bla.ExecuteNonQuery();
con.Close();
string count = string.Empty;
count = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + Label14.Text + "');",
true);
}
if ("3" == Label14.Text)
{
con.Open();
SqlCommand bla = new SqlCommand("Update Registration set Count=Count+1 where
ownerid='" + TextBox7.Text + "'", con);
bla.ExecuteNonQuery();
con.Close();
Label14.Text = "your Account Blacked";
string count = string.Empty;
count = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + Label14.Text + "');",
true);
}
else
{
con.Open();
SqlCommand blsa = new SqlCommand("Update Registration set Black='Black' where
ownerid='" + TextBox7.Text + "'", con);
blsa.ExecuteNonQuery();
con.Close();
}
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}}}}
protected void Button4_Click(object sender, EventArgs e)
{ TextBox7.Text = "";
TextBox8.Text = ""; }
protected void Button7_Click(object sender, EventArgs e)
{
Panel3.Visible = true;
Button7.Visible = false;
pas1 = (string)Session["pas"];
if (TextBox7.Text == ""){
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client ID";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{
if (pas1 == "")
{string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Client Password";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else{
SqlDataAdapter adp = new SqlDataAdapter("select * from Registration", con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
owrid = ds.Tables[0].Rows[i]["oid"].ToString();
owrid1 = ds.Tables[0].Rows[i]["ownerid"].ToString();
owrpwd = ds.Tables[0].Rows[i]["ownerpwd"].ToString();
if (TextBox7.Text == owrid1 && pas1 == owrpwd)
{
Random val = new Random();
int rno = val.Next(12345, 54321);
ranno = Convert.ToString(rno);
ranno1 = Encrypt(ranno);
Session["rendomnum"] = ranno1;
con.Open();
SqlCommand cmd = new SqlCommand("update Registration set securitykey='" + ranno1 +
"'where oid='" + owrid + "'", con);
cmd.ExecuteNonQuery();
con.Close();
message = "<hr><br>Hello " + "<b>" + owrid + " ! </b><br><br>" + "Your Login Security
Key is : " + "<b>" + ranno1 + "</b>";
to = ds.Tables[0].Rows[i]["emailid"].ToString();
NetworkCredential loginInfo = new NetworkCredential(gMailAccount, password);
MailMessage msg = new MailMessage();
msg.From = new MailAddress(gMailAccount);
msg.To.Add(new MailAddress(to));
msg.Subject = subject;
msg.Body = message;
msg.IsBodyHtml = true;
try{
SmtpClient client = new SmtpClient("smtp.gmail.com");
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = loginInfo;
client.Send(msg);}
catch (Exception ex){
Console.WriteLine(ex);
Label11.Text = "OFFLINE : Failure Sending Mail !";
LinkButton4.Visible = true;}
yes2 = "yes";
}}
if (yes2 == "yes"){
Session["ownerid"] = TextBox7.Text;
Panel3.Visible = true; Label11.Visible = true;
TextBox9.Visible = true; Label12.Visible = true;
Button5.Visible = true; Button6.Visible = true; Button7.Visible = false;
}
else
{string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Clientid/Password Correctly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}}}}
protected void Button5_Click(object sender, EventArgs e)
{Securitykey1 = (string)Session["rendomnum"];
if (TextBox9.Text == Securitykey1)
{Session.Remove("rendomnum");
con.Open();
SqlCommand blsas = new SqlCommand("Update Registration set Rank=Rank+1 where
securitykey='" + TextBox9.Text + "'", con);
blsas.ExecuteNonQuery();
con.Close();
Response.Redirect("OwnerFileUpload.aspx");}
else{
TextBox9.Text = "";
//Response.Redirect("OwnerLogin.aspx");
string myStringVariable1 = string.Empty;
myStringVariable1 = "You are not authenticated. Plz try again once.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}}
protected void Button6_Click(object sender, EventArgs e)
{TextBox9.Text = "";}
protected void LinkButton4_Click(object sender, EventArgs e)
{
Panel3.Visible = true; Label11.Visible = true;
TextBox9.Visible = true; Label12.Visible = true;
Button5.Visible = true; Button6.Visible = true; Button7.Visible = false;
TextBox9.Text = (string)Session["rendomnum"];
string myStringVariable1 = string.Empty;
myStringVariable1 = "Your Login Public Key is : " + (string)Session["rendomnum"] ;
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
Panel3.Visible = false; Label11.Visible = false;
Label12.Visible = false; TextBox9.Visible = false;
Button5.Visible = false; Button6.Visible = false;
Button7.Visible = true; Panel2.Visible = true;
}
private string Encrypt(string clearText)
{
string EncryptionKey = "MAKV2SPBNI99212";
//byte[] Key = Encoding.UTF8.GetBytes("asdf!@#$1234ASDF");
byte[] clearBytes = Encoding.Unicode.GetBytes(clearText);
using (Aes encryptor = Aes.Create())
{
Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49,
0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
encryptor.Key = pdb.GetBytes(32);
encryptor.IV = pdb.GetBytes(16);
using (MemoryStream ms = new MemoryStream())
{
using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(),
CryptoStreamMode.Write))
{cs.Write(clearBytes, 0, clearBytes.Length);
cs.Close();}
clearText = Convert.ToBase64String(ms.ToArray());
}}return clearText;}}
CloudReport.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class down : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(@"Data Source=SHANKARI;Initial Catalog=Trust
Enhanced Cryptographic;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Visible = false; Button1.Visible = false;
con.Open();
SqlCommand cmd = new SqlCommand("select
fid,ffilename,fowner,fenccryptokey,fdatetime,filepath from filearchive where
keystatus='Sent'", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds); con.Close();
ggt.DataSource = ds;
ggt.DataBind(); }
protected void lnkDownload_Click(object sender, EventArgs e)
{
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = ggt.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "image/jpg";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(filePath);
Response.End(); }
protected void Button1_Click1(object sender, EventArgs e)
{
//con.Open();
//SqlCommand cmd = new SqlCommand("select
fid,ffilename,fowner,fenccryptokey,fdatetime,filepath from filearchive where
keystatus='Sent'", con);
//SqlDataAdapter da = new SqlDataAdapter(cmd);
//DataSet ds = new DataSet();
//da.Fill(ds); //con.Close();
//ggt.DataSource = ds;
//ggt.DataBind();
}
protected void Button2_Click(object sender, EventArgs e)
{Response.Redirect("default.aspx");}}
Download.aspx
Download.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Download : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
keystatus='Sent'", con); DataSet ds1 = new DataSet(); adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1; GridView1.DataBind();}
else
{MsgBox.Show("TPA doesn't sent any files to download");}
Session["owner"] = ds1.Tables[0].Rows[0]["fowner"].ToString();
Session["fid1"] = ds1.Tables[0].Rows[0]["fid"].ToString();
Session["fname"] = ds1.Tables[0].Rows[0]["ffilename"].ToString();}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{GridView1.PageIndex = e.NewPageIndex; bindgrid();}
public void bindgrid()
{SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
keystatus='Sent'", con);
DataSet ds1 = new DataSet(); adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1; GridView1.DataBind();}
else
{MsgBox.Show("TPA doesn't send any files to download");}
Session["owner"] = ds1.Tables[0].Rows[0]["fowner"].ToString();
Session["fid1"] = ds1.Tables[0].Rows[0]["fid"].ToString();
Session["fname"] = ds1.Tables[0].Rows[0]["ffilename"].ToString();}
protected void LinkButton1_Click(object sender, EventArgs e)
{LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = GridView1.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "image/jpg";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath(filePath));
Response.End();}}
IntruderDetails.aspx
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Intruderdetails : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
fmodify='Block'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{
GridView1.DataSource = ds1;
GridView1.DataBind();
}
else
{MsgBox.Show("No Intruder Alerts Found");
}}
public void bindgrid()
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
fmodify='Block'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
else
{MsgBox.Show("No Intruder Alerts Found");}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
bindgrid();
}}
KeyResponses.aspx
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class KeyResponses : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
serverview='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();
}
else
{
MsgBox.Show("No KeyResponse Found");
}}
public void bindgrid()
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where
serverview='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
else
{MsgBox.Show("No KeyResponse Found");
}}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
bindgrid();
}}
OwnerCentralRepository.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
public partial class OwnerCentralRepository : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
SqlDataAdapter sda = new SqlDataAdapter("select
fid,fsubject,ffilename,fsizeinkb,fdatetime,fowner,tpaview,serverview,keystatus from
Registration", con);
DataSet ds = new DataSet();
sda.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}}
catch (Exception ex)
{
MsgBox.Show("Time out");
}}
protected void btnlinkAccepted_Click(object sender, EventArgs e)
{
try
{
con.Open();
GridViewRow gr = ((sender as LinkButton).NamingContainer as GridViewRow);
Session["oid"] = gr.Cells[1].Text.Trim();
SqlCommand cmdA = new SqlCommand("Update filearchive set Black='Trust Data Black'
where oid='" + gr.Cells[1].Text.Trim() + "'", con);
cmdA.ExecuteNonQuery();
con.Close();
}
catch (Exception ex)
{
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(),
Guid.NewGuid().ToString(), "alert(''Invalid Authenticate');", true);
}}}
OwnerFileUpload.aspx
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Diagnostics;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Data.SqlClient;
public partial class OwnerFileUpload : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
Class1 cs = new Class1();
Cryptography cr = new Cryptography();
float sessionfilesize;
string totalbytes;
string gMailAccount = "[email protected]";
string password = "project5";
string to;
string subject = "Cryptography Encryption Key";
string message;
string ownerid, filePath, filename, filesize, fileext, date;
string cryptographykey, fileenccryptographykey;
float filesiz = 0f;
string splitfilesize, checkfilename, yes, yes1, binary1, binary1enc, singlefilesize,s1;
string fverify = "NO", fmodify = "", fdownload = "Block", keyrequest = "Null", emailid;
protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack){
Label4.Text = Convert.ToString(cs.idgeneration1());
Label7.Visible = false;}
ownerid = (string)Session["ownerid"];}
protected void Button3_Click(object sender, EventArgs e)
{if (Label1.Text == "OK"){
//Button2.Text = "Check..";
//Label7.Text = "File Uploaded Status..";
//Label7.ForeColor = System.Drawing.ColorTranslator.FromHtml("#B4045F");}
else{
filename = System.IO.Path.GetFileName(FileUpload1.FileName);
if (filename == ""){
string myStringVariable1 = string.Empty;
myStringVariable1 = "select any one file";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
//File Upload TextBox is Empty?
Else
{
//filePath = Request.PhysicalApplicationPath + "Uploads/" +
System.IO.Path.GetFileName(AsyncFileUpload1.FileName);
//AsyncFileUpload1.SaveAs(filePath);
//byte[] filebytes = new byte[AsyncFileUpload1.PostedFile.InputStream.Length + 1];
//AsyncFileUpload1.PostedFile.InputStream.Read(filebytes, 0, filebytes.Length);
////byte[] filebytes = new byte[AsyncFileUpload1.PostedFile.InputStream.Length];
//fileext = System.IO.Path.GetExtension(AsyncFileUpload1.PostedFile.FileName);
filePath = Request.PhysicalApplicationPath + "Uploads/" +
System.IO.Path.GetFileName(FileUpload1.FileName);
FileUpload1.SaveAs(filePath);
byte[] filebytes = new byte[FileUpload1.PostedFile.InputStream.Length];
FileUpload1.PostedFile.InputStream.Read(filebytes, 0, filebytes.Length);
//byte[] filebytes = new byte[AsyncFileUpload1.PostedFile.InputStream.Length];
fileext = System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName);
filesiz = (float)FileUpload1.PostedFile.ContentLength / 1024;
filesize = Convert.ToString(filesiz) + " KB";
date = Convert.ToString(DateTime.Now.ToShortDateString());
totalbytes = Convert.ToString(FileUpload1.PostedFile.ContentLength);
Session["totalbytes"] = totalbytes;
sessionfilesize = (float)FileUpload1.PostedFile.ContentLength / 9;
Session["Filecontent"] = sessionfilesize;
singlefilesize = Convert.ToString(FileUpload1.PostedFile.ContentLength / 9);
s1 = Convert.ToString(singlefilesize);
Random val = new Random();
int rno = val.Next(12345, 54321);
cryptographykey = Convert.ToString(rno);
fileenccryptographykey = cr.Encrypt(cryptographykey);
//splitfilesize = Convert.ToString(filesiz);
//for (int i = 0; i < splitfilesize.Length; i++)
//{
// char c = splitfilesize[i];
// string binary = Convert.ToString(c, 2);
// binary1 = binary1 + binary;
//}
//binary1enc = cr.Encrypt(binary1);
//TextBox3.Text = binary1;
//Label9.Visible = true;
//TextBox3.Visible = true;
if (TextBox2.Text == ""){
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter File Subject.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
//File Subject TextBox is Empty?
else{
SqlDataAdapter adp = new SqlDataAdapter("select * from filearchive", con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++){
checkfilename = ds.Tables[0].Rows[i]["ffilename"].ToString();
if (checkfilename == filename)
{
yes = "yes";
goto Outer;}
else{
yes = "no";
}}
Outer:
yes1 = "yes";
if (yes != "yes")
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into filearchive values('" + Label4.Text + "','"
+ TextBox2.Text + "','" + filePath + "',@files,'" + filename + "','" + fileext + "','" + filesize +
"','" + date + "','" + ownerid + "','" + fileenccryptographykey + "','" + binary1enc + "','" +
fverify + "','" + fmodify + "','" + fdownload + "','" + keyrequest + "','" + totalbytes + "','" +
sessionfilesize + "','" + singlefilesize + "','','','','','','','','','','','','','','','','','','','','','','')", con);
cmd.Parameters.AddWithValue("@files", filebytes);
cmd.ExecuteNonQuery();
con.Close();
//filename = "";
Session["fid1"] = Label4.Text;
Label7.Text = "File Uploaded Successfully..";
Label7.Visible = true;
//Button2.Text = "OK";
Label7.ForeColor = System.Drawing.ColorTranslator.FromHtml("#088A08");
//ModalPopupExtender1.Show();
//Panel3.Visible = true;
//SqlDataAdapter adp1 = new SqlDataAdapter("select * from Registration where ownerid='"
+ (string)Session["ownerid"] + "'", con);
//DataSet ds1 = new DataSet();
//adp1.Fill(ds1);
//emailid = ds1.Tables[0].Rows[0]["emailid"].ToString();
//message = "<hr><br>" + "File Name : <b>" + filename + " ! </b><br><br>" +
"Cryptography Encryption Key is : " + "<b>" + fileenccryptographykey + "</b>";
//to = emailid;
//NetworkCredential loginInfo = new NetworkCredential(gMailAccount, password);
//MailMessage msg = new MailMessage();
//msg.From = new MailAddress(gMailAccount);
//msg.To.Add(new MailAddress(to));
//msg.Subject = subject;
//msg.Body = message;
//msg.IsBodyHtml = true;
//try
//{
// Label6.Visible = true;
// Label6.ForeColor = System.Drawing.ColorTranslator.FromHtml("#226116");
// Label6.Text = "File Cryptography Encryption Key Sent To Mail !";
// SmtpClient client = new SmtpClient("smtp.gmail.com");
// client.EnableSsl = true;
// client.UseDefaultCredentials = false;
// client.Credentials = loginInfo;
// client.Send(msg);
//}
//catch (Exception ex)
//{
// Label6.Visible = true;
// Label6.ForeColor = System.Drawing.ColorTranslator.FromHtml("#fa0505");
// Console.WriteLine(ex);
// Label6.Text = "OFFLINE : Failure Sending Mail !";
//}
}
else{
string myStringVariable1 = string.Empty;
myStringVariable1 = "This File Name Already Exists.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}}
Page_Load(null, EventArgs.Empty);
}}}
protected void Button1_Click(object sender, EventArgs e)
{
TextBox2.Text = "";
//TextBox3.Visible = false;
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
//Label6.Visible = false;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("packetsending.aspx");
}
protected void LinkButton4_Click(object sender, EventArgs e)
{
Response.Redirect("Download.aspx");
}
}
OwnerInteractionHistory.aspx
OwnerInteractionHistory.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
public partial class OwnerInteractionHistory : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
SqlDataAdapter sda = new SqlDataAdapter("select
oid,ownerid,gender,age,mobile,emailid,date,Black,Rank,RolesAuditor from Registration",
con);
DataSet ds = new DataSet();
sda.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}}
catch (Exception ex)
{
MsgBox.Show("Time out");
}}
protected void btnlinkAccepted_Click(object sender, EventArgs e)
{
try
{
con.Open();
GridViewRow gr = ((sender as LinkButton).NamingContainer as GridViewRow);
Session["oid"] = gr.Cells[1].Text.Trim();
SqlCommand cmdA = new SqlCommand("Update Registration set Black='Trust Decision
Black' where oid='" + gr.Cells[1].Text.Trim() + "'", con);
cmdA.ExecuteNonQuery();
con.Close();
}
catch (Exception ex)
{
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(),
Guid.NewGuid().ToString(), "alert(''Invalid Authenticate');", true);
}}}
PacketSending.aspx
PacketSending.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class packet_sending : System.Web.UI.Page
{
float addsplit=0;
string tr, binary1, binary1enc, binary1enc1, binary1enc2, binary1enc3, binary1enc4,
binary1enc5, binary1enc6, binary1enc7, binary1enc8;
int count = 0;
float eachfilesize = 0f;
float efsize = 0f;
string totalbytes;
string rannum;
string p1, binary2, binary3, binary4, binary5, binary6, binary7, binary8, binary9;
string p2,p3,p4,p5;
string splitfilesize, splitfilesize1, splitfilesize2, splitfilesize3, splitfilesize4, splitfilesize5,
splitfilesize6, splitfilesize7, splitfilesize8;
Cryptography cr = new Cryptography();
string cryptographykey, fileenccryptographykey;
float filesiz = 0f;
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack)
{Label25.Visible = false;
Label26.Visible = false;
Label27.Visible = false;
Label28.Visible = false;
Label29.Visible = false;
Label30.Visible = false;
Label31.Visible = false;
Label32.Visible = false;
Label33.Visible = false;
TextBox1.Visible = false;
TextBox2.Visible = false;
TextBox3.Visible = false;
TextBox4.Visible = false;
TextBox5.Visible = false;
TextBox6.Visible = false;
TextBox7.Visible = false;
TextBox8.Visible = false;
TextBox9.Visible = false;}}
protected void btnSend_Click(object sender, EventArgs e)
{try{
totalbytes = Convert.ToString(Session["totalbytes"]);
Label2.Text = Convert.ToString(Session["totalbytes"]) + " bytes";
eachfilesize = (float)Session["Filecontent"];
Label24.Text = Convert.ToString(Session["Filecontent"]) + " bytes";
Session["c"] = count;
if (Label36.Visible == false)
{if (Label27.Visible == false)
{if (CheckBox1.Checked == false)
{if (Label25.Visible == false)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 Sent ";
System.Threading.Thread.Sleep(1000);
TextBox1.Visible = true;
goto outer;}
if (Label25.Visible == true)
{
if (Label14.BackColor != System.Drawing.Color.Green)
{
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 Sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
if (Label26.Visible == true)
{
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 Sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
//goto outer;}
CheckBox1.Enabled = true;
Label27.Visible = true;}
else
{
if (CheckBox1.Checked == true)
{count++;
update();
Random val = new Random();
int rno = val.Next(1, 3);
rannum = Convert.ToString(rno);
if (rannum == "1")
{Label13.BackColor = System.Drawing.Color.Red;
Label25.Visible = true;
Label25.Text = "Level1 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "First Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 sent";
System.Threading.Thread.Sleep(1000);
goto outer;}
if (rannum == "2")
{Label14.BackColor = System.Drawing.Color.Red;
Label26.Visible = true;
Label26.Text = "Level2 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Second Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else{
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 sent";
System.Threading.Thread.Sleep(1000);
goto outer;}
if (rannum == "3")
{Label15.BackColor = System.Drawing.Color.Red;
Label27.Visible = true;
Label27.Text = "Level3 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Third Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 sent";
System.Threading.Thread.Sleep(1000);
goto outer;}
CheckBox1.Checked = false;
CheckBox1.Enabled = false;}}}
else
{if (Label30.Visible == false)
{if (CheckBox1.Checked == false)
{if (Label25.Visible == false)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 sent";
System.Threading.Thread.Sleep(1000);
goto outer;}
if (Label25.Visible == true)
{if (Label14.BackColor != System.Drawing.Color.Green){
//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
if (Label26.Visible == true)
{if (Label15.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
goto outer;}}
if (Label27.Visible == true)
{if (Label16.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label16.BackColor = System.Drawing.Color.Green;
//Label28.Visible = true;
//Label28.Text = "Block4 sent";
System.Threading.Thread.Sleep(1000);
TextBox4.Visible = true;
goto outer;}}
if (Label28.Visible == true)
{if (Label17.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label17.BackColor = System.Drawing.Color.Green;
//Label29.Visible = true;
//Label29.Text = "Block5 sent";
System.Threading.Thread.Sleep(1000);
TextBox5.Visible = true;
goto outer;}}
if (Label29.Visible == true){
if (Label18.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label18.BackColor = Syste
m.Drawing.Color.Green;
//Label30.Visible = true;
//Label30.Text = "Block6 sent";
System.Threading.Thread.Sleep(1000);
TextBox6.Visible = true;
goto outer;}}
CheckBox1.Enabled = true;
//Label36.Visible = true;}
else
{count++;
update();
Session["c"] = count;
Random val = new Random();
int rno = val.Next(1, 3);
rannum = Convert.ToString(rno);
if (Label25.Visible == false)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 sent";
System.Threading.Thread.Sleep(1000);
TextBox1.Visible = true;
goto outer;}
if (Label25.Visible == true)
{if (Label14.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
if (Label26.Visible == true)
{if (Label15.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
goto outer;}}
if (rannum == "1")
{Label16.BackColor = System.Drawing.Color.Red;
Label28.Visible = true;
Label28.Text = "Level4 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Fourth Packet is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{if (Label16.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label16.BackColor = System.Drawing.Color.Green;
//Label28.Visible = true;
//Label28.Text = "Block4 Sent";
System.Threading.Thread.Sleep(1000);
TextBox4.Visible = true;
goto outer;}}
if (rannum == "2")
{Label17.BackColor = System.Drawing.Color.Red;
Label29.Visible = true;
Label29.Text = "Level5 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Fifth Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{if (Label17.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label17.BackColor = System.Drawing.Color.Green;
//Label29.Visible = true;
//Label29.Text = "Block5 Sent";
System.Threading.Thread.Sleep(1000);
TextBox5.Visible = true;
goto outer;}}
if (rannum == "3")
{Label18.BackColor = System.Drawing.Color.Red;
Label30.Visible = true;
Label30.Text = "Level6 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Sixth Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else{
if (Label18.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label18.BackColor = System.Drawing.Color.Green;
//Label30.Visible = true;
//Label30.Text = "Block6 Sent ";
System.Threading.Thread.Sleep(1000);
TextBox6.Visible = true;
goto outer;}}
CheckBox1.Checked = false;
CheckBox1.Enabled = false;}}
else
{if (Label36.Visible == false)
{if (CheckBox1.Checked == false)
{if (Label25.Visible == false)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 Sent";
System.Threading.Thread.Sleep(1000);
TextBox1.Visible = true;
goto outer;}
if (Label25.Visible == true)
{if (Label14.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 Sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
if (Label26.Visible == true)
{if (Label15.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 Sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
goto outer;}}
if (Label27.Visible == true)
{if (Label16.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label16.BackColor = System.Drawing.Color.Green;
//Label28.Visible = true;
//Label28.Text = "Block4 Sent";
System.Threading.Thread.Sleep(1000);
TextBox4.Visible = true;
goto outer;}}
if (Label28.Visible == true)
{if (Label17.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label17.BackColor = System.Drawing.Color.Green;
//Label29.Visible = true;
//Label29.Text = "Block5 Sent";
System.Threading.Thread.Sleep(1000);
TextBox5.Visible = true;
goto outer;}}
if (Label30.Visible == false)
{if (Label18.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label18.BackColor = System.Drawing.Color.Green;
//Label30.Visible = true;
//Label30.Text = "Block6 Sent";
System.Threading.Thread.Sleep(1000);
TextBox6.Visible = true;
goto outer;}}
if (Label30.Visible == true)
{if (Label19.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label19.BackColor = System.Drawing.Color.Green;
//Label31.Visible = true;
//Label31.Text = "Block7 Sent";
System.Threading.Thread.Sleep(1000);
TextBox7.Visible = true;
goto outer;}}
if (Label31.Visible == true)
{if (Label20.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label20.BackColor = System.Drawing.Color.Green;
//Label32.Visible = true;
//Label32.Text = "Block8 Sent";
System.Threading.Thread.Sleep(1000);
TextBox8.Visible = true;
goto outer;}}
if (Label32.Visible == true)
{if (Label21.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label21.BackColor = System.Drawing.Color.Green;
//Label33.Visible = true;
//Label33.Text = "Block9 Sent";
System.Threading.Thread.Sleep(1000);
TextBox9.Visible = true;
goto outer;}}
//con.Open();
//SqlDataAdapter adp = new SqlDataAdapter("select * from filearchive where fid='" +
(string)Session["fid1"] + "'", con);
//DataSet ds = new DataSet();
//adp.Fill(ds);
//p1 = ds.Tables[0].Rows[0]["fowner"].ToString();
////SqlCommand c1 = new SqlCommand("select * from Sentfiles where Sendornot='" +
sendornotnull + "'", con);
////p2 = Convert.ToString(c1.ExecuteScalar());
//p3 = ds.Tables[0].Rows[0]["FID"].ToString();
//if(count==0)
//{
//if ((int)Session["c"] > 0)
//{
// sendornotnull = "Corrupted";
//}
//else
//{
// sendornotnull = "Success";
//}
// }
//SqlCommand cmd1 = new SqlCommand("Update Sentfiles set Sendornot='" +
sendornotnull + "'where FID='" + (string)Session["f"] + "'", con);
//cmd1.ExecuteNonQuery();
CheckBox1.Enabled = true;
Label36.Visible = true;
con.Close();}
else{
count++;
update();
Random val = new Random();
int rno = val.Next(1, 3);
rannum = Convert.ToString(rno);
if (Label25.Visible == false)
{if (Label13.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label13.BackColor = System.Drawing.Color.Green;
//Label25.Visible = true;
//Label25.Text = "Block1 Sent";
System.Threading.Thread.Sleep(1000);
TextBox1.Visible = true;
goto outer;}}
if (Label25.Visible == true)
{if (Label14.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label14.BackColor = System.Drawing.Color.Green;
//Label26.Visible = true;
//Label26.Text = "Block2 Sent";
System.Threading.Thread.Sleep(1000);
TextBox2.Visible = true;
goto outer;}}
if (Label26.Visible == true)
{if (Label15.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label15.BackColor = System.Drawing.Color.Green;
//Label27.Visible = true;
//Label27.Text = "Block3 Sent";
System.Threading.Thread.Sleep(1000);
TextBox3.Visible = true;
goto outer; }}
if (Label27.Visible == true)
{if (Label16.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label16.BackColor = System.Drawing.Color.Green;
//Label28.Visible = true;
//Label28.Text = "Block4 Sent";
System.Threading.Thread.Sleep(1000);
TextBox4.Visible = true;
goto outer;}}
if (Label28.Visible == true)
{if (Label17.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label17.BackColor = System.Drawing.Color.Green;
//Label29.Visible = true;
//Label29.Text = "Block5 Sent";
System.Threading.Thread.Sleep(1000);
TextBox5.Visible = true;
goto outer;}}
if (Label30.Visible == false)
{if (Label18.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label18.BackColor = System.Drawing.Color.Green;
//Label30.Visible = true;
//Label30.Text = "Block6 Sent";
System.Threading.Thread.Sleep(1000);
TextBox6.Visible = true;
goto outer;}}
if (rannum == "1")
{Label19.BackColor = System.Drawing.Color.Red;
Label31.Visible = true;
Label31.Text = "Level7 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Seventh Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else
{ if (Label19.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label19.BackColor = System.Drawing.Color.Green;
//Label31.Visible = true;
//Label31.Text = "Block7 Sent";
System.Threading.Thread.Sleep(1000);
TextBox7.Visible = true;
goto outer;}}
if (rannum == "2")
{Label20.BackColor = System.Drawing.Color.Red;
Label32.Visible = true;
Label32.Text = "Level8 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Eighth Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else
{if (Label20.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label20.BackColor = System.Drawing.Color.Green;
//Label32.Visible = true;
//Label32.Text = "Block8 Sent";
System.Threading.Thread.Sleep(1000);
TextBox8.Visible = true;
goto outer;}}
if (rannum == "3")
{Label21.BackColor = System.Drawing.Color.Red;
Label33.Visible = true;
Label33.Text = "Level9 Corrupted";
string myStringVariable1 = string.Empty;
myStringVariable1 = "Ninth Level is Corrupted";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true); }
else{
if (Label21.BackColor != System.Drawing.Color.Green)
{//addsplit = Convert.ToString(Convert.ToInt32(addsplit) + Convert.ToInt32(eachfilesize));
addsplit = (float)addsplit + eachfilesize;
Label21.BackColor = System.Drawing.Color.Green;
//Label33.Visible = true;
//Label33.Text = "Block9 Sent ";
System.Threading.Thread.Sleep(1000);
TextBox9.Visible = true;
goto outer;}}
//con.Open();
//SqlDataAdapter adp = new SqlDataAdapter("select * from Sentfiles", con);
//DataSet ds = new DataSet();
//adp.Fill(ds);
//SqlCommand c1 = new SqlCommand("select * from Sentfiles where Sendornot='" +
sendornotnull + "'", con);
//p4 = Convert.ToString(c1.ExecuteScalar());
//p5 = ds.Tables[0].Rows[0]["FID"].ToString();
//string senornot = "CORRUPTED";
//SqlCommand cmd1 = new SqlCommand("Update Sentfiles set Sendornot='" + senornot +
"'where FID='" + p3 + "'", con);
//cmd1.ExecuteNonQuery();
CheckBox1.Checked = false;
CheckBox1.Enabled = false;}}}}}
outer:
tr = "";}
catch(Exception ex)
{MsgBox.Show("Time Out, Go back Update Data");}}
public void update()
{
con.Open();
SqlCommand cmd1 = new SqlCommand("Update filearchive set Sendornot='Success',s1='" +
TextBox1.Text + "',s2='" + TextBox2.Text + "',s3='" + TextBox3.Text + "',s4='" +
TextBox4.Text + "',s5='" + TextBox5.Text + "',s6='" + TextBox6.Text + "',s7='" +
TextBox7.Text + "',s8='" + TextBox8.Text + "',s9='" + TextBox9.Text + "',m1='" +
Label4.Text + "',m2='" + Label5.Text + "',m3='" + Label6.Text + "',m4='" + Label7.Text +
"',m5='" + Label8.Text + "',m6='" + Label9.Text + "',m7='" + Label10.Text + "',m8='" +
Label11.Text + "',m9='" + Label12.Text + "' where fid='" + (string)Session["fid1"] + "'",
con);
cmd1.ExecuteNonQuery();
con.Close();}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
Random val = new Random();
int rno = val.Next(12345, 54321);
cryptographykey = Convert.ToString(rno);
fileenccryptographykey = cr.Encrypt(cryptographykey);
splitfilesize = TextBox1.Text;
for (int i = 0; i < splitfilesize.Length; i++)
{char c = splitfilesize[i];
string binary = Convert.ToString(c, 2);
binary1 = binary1 + binary;}
binary1enc = cr.Encrypt(binary1);
Label4.Text = binary1;
System.Threading.Thread.Sleep(1000);
Label25.Visible = true;
Label25.Text = "Block1 Sent ";}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{splitfilesize1 = TextBox2.Text;
for (int i1 = 0; i1 < splitfilesize1.Length; i1++)
{char c1 = splitfilesize1[i1];
string binar1 = Convert.ToString(c1, 2);
binary2 = binary2 + binar1;}
binary1enc1 = cr.Encrypt(binary2);
Label5.Text = binary2;
System.Threading.Thread.Sleep(1000);
Label26.Visible = true;
Label26.Text = "Block2 Sent";}
protected void TextBox3_TextChanged(object sender, EventArgs e)
{splitfilesize2 = TextBox3.Text;
for (int i2 = 0; i2 < splitfilesize2.Length; i2++)
{char c2 = splitfilesize2[i2];
string binar2 = Convert.ToString(c2, 2);
binary3 = binary3 + binar2;}
binary1enc2 = cr.Encrypt(binary3);
Label6.Text = binary3;
System.Threading.Thread.Sleep(1000);
Label27.Visible = true;
Label27.Text = "Block3 Sent";
//System.Threading.Thread.Sleep(1000);
//string myStringVariable1 = string.Empty;
//myStringVariable1 = "First part is Completed.Currently " + addsplit + " bytes are sent
successfully. ";
//ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1
+ "');", true);}
protected void TextBox4_TextChanged(object sender, EventArgs e)
{splitfilesize3 = TextBox4.Text;
for (int i3 = 0; i3 < splitfilesize3.Length; i3++)
{char c3 = splitfilesize3[i3];
string binar3 = Convert.ToString(c3, 2);
binary4 = binary4 + binar3;}
binary1enc3 = cr.Encrypt(binary4);
Label7.Text = binary4;
System.Threading.Thread.Sleep(1000);
Label28.Visible = true;
Label28.Text = "Block4 Sent";}
protected void TextBox5_TextChanged(object sender, EventArgs e)
{splitfilesize4 = TextBox5.Text;
for (int i4 = 0; i4 < splitfilesize4.Length; i4++)
{char c4 = splitfilesize4[i4];
string binar4 = Convert.ToString(c4, 2);
binary5 = binary5 + binar4;}
binary1enc4 = cr.Encrypt(binary5);
Label8.Text = binary5;
System.Threading.Thread.Sleep(1000);
Label29.Visible = true;
Label29.Text = "Block5 Sent";}
protected void TextBox6_TextChanged(object sender, EventArgs e)
{splitfilesize5 = TextBox6.Text;
for (int i5 = 0; i5 < splitfilesize5.Length; i5++)
{char c5 = splitfilesize5[i5];
string binar5 = Convert.ToString(c5, 2);
binary6 = binary6 + binar5;}
binary1enc5 = cr.Encrypt(binary6);
Label9.Text = binary6;
System.Threading.Thread.Sleep(1000);
Label30.Visible = true;
Label30.Text = "Block6 Sent";
//System.Threading.Thread.Sleep(1000);
//string myStringVariable3 = string.Empty;
//myStringVariable3 = "Second part is Completed.Currently " + addsplit + " bytes are sent
successfully. ";
//ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable3
+ "');", true);}
protected void TextBox7_TextChanged(object sender, EventArgs e)
{splitfilesize6 = TextBox7.Text;
for (int i6 = 0; i6 < splitfilesize6.Length; i6++)
{char c6 = splitfilesize6[i6];
string binar6 = Convert.ToString(c6, 2);
binary7 = binary7 + binar6;}
binary1enc6 = cr.Encrypt(binary7);
Label10.Text = binary7;
System.Threading.Thread.Sleep(1000);
Label31.Visible = true; Label31.Text = "Block7 Sent";}
protected void TextBox8_TextChanged(object sender, EventArgs e)
{splitfilesize7 = TextBox8.Text;
for (int i7 = 0; i7 < splitfilesize7.Length; i7++)
{char c7 = splitfilesize7[i7];
string binar7 = Convert.ToString(c7, 2);
binary8 = binary8 + binar7;}
binary1enc7 = cr.Encrypt(binary8); Label11.Text = binary8;
System.Threading.Thread.Sleep(1000);
Label32.Visible = true; Label32.Text = "Block8 Sent";}
protected void TextBox9_TextChanged(object sender, EventArgs e)
{splitfilesize8 = TextBox9.Text;
for (int i8 = 0; i8 < splitfilesize8.Length; i8++)
{char c8 = splitfilesize8[i8];
string binar8 = Convert.ToString(c8, 2);
binary9 = binary9 + binar8;} binary1enc8 = cr.Encrypt(binary9);
Label12.Text = binary9;
System.Threading.Thread.Sleep(1000);
Label33.Visible = true; Label33.Text = "Block9 Sent";
System.Threading.Thread.Sleep(1000);
MsgBox.Show("File Sent to Server with Metadata key & Alert Sent to TPA ");update();
//string myStringVariable3 = string.Empty;
//myStringVariable3 = "File Sent to Server with Metadata key \n Alert Sent to TPA";
//ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable3
+ "');", true);}}
RolesLogin.aspx
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class Roleslogin : System.Web.UI.Page
{ string upid, uppwd;
protected void Button1_Click(object sender, EventArgs e)
{
upid = TextBox1.Text.ToUpper();
uppwd = TextBox2.Text.ToUpper();
if (TextBox1.Text == "")
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Roles ID";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}
else
{
if (TextBox2.Text == "")
{string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Roles Password";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);}
else
{
if (upid == "ROLES" && uppwd == "ROLES")
{Response.Redirect("tpaverify.aspx");}
else
{
string myStringVariable1 = string.Empty;
myStringVariable1 = "Enter Roles ID/Password Correcly.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable1 +
"');", true);
}}}}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
}}
RolesUserAccountAuditor.aspx
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class RolesUseraccountauditor : System.Web.UI.Page
{SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{try
{if (!IsPostBack){Label24.Visible = false;
SqlDataAdapter adp = new SqlDataAdapter("Select ownerid from Registration", con);
DataSet ds = new DataSet();adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{DropDownList1.Items.Add(ds.Tables[0].Rows[i]["ownerid"].ToString());}}}
catch (Exception ex)
{MsgBox.Show("Time Out");}}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{if (DropDownList1.SelectedItem.Text == "--Select--")
{Panel2.Visible = false;}else{
Panel2.Visible = true;
SqlDataAdapter adp = new SqlDataAdapter("Select * from Registration where ownerid='" +
DropDownList1.SelectedItem.Text + "'", con);
DataSet ds = new DataSet();adp.Fill(ds);
Label5.Text = ds.Tables[0].Rows[0]["oid"].ToString();
Label8.Text = ds.Tables[0].Rows[0]["ownerid"].ToString();
Label11.Text = ds.Tables[0].Rows[0]["gender"].ToString();
Label14.Text = ds.Tables[0].Rows[0]["age"].ToString();
Label17.Text = ds.Tables[0].Rows[0]["mobile"].ToString();
Label20.Text = ds.Tables[0].Rows[0]["emailid"].ToString();
Label23.Text = ds.Tables[0].Rows[0]["date"].ToString();
Label27.Text = ds.Tables[0].Rows[0]["RolesAuditor"].ToString();}}
protected void LinkButton7_Click(object sender, EventArgs e)
{con.Open();
SqlCommand bla = new SqlCommand("Update Registration set RolesAuditor='Roles Auditor
Successfully' where oid='" + Label5.Text + "'", con);
bla.ExecuteNonQuery();
Label24.Visible = true;
Label24.Text = "Hi "+Label8.Text+ " Roles Auditor Successfully";
con.Close();}}
ServerVerify.aspx
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class serververify : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where tpaview
='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{
GridView1.DataSource = ds1;
GridView1.DataBind();
}
else
{
MsgBox.Show("No Request Found");
}}
public void bindgrid()
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where tpaview
='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
else
{MsgBox.Show("No Request Found");}}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
bindgrid();
}}
TpaVerify.aspx
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class tpaverify : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where tpaview!
='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
else
{MsgBox.Show("No Request Found");}}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{GridView1.PageIndex = e.NewPageIndex;
bindgrid();
update();}
public void bindgrid()
{SqlDataAdapter adp1 = new SqlDataAdapter("Select * from filearchive where tpaview!
='View'", con);
DataSet ds1 = new DataSet();
adp1.Fill(ds1);
if (ds1.Tables[0].Rows.Count > 0)
{GridView1.DataSource = ds1;
GridView1.DataBind();}
else
{MsgBox.Show("No Request Found");}}
public void update()
{SqlCommand cmd = new SqlCommand("update filearchieve set keystatus='sent' where
tpaview!=view", con);
cmd.ExecuteNonQuery();
con.Close();
}}
UserttoRolesauditor.aspx
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Diagnostics;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Data.SqlClient;
public partial class UserttoRolesauditor : System.Web.UI.Page
{
SqlConnection con = new
SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
string ownerid;
protected void Page_Load(object sender, EventArgs e)
{
try{
if (!IsPostBack)
{
ownerid = (string)Session["ownerid"];
SqlDataAdapter sda = new SqlDataAdapter("select * from Registration where ownerid ='" +
ownerid + "'", con);
DataSet ds = new DataSet();
sda.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}}
catch (Exception ex)
{
MsgBox.Show("Time out");
}}
protected void LinkButton2_Click(object sender, EventArgs e)
{Response.Redirect("OwnerFileUpload.aspx");}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("packetsending.aspx");
}}