You are on page 1of 52

A Efficient Dynamic aware Public Auditing for Cloud Data storage with Fair

Arbitration

CHAPTER 1

INTRODUCTION

1.1 Introduction

cloud computing makes storage outsourcing become a rising trend, which promotes the
secure remote data auditing a hot topic that appeared in the research literature. Recently some
research consider the problemof secure and efficient public data integrity auditing for shared
dynamic dataStatic and dynamic proof of storage schemes have been proposed for use in secure
cloud storage scenarios. In this setting, a client outsources storage of her data to a server, who may,
willingly or not, corrupt the data (e.g., due to hardware or software failures), or delete infrequently
accessed parts to save space. Most of the existing schemes only solve part of this problem: The
client may ask for a cryptographic proof of integrity from the server. But what happens if this proof
fails to verify? We argue that in such a case, both the client and the server should be able to contact
an official court, providing cryptographic proofs, so that the Judge can resolve this dispute. We
show that this property is stronger than what has been known as public verifiability in the sense
that official arbitration should handle a malicious client as well. We clearly show this formalization
difference, and then present multiple schemes that work for various static and dynamic storage
solutions in a generic way. We implement our schemes and show that they are very efficient,
diminishing the validity of arguments against their use, where the overhead for adding the ability
to resolve such disputes at a court is only 2 ms and 80 bytes for each update on the stored data,
using standard desktop hardware. Finally, we note that disputes may arise in many other situations,
such as when two parties exchange items (e.g., e-commerce) or agree on something (e.g., contract-
signing). We show that it is easy to extend our official arbitration protocols for a general case,
including dynamic authenticated data structures Efficient secure cloud storage protocols have been
proposed since 2007, starting with provable data possession (PDP) work of Ateniese et al. and
proof of retrievability work of Juels and Kaliski followed by many others In these scenarios, the
client outsources storage of her files to a server (e.g., Dropbox, Amazon S3, Google Drive,
Microsoft Skydrive), but does not necessarily fully trust the server. In particular, the client would
like to have some warranty over the integrity of her files. To achieve this, the client stores some
metadata M , and may later challenge the server on some random subset of blocks of her data, and
obtain a cryptographic proof of integrity in return. If this proof verifies against the client’s
metadata, with high probability, the client’s whole data is intact, and thus the client may rest in
peace. 1 The problem begins when the server’s proof fails to verify. In this case, ideally, the client
and the server should be able to resolve their dispute at a court. By obtaining cryptographic
evidence from both parties, the Judge should be able to rule the correct decision. Previously, a
related property named public verifiability has been proposed. Unfortunately, we show that public
verifiability is not enough for the Judge to rule, by showing that a dishonest client may frame an
honest server in the publicly-verifiable version of PDP (see Section 3). The main reason is that,
public verifiability property was intended to enable third parties to perform verification, whereas
in our model, the client is assumed to be potentially malicious, since there are potential monetary
gains behind framing an honest server. For example, Amazon may offer a warranty in case of data
loss, and a malicious client may want to obtain this warranty nevertheless. Note that such a new
business model for cloud storage with warranty is desirable, since it may bring enterprise
customers. Thus, we formalize official arbitration different from public verifiability to ensure that
the resulting protocol can be used by the Judge officially. Next, we observe that there is a generic
and easy solution for this issue in the static setting. In a static setting, the client’s data does not
change over time (even by the client herself). The basic idea is to obtain the server’s signature on
the metadata M once when the file is uploaded. At this time, if the server’s signature fails to verify,
the client may assume that her files are not backed up. If the signature verifies, and later some
dispute occurs, the client can present this metadata M , together with the server’s signature on it,
to the Judge. At this point, through the use of secure cloud storage proofs (i.e., the server’s proof
that the file is intact), the Judge can arbitrate between the client and the server
The development of cloud computing motivates enterprises and organizations to outsource
their datato third-party cloud service providers (CSPs), which will improve the storage limitation
of resource constrain local devices. Recently, some commercial cloud storage services, such as the
simple storage service (S3) on-line data backup services of Amazon and some practical cloud
based software Google Drive , Dropbox , Mozy Bitcasa and Memopal [6], have been built for
cloud application. Since the cloud servers may return an invalid result in some cases, such as server
hardware/software failure, human maintenance and malicious attack [7], new forms of assurance
of data integrity and accessibility are required to protect the security and privacy of cloud..

1.2 Cloud Data:

Cloud Computing has been envisioned as the next generation information technology (IT)
architecture for enterprises, due to its long list of unprecedented advantages in the IT history: on-
demand self-service, ubiquitous network access, location independent resource pooling, rapid
resource elasticity, usage-based pricing and transference of risk As a disruptive technology with
profound implications, Cloud Computing is transforming the very nature of how businesses use
information technology. One fundamental aspect of this paradigm shifting is that data is being
centralized or outsourced to the Cloud. From users’ perspective, including both individuals and IT
enterprises, storing data remotely to the cloud in a flexible on-demand manner brings appealing
benefits: relief of the burden for storage management, universal data access with location
independence, and avoidance of capital expenditure on hardware, software, and personnel
maintenances, etc . While Cloud Computing makes these advantages more appealing than ever, it
also brings new and challenging security threats towards users’ outsourced data.
Since cloud service providers (CSP) are separate administrative entities, data outsourcing is
actually relinquishing user’s ultimate control over the fate of their data. As a result, the correctness
of the data in the cloud is being put at risk due to the following reasons. First of all, although the
infrastructures under the cloud are much more powerful and reliable than personal computing
devices, they are still facing the broad range of both internal and external threats for data integrity
. Examples of outages and security breaches of noteworthy cloud services appear from time to
time Secondly, there do exist various motivations for CSP to behave unfaithfully towards the cloud
users regarding their outsourced data status. For examples, CSP might reclaim storage for
monetary reasons by discarding data that has not been or is rarely accessed, or even hide data loss
incidents to maintain a reputation In short, although outsourcing data to the cloud is economically
attractive for long-term large-scale storage, it does not immediately offer any guarantee on data
integrity and availability. This problem, if not properly addressed, may impede the success of cloud
architecture
ABSTRACT:

