-
密码管理专家个人修改版源码下载
资源介绍
密码管理专家个人修改版源码。。
private void tsmiLoad_Click(object sender, EventArgs e)
{
this.Hide();
if (ofdKey.ShowDialog() == DialogResult.OK)
{
if (ofdKey.OpenFile() != null)
{
dsReadKey.ReadXml(@ofdKey.FileName);
foreach (DataRow readKeyRow in dsReadKey.Tables["UserKey"].Rows)
{
DataRow newRow = dsKey.Tables["UserKey"].NewRow();
newRow["Number"] = readKeyRow["Number"];
newRow["Title"] = readKeyRow["Title"];
newRow["NetAdd"] = readKeyRow["NetAdd"];
newRow["Key"] = readKeyRow["Key"];
newRow["Name"] = readKeyRow["Name"];
newRow["UpdateTime"] = readKeyRow["UpdateTime"];
dsKey.Tables["UserKey"].Rows.Add(newRow);
}
int number = dsKey.Tables["UserKey"].Rows.Count;
for (int i = 0; i < number; i++)
{
dsKey.Tables["UserKey"].Rows[i]["Number"] = i + 1;
}
//foreach (DataRow reRow in dsKey.Tables["UserKey"].Rows)
//{
// number++; //这里用foreach
// reRow["Number"] = number;
//}
dsKey.WriteXml("UserKey.xml");
}
Visible = true;
}
else
{
Visible = true;
}
}