Cloud users no longer physically possess their data, so how to ensure the integrity of their
outsourced data becomes a challenging task. Recently proposed schemes such as “provable data
possession” and “proofs of retrievability” are designed to address this problem, but they are
designed to audit static archive data and therefore lack of data dynamics support. Moreover, threat
models in these schemes usually assume an honest data owner and focus on detecting a dishonest
cloud service provider despite the fact that clients may also misbehave. This paper proposes a
public auditing scheme with data dynamics support and fairness arbitration of potential disputes.
In particular, we design an index switcher to eliminate the limitation of index usage in tag
computation in current schemes and achieve efficient handling of data dynamics. To address the
fairness problem so that no party can misbehave without being detected, we further extend existing
threat models and adopt signature exchange idea to design fair arbitration protocols, so that any
possible dispute can be fairly settled. The security analysis shows our scheme is provably secure,
and the performance evaluation demonstrates the overhead of data dynamics and dispute
arbitration are reasonable.

CHAPTER 2

LITERATURE REVIEW
1. A Review of Secure Authorized data Arbiration with Encrypted Data for Cloud Storage

Bhavanashri Shivaji Raut, Prof. H. A. Hingoliwala

Cloud Storage System are becoming increasingly popular with the continuous and
exponential Increase of the number of users and the size of data. Data deduplication becomes more
and more a necessity for cloud storage providers. Data deduplication is one of the important data
compression technique for eliminating duplicate copies of repeating data . It has been widely used
in the cloud storage to reduce the amount of storage space and save bandwidth. The advantage of
deduplication unfortunately come with high cost in terms of new security and privacy challenges
.The proposed scheme in this paper not only the reduces the cloud storage capacity but also
improves the speed of data deduplication. To protect confident

2. Control Framework for Secure Cloud Computing

Harshit Srivastava1, Sathish Alampalayam Kumar

The Information Technology (IT) industry, which is going to impact the businesses of any size
and yet the security issue continues to pose a big threat on it. The security and privacy issues
persisting in cloud computing have proved to be an obstacle for its widespread adoption. In this
paper, we look at these issues from a business perspective and how they are damaging the
reputation of big companies. There is a literature review on the existing issues in cloud computing
and how they are being tackled by the Cloud Service Providers (CSP). We propose a governing
body framework which aims at solving these issues by establishing relationship amongst the CSPs
in which the data about possible threats can be generated based on the previous attacks on other
CSPs. The Governing Body will be responsible for Data Center control, Policy control, legal
control, user awareness, performance evaluation, solution architecture and providing motivation
for the entities involved.
The literature also differentiates cloud computing offerings by scope. In private clouds; services
are provided exclusively to trusted users via a single-tenant operating environment. Essentially, an
organization’s data centre delivers cloud computing services to clients who may or may not be in
the premises . Public clouds are the opposite: services are offered to individuals and organizations
who want to retain elasticity and accountability without absorbing the full costs of in-house
infrastructures. Public cloud users are by default treated as untrustworthy. There are also hybrid
clouds combining both private and public cloud service offerings

3.Ashish Bhagat Ravi Kant Sahu

Cloud data security is a major concern for the client while using the cloud services provided by
the service provider. There can be some security issues and conflicts between the client and the
service provider. To resolve those issues, a third party can be used as an auditor. In this paper, we
have analysed various mechanisms to ensure reliable data storage using cloud services. It mainly
focuses on the way of providing computing resources in form of service rather than a product and
utilities are provided to users over internet. The cloud is a platform where data owner remotely
store their data in cloud. The main goal of cloud computing concept is to secure and protect the
data which come under the property of users. The security of cloud computing environment is
exclusive research area which requires further development from both academic and research
communities. In the corporate world there are a huge number of clients which is accessing the data
and modifying the data. In the cloud, application and services move to centralized huge data center
and services and management of this data may not be trustworthy, into cloud environment the
computing resources are under control of service provider and the third-party-auditor ensures the
data integrity over out sourced data. Third-partyauditor not only read but also may be change the
data. Therefore a mechanism should be provided to solve the problem. We examine the problem
contradiction between client and CSP, new potential security scheme used to solve problem. The
purpose of this paper is to bring greater clarity landscape about cloud data security and their
solution at user level using encryption algorithms which ensure the data owner and client that their
data are intact.
4. Yunchuan Sun, Junsheng Zhang, Yongping Xiong, and Guangyu Zhu stated that

Data security has consistently been a major issue in information technology. In the cloud
computing environment, it becomes particularly serious because the data is located in different
places even in all the globe. Data security and privacy protection are the two main factors of user’s
concerns about the cloud technology. Though many techniques on the topics in cloud computing
have been investigated in both academics and industries, data security and privacy protection are
becoming more important for the future development of cloud computing technology in
government, industry, and business. Data security and privacy protection issues are relevant to
both hardware and software in the cloud architecture.

This study is to review different security techniques and challenges from both software and
hardware aspects for protecting data in the cloud and aims at enhancing the data security and
privacy protection for the trustworthy cloud environment. In this paper, we make a comparative
research analysis of the existing research work regarding the data security and privacy protection
techniques used in the cloud computing.

5. K. Ren, C. Wang, and Q. Wang, “Security Challenges for the Public Cloud review that

Cloud Service Providers (CSP). We propose a governing body framework which aims at
solving these issues by establishing relationship amongst the CSPs in which the data about possible
threats can be generated based on the previous attacks on other CSPs. The Governing Body will
be responsible for Data Center control, Policy control, legal control, user awareness, performance
evaluation, solution architecture and providing motivation for the entities involved.

6. Takabi. H, Joshi.J.B.D and Ahn.G Cloud Data Storage SecurityUsing Arbiraton


Technique stated

Data partitioning function is used to make the storage easy in cloud. Partitioning happens
alphabetical order by using index method. It retrieves first two letters and checks it in folder with
present having same letter. If it is not present then creates a folder and store the file in that folder
.The partitioned files are encrypted, that is encoded with the public key and stored in cloud.
Partitioning takes place automatically when the data is fed for storing in cloud. Original file is also
reconstructed when there is need to access the same.

7. Douglas Gourlay

"People are coming to grips with Virtualization and how it reshapes IT, creates service and
software based models, and in many ways changes a lot of the physical layer we are used to. Clouds
will be the next transformation over the next several years, building off of the software models
that virtualization enabled."

8. Bill Martin

"Cloud computing really comes into focus only when you think about what IT always needs: a
way to increase capacity or add capabilities on the fly without investing in new infrastructure,
training new personnel, or licensing new software. Cloud computing encompasses any
subscription-based or pay-per-use service that, in real time over the Internet, extends its existing
capabilities.

9. National Institute of Standards and Technology (NIST):

Cloud computing is a model for enabling convenient, on-demand network access to a shared pool
of configurable computing resources (e.g., networks, servers, storage, applications, and services)
that can be rapidly provisioned and released with minimal management effort or service provider
interaction

10: Ben Kepes

"I view cloud computing as a broad array of web-based services aimed at allowing users to obtain
a wide range of functional capabilities on a ‘pay-as-you-go’ basis that previously required
tremendous hardware/software investments and professional skills to acquire. Cloud computing is
the realization of the earlier ideals of utility computing without the technical complexities or
complicated deployment worries."
CHAPTER 4

EXISTING SYSTEM:
 First of all, earlier auditing schemes usually require the CSP to generate a deterministic proof by
accessing the whole data file to perform integrity check.
 Secondly, some auditing schemes provide private verifiability that require only the data owner
who has the private key to perform the auditing task, which may potentially overburden the owner
due to its limited computation capability.
 Thirdly, PDP and PoR intend to audit static data that are seldom updated, so these schemes do not
provide data dynamics support. But from a general perspective, data update is a very common
requirement for cloud applications.

DISADVANTAGES OF EXISTING SYSTEM:

 Providing data dynamics support is the most challenging. This is because most existing auditing
schemes intend to embed a block’s index i into its tag computation, which serves to authenticate
challenged blocks. However, if we insert or delete a block, block indices of all subsequent blocks
will change, then tags of these blocks have to be re-computed. This is unacceptable because of its
high computation overhead.
 Current research usually assumes an honest data owner in their security models, which has an
inborn inclination toward cloud users. However, the fact is, not only the cloud, but also cloud
users, have the motive to engage in deceitful behaviors.
 In Existing System no integrity auditing scheme with public verifiability, efficient data dynamics
and fair disputes arbitration.
 Existing system has the limitation of index usage in tag computation
 In Existing System tag re-computation caused by block update operations
 In Existing System both clients and the CSP potentially may misbehave during auditing and data
update

PROPOSED SYSTEM:

 We address this problem by differentiating between tag index (used for tag computation) and block
index (indicate block position), and rely an index switcher to keep a mapping between them. Upon
each update operation, we allocate a new tag index for the operating block and update the mapping
between tag indices and block indices. Such a layer of indirection between block indices and tag
indices enforces block authentication and avoids tag re-computation of blocks after the operation
position simultaneously. As a result, the efficiency of handling data dynamics is greatly enhanced.
 Furthermore and important, in a public auditing scenario, a data owner always delegates his
auditing tasks to a TPA who is trusted by the owner but not necessarily by the cloud.
 Our work also adopts the idea of signature exchange to ensure the metadata correctness and
protocol fairness, and we concentrate on combining efficient data dynamics support and fair
dispute arbitration into a single auditing scheme.
 To address the fairness problem in auditing, we introduce a third-party arbitrator(TPAR) into our
threat model, which is a professional institute for conflicts arbitration and is trusted and payed by
both data owners and the CSP. Since a TPA can be viewed as a delegator of the data owner and is
not necessarily trusted by the CSP, we differentiate between the roles of auditor and arbitrator.
Moreover, we adopt the idea of signature exchange to ensure metadata correctness and provide
dispute arbitration, where any conflict about auditing or data update can be fairly arbitrated.
 Generally, this paper proposes a new auditing scheme to address the problems of data dynamics
support, public verifiability and dispute arbitration simultaneously.

ADVANTAGES OF PROPOSED SYSTEM:

 The proposed system solves the data dynamics problem in auditing by introducing an index
switcher to keep a mapping between block indices and tag indices, and eliminate the passive effect
of block indices in tag computation without incurring much overhead.
 The proposed system extend the threat model in current research to provide dispute arbitration,
which is of great significance and practicality for cloud data auditing, since most existing schemes
generally assume an honest data owner in their threat models.
 The proposed system provides fairness guarantee and dispute arbitration in our scheme, which
ensures that both the data owner and the cloud cannot misbehave in the auditing process or else it
is easy for a third-party arbitrator to find out the cheating part

Algorithm:
Proof verification algorithm:
Verification proof algorithm is one aspect of testing a product's fitness for purpose.
Validation is the complementary aspect. Often one refers to the overall checking process.
Proof verification algorithm for any valid input it produces the result required
by the algorithm’s specification.
Asymmetric signature algorithm:
Asymmetric algorithms use different keys for encryption and decryption, and the
decryption key cannot be derived from the encryption key. Asymmetric algorithms are important
because they can be used for transmitting encryption keys or other data securely even when the
parties have no opportunity to agree on a secret key in private.
Attacks:
Network Attack:
A network attack can be defined as any method, process, or means used to maliciously
attempt to compromise network security
The individuals performing network attacks are commonly referred to as network attackers,
hackers, or crackers.

MODULE DESCRIPTION

MODULE

MODULE DESCRIPTION

1. CLIENT MODULE
In this module, a client makes use of provider’s
resources to store, retrieve and share data with multiple users. A client can be either
an individual or an enterprise. Client can check the uploaded file he can neglate or
upload the file Client can view the deduplicate file based on this client can delete
the unwanted datas.
2. CSP MODULE:
In this module csp can view all the user details, client
uploads details, clients details And clients activities regarding the A Secure Client
Side Deduplication Scheme in Cloud Storage Environments

3. Data Upload and validation:

To efficiently upload an encrypted data with cloud. A semi-trusted proxy can transform an
encryption of a message to another encryption of the same message without knowing the message.
To user upload our files for our selected location of the database.Every user can be upload their
data are Encrypted format to store the database.Then user want to use the file download and view
our file for Decrypted format using secret keys.

The shared data are signed by a group of users. Therefore, disputes between the two parties are
unavoidable to a certain degree. So an arbitrator for dispute settlement is indispensable for a fair
auditing scheme. We extend the threat model in existing public schemes by differentiating between
the auditor (TPAU) and the arbitrator (TPAR) and putting different trust assumptions on them.
Because the TPAU is mainly a delegated party to check client’s data integrity, and the potential
dispute may occur between the TPAU and the CSP, so the arbitrator should be an unbiased third
party who is different to the TPAU.

As for the TPAR, we consider it honest-but-curious. It will behave honestly most of the time but
it is also curious about the content of the auditing data, thus the privacy protection of the auditing
data should be considered. Note that, while privacy protection is beyond the scope of this paper,
our scheme can adopt the random mask technique proposed for privacy preservation of auditing
data, or the ring signatures in to protect the identityprivacy of signers for data shared among a
group of users.

4. Data Arbitration:
The shared data are signed by a group of users. Therefore, disputes between the two parties are
unavoidable to a certain degree. So an arbitrator for dispute settlement is indispensable for a fair
auditing scheme. We extend the threat model in existing public schemes by differentiating between
the auditor (TPAU) and the arbitrator (TPAR) and putting different trust assumptions on them.
Because the TPAU is mainly a delegated party to check client’s data integrity, and the potential
dispute may occur between the TPAU and the CSP, so the arbitrator should be an unbiased third
party who is different to the TPAU.

As for the TPAR, we consider it honest-but-curious. It will behave honestly most of the time but
it is also curious about the content of the auditing data, thus the privacy protection of the auditing
data should be considered. Note that, while privacy protection is beyond the scope of this paper,
our scheme can adopt the random mask technique proposed for privacy preservation of auditing
data, or the ring signatures in to protect the identityprivacy of signers for data shared among a
group of users.

5. Auditing Cloud server:

Public auditing schemes mainly focus on the delegation of auditing tasks to a third party auditor
(TPA) so that the overhead on clients can be offloaded as much as possible. However, such models
have not seriously considered the fairness problem as they usually assume an honest owner against
an untrusted CSP. Since the TPA acts on behalf of the owner, then to what extent could the CSP
trust the auditing result? What if the owner and TPA collude together against an honest CSP for a
financial compensation. In this sense, such models reduce the practicality and applicability of
auditing schemes

6. Clustering Data:

Compared to these schemes, our work is the first to combine public verifiability, data
dynamics support and dispute arbitration simultaneously. Other extensions to both PDPs and PoRs.
Introduced a mechanism for data integrity auditing under the multiserver scenario, where data are
encoded with network code. Ensure data possession of multiple replicas across the distributed
storage scenario. They also integrate forward error-correcting codes into PDP to provide robust
data possession utilize the idea of proxy re-signatures to provide efficient user revocations, where
the shared data are signed by a group of users.

Archtecture:

CHAPTER 5

CONCLUSION AND FUTURE ENHANCEMENT


CHAPTER 5

CONCLUSION AND FUTURE ENHANCEMENT

5.1 Conclusion

we proposed a new public auditing mechanism for shared data with efficient user
revocation in the cloud When a user in the group is revoked, we allow the cloud to re-sign blocks that
were signed by the revoked user with proxy re-signatures. Experimental results show that the cloud can
improve the efficiency of user revocation, and existing users in the group can save a significant amount of
computation and communication resources during user revocation.

5.2 Future Work

In future we analyzed the cloud can even directly re-sign data without verification, which
further improve the efficiency of re-signing about 100 times allows a verifier to check the correctness of
a client’s data stored at an untrusted server. By utilizing RSAbased homomorphic authenticators and
sampling strategies, the verifier is able to publicly audit the integrity of data

APPENDIX

WORKING ENVIRONMENT

SYSTEM SPECIFICATION
Hardware Requirements:

• System : Pentium IV 2.4 GHz.


• Hard Disk : 40 GB.
• Monitor : 14’ Colour Monitor.
• Mouse : Optical Mouse.
• Ram : 512 Mb.

Software Requirements:

• Operating system : Windows 7.


• Coding Language : VB.net
• Data Base : SQL server
CODING:

NEW USER REGISTERATION:

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;
using System.IO;
using System.Net;
using System.Net.Mail;

public partial class Default5 : System.Web.UI.Page


{
SqlConnection con;
SqlCommand cmd1, cmd2, cmd3;
SqlDataReader dr1, dr2 ,dr3;

public void Page_Load(object sender, EventArgs e)


{
lblEmail.Visible = false;
lblpass.Visible = false;
lblSecurityKey.Visible = false;
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);

Auto();

}
protected void Button1_Click(object sender, EventArgs e)
{
SecurityKey();
cmd2 = new SqlCommand("spInsertData", new
SqlConnection(ConfigurationManager.ConnectionStrings["PANDA"].ToString()));

cmd2.CommandType = CommandType.StoredProcedure;
cmd2.Parameters.AddWithValue("@userid", txtUid.Text);
cmd2.Parameters.AddWithValue("@username", txtUserName.Text);
cmd2.Parameters.AddWithValue("@password", txtPassword.Text);
cmd2.Parameters.AddWithValue("@confirmpassword", txtConfirmPassword.Text);
cmd2.Parameters.AddWithValue("@to", txtTo.Text);
cmd2.Parameters.AddWithValue("@securityqus", ddlSecurityQus.SelectedItem.Text);
cmd2.Parameters.AddWithValue("@securityans", txtSecurityAns.Text);
cmd2.Parameters.AddWithValue("@securitykey", lblSecurityKey.Text);
cmd2.Parameters.AddWithValue("@mode",CheckBox1.Text);

cmd2.Connection.Open();
cmd2.ExecuteNonQuery();
cmd2.Connection.Close();
sendmail();

ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script


language='javascript'>alert('Registration success, Check Ur Email')</script>");

txtUid.Text = "";
txtUserName.Text = "";
txtPassword.Text = "";
txtConfirmPassword.Text = "";
txtTo.Text = "";
txtSecurityAns.Text = "";
lblSecurityKey.Text = "";

}
protected void Button2_Click1(object sender, EventArgs e)
{
txtUid.Text = "";
txtUserName.Text = "";
txtPassword.Text = "";
txtConfirmPassword.Text = "";
txtTo.Text = "";
txtSecurityAns.Text = "";
lblSecurityKey.Text = "";
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{

}
public void Auto()
{
con.Open();
int r;
cmd1 = new SqlCommand("Select max(Userid) from UserReg", con);
dr1 = cmd1.ExecuteReader();

if (dr1.Read())
{

string d = dr1[0].ToString();
if (d == "")
{

txtUid.Text = "1001";

}
else
{

r = Convert.ToInt32(dr1[0].ToString());
r = r + 1;
txtUid.Text = r.ToString();
}
}
con.Close();
}

public void SecurityKey()


{
string allowedChars = "";
allowedChars = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,";
allowedChars += "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,";
allowedChars += "1,2,3,4,5,6,7,8,9,0,!,@,#,$,%,&,?";

char[] sep = { ',' };

string[] arr = allowedChars.Split(sep);


string passwordString = "";

string temp = "";

Random rand = new Random();

for (int i = 0; i < 7; i++)


{
temp = arr[rand.Next(0, arr.Length)];
passwordString += temp;
}
lblSecurityKey.Text = passwordString;
}

public void sendmail()


{

using (MailMessage mm = new MailMessage(lblEmail.Text, txtTo.Text))


{
mm.Subject = "Security key";
mm.Body = lblSecurityKey.Text;
mm.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential NetworkCred = new NetworkCredential(lblEmail.Text, lblpass.Text);
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
smtp.Send(mm);
// ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Email sent.');", true);
}

}
protected void SendEmail(object sender, EventArgs e)
{

}
protected void txtEmail_TextChanged(object sender, EventArgs e)
{

}
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
{
CheckBox1.Text = "Active";
}
else
{
CheckBox1.Text = "Deactive";
}
}
}

USER LOGIN:

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 Default4 : System.Web.UI.Page


{
SqlConnection con;
SqlCommand cmd, cmd1, cmd2, cmd3;
SqlDataReader dr, dr1, dr2;

protected void Page_Load(object sender, EventArgs e)


{
BtnRenew.Visible = false;
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);
con.Open();

}
protected void Button1_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("select *from UserReg where Userid='" + txtuserid.Text + "' and
Mode='active'", con);
dr = cmd.ExecuteReader();
{
if (dr.Read())
{
cmd1 = new SqlCommand("SelectData", new
SqlConnection(ConfigurationManager.ConnectionStrings["PANDA"].ToString()));
cmd1.CommandType = CommandType.StoredProcedure;
cmd1.Parameters.AddWithValue("@userid", txtuserid.Text);
cmd1.Parameters.AddWithValue("@username", txtusername.Text);
cmd1.Parameters.AddWithValue("@password", txtpassword.Text);
cmd1.Parameters.AddWithValue("@securitykey", txtsecuritykey.Text);

cmd1.Connection.Open();

dr1 = cmd1.ExecuteReader();
int c = 1;
if (dr1.Read())
{

Response.Redirect("Default7.aspx?userid=" + dr[0].ToString(), false);

else
{
Response.Write("<script>window.alert('Access Denied')</script>");

Session["counter"] = Convert.ToInt32(Session["counter"]) + c;
if (Convert.ToInt32(Session["counter"]) > 2)
{
Label11.Text = "More Than 3 times Failed - User blocked! Please Renewal your
account";

deactive();
Button1.Enabled = false;
Session.Abandon();
BtnRenew.Visible = true;

}
}

dr1.Close();
cmd1.Dispose();
cmd1.Connection.Close();
}
else
{
Response.Write("<script>window.alert('Access Denied Ur Account Was
Inactive')</script>");
}
dr.Close();
cmd.Dispose();
cmd.Connection.Close();
}
}

protected void Button2_Click1(object sender, EventArgs e)


{
cmd2 = new SqlCommand("selectidname", new
SqlConnection(ConfigurationManager.ConnectionStrings["PANDA"].ToString()));

cmd2.CommandType = CommandType.StoredProcedure;
cmd2.Parameters.AddWithValue("@userid", txtuserid.Text);
cmd2.Parameters.AddWithValue("@username", txtusername.Text);
cmd2.Connection.Open();

dr2 = cmd2.ExecuteReader();
if (dr2.Read())
{

Response.Redirect("Default9.aspx?userid=" + dr2[0].ToString(), false);


}
dr2.Close();
cmd2.Dispose();
cmd2.Connection.Close();

}
protected void LinkButton2_Click(object sender, EventArgs e)
{

}
public void deactive()
{
cmd.Dispose();
cmd1.Dispose();

dr.Close();
dr1.Close();
cmd3 = new SqlCommand("update UserReg set Mode='deactive' where Userid='" +
txtuserid.Text + "'", con);
cmd3.ExecuteNonQuery();
cmd3.Dispose();
}
}

RENEWEL USER ACCOUNT :

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 Default9 : System.Web.UI.Page


{
SqlConnection con;
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);
con.Open();
if (!IsPostBack)
{
txtUid.Text = Request.QueryString["userid"];
txtUserName.Text = Request.QueryString["username"];
}
}
protected void Button1_Click(object sender, EventArgs e)
{

cmd = new SqlCommand("update UserReg set Mode='active' where Userid='" +txtUid.Text


+ "'", con);
cmd.ExecuteNonQuery();
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script
language='javascript'>alert('Renewal success')</script>");

txtUid.Text = "";
txtUserName.Text = "";
txtPassword.Text = "";

txtTo.Text = "";
txtSecurityAns.Text = "";
lblSecurityKey.Text = "";
}
protected void Button2_Click1(object sender, EventArgs e)
{
txtUid.Text = "";
txtUserName.Text = "";
txtPassword.Text = "";

txtTo.Text = "";
txtSecurityAns.Text = "";
lblSecurityKey.Text = "";
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{

}
}

UPLOAD FILE:
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.Data.SqlClient;
using System.Configuration;
using System.IO;

public partial class Default7 : System.Web.UI.Page


{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;

protected void Page_Load(object sender, EventArgs e)


{
if (!IsPostBack)
{
txtuserid.Text = Request.QueryString["userid"];
}

String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);
Auto();

}
protected void Button1_Click(object sender, EventArgs e)
{
string filename = Path.GetFileName(FileUpload1.PostedFile.FileName);
FileUpload1.SaveAs(Server.MapPath("Files/" + filename));
con.Open();
SqlCommand cmd = new SqlCommand("insert into
FileInformation(Userid,Fileid,FileName,FileDesc,FilePath,Approved)
values(@Userid,@Fileid,@Name,@FileDesc,@Path,@Approved)", con);
cmd.Parameters.AddWithValue("@userid", txtuserid.Text);
cmd.Parameters.AddWithValue("@Fileid",txtfileid.Text);
cmd.Parameters.AddWithValue("@Name", filename);
cmd.Parameters.AddWithValue("@FileDesc", txtFileDescription.Text);
cmd.Parameters.AddWithValue("@Path", "Files/" + filename);
cmd.Parameters.AddWithValue("@Approved","False");
cmd.ExecuteNonQuery();
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script
language='javascript'>alert('Upload success')</script>");
con.Close();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{

}
public void Auto()
{
con.Open();
int r;
cmd = new SqlCommand("Select max(Fileid) from FileInformation", con);
dr = cmd.ExecuteReader();

if (dr.Read())
{

string d = dr[0].ToString();
if (d == "")
{
txtfileid.Text = "01";

}
else
{

r = Convert.ToInt32(dr[0].ToString());
r = r + 1;
txtfileid.Text = r.ToString();
}
}
con.Close();
}
}

DOWNLOAD STATUS:

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.Data.SqlClient;
using System.Configuration;
using System.IO;

public partial class Default6 : System.Web.UI.Page


{
SqlConnection con;
protected void Page_Load(object sender, EventArgs e)
{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);

if (!IsPostBack)
{
BindGridviewData();
}

}
private void BindGridviewData()
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from FileInformation where
Approved='False'", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvDetails.DataSource = ds;
gvDetails.DataBind();
}
protected void lnkDownload_Click(object sender, EventArgs e)
{
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = gvDetails.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "image/jpg";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath(filePath));
Response.End();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{

}
}

DOWNLOAD FILES:

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.Data.SqlClient;
using System.Configuration;
using System.IO;

public partial class Default6 : System.Web.UI.Page


{
SqlConnection con;
protected void Page_Load(object sender, EventArgs e)
{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);

if (!IsPostBack)
{
BindGridviewData();
}

}
private void BindGridviewData()
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from FileInformation where
Approved='False'", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvDetails.DataSource = ds;
gvDetails.DataBind();
}
protected void lnkDownload_Click(object sender, EventArgs e)
{
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = gvDetails.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "image/jpg";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath(filePath));
Response.End();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{

}
}

BLOCKED USER:

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.Data.SqlClient;
using System.Configuration;
using System.IO;

public partial class Default15 : System.Web.UI.Page


{
SqlConnection con;
protected void Page_Load(object sender, EventArgs e)
{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);

if (!IsPostBack)
{
BindGridviewData();
}

}
private void BindGridviewData()
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from UserReg where Mode='Deactive'",
con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvDetails.DataSource = ds;
gvDetails.DataBind();
}
}

AUDITOR LOGIN
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.Data.SqlClient;
using System.Configuration;

public partial class Default11 : System.Web.UI.Page


{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;

protected void Page_Load(object sender, EventArgs e)


{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);
con.Open();

}
protected void Button1_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("selectauditor", new
SqlConnection(ConfigurationManager.ConnectionStrings["PANDA"].ToString()));

cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.AddWithValue("@username", txtusername.Text);
cmd.Parameters.AddWithValue("@password", txtpassword.Text);
cmd.Connection.Open();

dr = cmd.ExecuteReader();
if (dr.Read())
{

Response.Redirect("Default12.aspx?userid=" + dr[0].ToString(), false);


}
cmd.Dispose();
cmd.Connection.Close();
}
protected void Button2_Click1(object sender, EventArgs e)
{

}
}

UPLOADED FILES:

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.Data.SqlClient;
using System.Configuration;
using System.IO;

public partial class Default13 : System.Web.UI.Page


{
SqlConnection con;
protected void Page_Load(object sender, EventArgs e)
{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);

if (!IsPostBack)
{
BindGridviewData();
}

}
private void BindGridviewData()
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from FileInformation", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvDetails.DataSource = ds;
gvDetails.DataBind();
}
protected void lnkDownload_Click(object sender, EventArgs e)
{
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = gvDetails.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "image/jpg";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath(filePath));
Response.End();
}
}

DOWNLOAD PEMISSION:

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.Data.SqlClient;
using System.Configuration;
using System.IO;

public partial class Default17 : System.Web.UI.Page


{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);
if (!IsPostBack)
{
BindGridviewData();
}

}
private void BindGridviewData()
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from FileInformation ", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvDetails.DataSource = ds;
gvDetails.DataBind();
}
protected void chk_Click(object sender, EventArgs e)
{
CheckBox chkbox = sender as CheckBox;
GridViewRow gvrow = chkbox.NamingContainer as GridViewRow;
if (chkbox.Checked == true)
{

}
protected void gvDetails_SelectedIndexChanged(object sender, EventArgs e)
{

}
public void chkStatus_OnCheckedChanged(object sender, EventArgs e)
{
CheckBox chkStatus = (CheckBox)sender;
GridViewRow row = (GridViewRow)chkStatus.NamingContainer;

string Uid = row.Cells[0].Text;


string Fid = row.Cells[1].Text;
string FileName = row.Cells[2].Text;
string FileDesc = row.Cells[3].Text;
string FilePath = row.Cells[4].Text;

string Approved = row.Cells[5].Text;


bool status = chkStatus.Checked;
string query = "UPDATE FileInformation SET Approved = @Approved WHERE Fileid =
@Fileid";

SqlCommand com = new SqlCommand(query, con);

com.Parameters.Add("@Approved", SqlDbType.Bit).Value = status;

com.Parameters.Add("@Userid", SqlDbType.Int).Value = Uid;


com.Parameters.Add("@Fileid", SqlDbType.VarChar).Value = Fid;
com.Parameters.Add("@FileName", SqlDbType.VarChar).Value = FileName;
com.Parameters.Add("@FileDesc", SqlDbType.VarChar).Value = FileDesc;

con.Open();
com.ExecuteNonQuery();
con.Close();

BindGridviewData();
}
}

USER DETAILS:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

public partial class Default18 : System.Web.UI.Page


{
SqlConnection con;
protected void Page_Load(object sender, EventArgs e)
{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);
if (!IsPostBack)
{
BindUserDetails();
}

}
protected void BindUserDetails()
{
con.Open();
SqlCommand cmd = new SqlCommand("Select * from UserReg", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
if (ds.Tables[0].Rows.Count > 0)
{
gvDetails.DataSource = ds;
gvDetails.DataBind();
}
else
{
ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
gvDetails.DataSource = ds;
gvDetails.DataBind();
int columncount = gvDetails.Rows[0].Cells.Count;
gvDetails.Rows[0].Cells.Clear();
gvDetails.Rows[0].Cells.Add(new TableCell());
gvDetails.Rows[0].Cells[0].ColumnSpan = columncount;
gvDetails.Rows[0].Cells[0].Text = "No Records Found";

}
}
protected void gvDetails_RowEditing(object sender, GridViewEditEventArgs e)
{
gvDetails.EditIndex = e.NewEditIndex;
BindUserDetails();
}
protected void gvDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

int Userid =
Convert.ToInt32(gvDetails.DataKeys[e.RowIndex].Values["Userid"].ToString());
TextBox txtUsername =
(TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtUsername");
TextBox txtPassword =
(TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtPassword");
TextBox txtEmail = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtEmail");
DropDownList ddlEditSecurityQuestion =
(DropDownList)gvDetails.Rows[e.RowIndex].FindControl("ddlEditSecurityQuestion");
TextBox txtSecurityAnswer =
(TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtSecurityAnswer");
TextBox txtSecurityKey =
(TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtSecurityKey");
DropDownList ddlEditMode =
(DropDownList)gvDetails.Rows[e.RowIndex].FindControl("ddlEditMode");
con.Open();
SqlCommand cmd = new SqlCommand("update UserReg set Username='" +
txtUsername.Text + "', Password='" + txtPassword.Text + "', Email ='" + txtEmail.Text + "',
SecurityQuestion='" + ddlEditSecurityQuestion.SelectedItem.ToString() + "', SecurityAnswer='"
+ txtSecurityAnswer.Text + "', SecurityKey='" + txtSecurityKey.Text + "', Mode='" +
ddlEditMode.SelectedItem.ToString() + "' where Userid=" + Userid + "", con);
cmd.ExecuteNonQuery();
con.Close();

lblresult.Text = Userid + " Details Updated successfully";


gvDetails.EditIndex = -1;
BindUserDetails();
}
protected void gvDetails_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
gvDetails.EditIndex = -1;
BindUserDetails();
}

protected void gvDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)


{
int Userid=
Convert.ToInt32(gvDetails.DataKeys[e.RowIndex].Values["Userid"].ToString());
con.Open();
SqlCommand cmd = new SqlCommand("delete from UserReg where Userid=" + Userid,
con);
int result = cmd.ExecuteNonQuery();
con.Close();
if (result == 1)
{
BindUserDetails();

lblresult.Text = Userid+ " details deleted successfully";


}
}
protected void gvDetails_RowDataBound(object sender, GridViewRowEventArgs e)
{

//if (e.Row.RowType == DataControlRowType.DataRow)


//{

// int pid = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "PID"));


// ImageButton lnkbtnresult = (ImageButton)e.Row.FindControl("imgbtnDelete");

// if (lnkbtnresult != null)
// {
public partial class Default17 : System.Web.UI.Page
{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);

if (!IsPostBack)
{
BindGridviewData();
}

}
private void BindGridviewData()
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from FileInformation ", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvDetails.DataSource = ds;
gvDetails.DataBind();
}
protected void chk_Click(object sender, EventArgs e)
{
CheckBox chkbox = sender as CheckBox;
GridViewRow gvrow = chkbox.NamingContainer as GridViewRow;
if (chkbox.Checked == true)
{
}

}
protected void gvDetails_SelectedIndexChanged(object sender, EventArgs e)
{

}
public void chkStatus_OnCheckedChanged(object sender, EventArgs e)
{
CheckBox chkStatus = (CheckBox)sender;
GridViewRow row = (GridViewRow)chkStatus.NamingContainer;

string Uid = row.Cells[0].Text;


string Fid = row.Cells[1].Text;
string FileName = row.Cells[2].Text;
string FileDesc = row.Cells[3].Text;
string FilePath = row.Cells[4].Text;

string Approved = row.Cells[5].Text;


bool status = chkStatus.Checked;

string query = "UPDATE FileInformation SET Approved = @Approved WHERE Fileid =


@Fileid";

SqlCommand com = new SqlCommand(query, con);

com.Parameters.Add("@Approved", SqlDbType.Bit).Value = status;

com.Parameters.Add("@Userid", SqlDbType.Int).Value = Uid;


com.Parameters.Add("@Fileid", SqlDbType.VarChar).Value = Fid;
com.Parameters.Add("@FileName", SqlDbType.VarChar).Value = FileName;
com.Parameters.Add("@FileDesc", SqlDbType.VarChar).Value = FileDesc;

con.Open();
com.ExecuteNonQuery();
con.Close();

BindGridviewData();
}
}

USER DETAILS:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

public partial class Default18 : System.Web.UI.Page


{
SqlConnection con;
protected void Page_Load(object sender, EventArgs e)
{
String connectionString =
ConfigurationManager.ConnectionStrings["PANDA"].ConnectionString;
con = new SqlConnection(connectionString);

if (!IsPostBack)
{
BindUserDetails();
}

}
protected void BindUserDetails()
{
con.Open();
SqlCommand cmd = new SqlCommand("Select * from UserReg", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
if (ds.Tables[0].Rows.Count > 0)
{
gvDetails.DataSource = ds;
gvDetails.DataBind();
}
else
{
ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
gvDetails.DataSource = ds;
gvDetails.DataBind();
int columncount = gvDetails.Rows[0].Cells.Count;
gvDetails.Rows[0].Cells.Clear();
gvDetails.Rows[0].Cells.Add(new TableCell());
gvDetails.Rows[0].Cells[0].ColumnSpan = columncount;
gvDetails.Rows[0].Cells[0].Text = "No Records Found";

}
}
protected void gvDetails_RowEditing(object sender, GridViewEditEventArgs e)
{
gvDetails.EditIndex = e.NewEditIndex;
BindUserDetails();
}
protected void gvDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

int Userid =
Convert.ToInt32(gvDetails.DataKeys[e.RowIndex].Values["Userid"].ToString());
TextBox txtUsername =
(TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtUsername");
TextBox txtPassword =
(TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtPassword");
TextBox txtEmail = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtEmail");
DropDownList ddlEditSecurityQuestion =
(DropDownList)gvDetails.Rows[e.RowIndex].FindControl("ddlEditSecurityQuestion");
TextBox txtSecurityAnswer =
(TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtSecurityAnswer");
TextBox txtSecurityKey =
(TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtSecurityKey");
DropDownList ddlEditMode =
(DropDownList)gvDetails.Rows[e.RowIndex].FindControl("ddlEditMode");
con.Open();
SqlCommand cmd = new SqlCommand("update UserReg set Username='" +
txtUsername.Text + "', Password='" + txtPassword.Text + "', Email ='" + txtEmail.Text + "',
SecurityQuestion='" + ddlEditSecurityQuestion.SelectedItem.ToString() + "', SecurityAnswer='"
+ txtSecurityAnswer.Text + "', SecurityKey='" + txtSecurityKey.Text + "', Mode='" +
ddlEditMode.SelectedItem.ToString() + "' where Userid=" + Userid + "", con);
cmd.ExecuteNonQuery();
con.Close();

lblresult.Text = Userid + " Details Updated successfully";


gvDetails.EditIndex = -1;
BindUserDetails();
}
protected void gvDetails_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
gvDetails.EditIndex = -1;
BindUserDetails();
}

protected void gvDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)


{
int Userid=
Convert.ToInt32(gvDetails.DataKeys[e.RowIndex].Values["Userid"].ToString());
con.Open();
SqlCommand cmd = new SqlCommand("delete from UserReg where Userid=" + Userid,
con);
int result = cmd.ExecuteNonQuery();
con.Close();
if (result == 1)
{
BindUserDetails();

lblresult.Text = Userid+ " details deleted successfully";


}
}
protected void gvDetails_RowDataBound(object sender, GridViewRowEventArgs e)
{

//if (e.Row.RowType == DataControlRowType.DataRow)


//{

// int pid = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "PID"));


// ImageButton lnkbtnresult = (ImageButton)e.Row.FindControl("imgbtnDelete");

// if (lnkbtnresult != null)
// {

// lnkbtnresult.Attributes.Add("onclick", "javascript:return ConfirmationBox('" + pid +


"')");
// }

//}
}
protected void gvDetails_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("AddNew"))
{
TextBox txtUserid1 = (TextBox)gvDetails.FooterRow.FindControl("txtUserid1");
TextBox txtUsername1 = (TextBox)gvDetails.FooterRow.FindControl("txtUsername1");
TextBox txtPassword1 = (TextBox)gvDetails.FooterRow.FindControl("txtPassword1");
TextBox txtEmail1 = (TextBox)gvDetails.Foo

Screen shot
REFERENCES

[1] M. Armbrust, A. Fox, R. Griffith, A. D. Joseph, R. H. Katz, A. Konwinski, G. Lee, D. A.


Patterson, A. Rabkin, I. Stoica, and M. Zaharia, “A View of Cloud Computing,” Communications
of the ACM, vol. 53, no. 4, pp. 50–58, Apirl 2010.

[2] G. Ateniese, R. Burns, R. Curtmola, J. Herring, L. Kissner, Z. Peterson, and D. Song, “Provable
Data Possession at Untrusted Stores,” in the Proceedings of ACM CCS 2007, 2007, pp. 598–610.

[3] H. Shacham and B. Waters, “Compact Proofs of Retrievability,” in the Proceedings of


ASIACRYPT 2008. Springer-Verlag, 2008, pp. 90–107.

[4] C. Wang, Q. Wang, K. Ren, and W. Lou, “Ensuring Data Storage Security in Cloud
Computing,” in the Proceedings of ACM/IEEE IWQoS 2009, 2009, pp. 1–9.

[5] Q. Wang, C. Wang, J. Li, K. Ren, and W. Lou, “Enabling Public Veri- fiability and Data
Dynamic for Storage Security in Cloud Computing,” in the Proceedings of ESORICS 2009.
Springer-Verlag, 2009, pp. 355– 370.

[6] C. Wang, Q. Wang, K. Ren, and W. Lou, “Privacy-Preserving Public Auditing for Data
Storage Security in Cloud Computing,” in the Proceedings of IEEE INFOCOM 2010, 2010, pp.
525–533.

[7] Y. Zhu, H. Wang, Z. Hu, G.-J. Ahn, H. Hu, and S. S. Yau, “Dynamic Audit Services for
Integrity Verification of Outsourced Storage in Clouds,” in the Proceedings of ACM SAC 2011,
2011, pp. 1550–1557.

[8] B. Wang, B. Li, and H. Li, “Oruta: Privacy-Preserving Public Auditing for Shared Data in the
Cloud,” in the Proceedings of IEEE Cloud 2012, 2012, pp. 295–302.

[9] N. Cao, S. Yu, Z. Yang, W. Lou, and Y. T. Hou, “LT Codes-based Secure and Reliable Cloud
Storage Service,” in the Proceedings of IEEE INFOCOM 2012, 2012, pp. 693–701.

[10] B. Wang, B. Li, and H. Li, “Knox: Privacy-Preserving Auditing for Shared Data with Large
Groups in the Cloud,” in the Proceedings of ACNS 2012, June 2012, pp. 507–525. [11] M. Blaze,
G. Bleumer, and M. Strauss, “

You might also like