Skip to content

Commit

Permalink
增加前缀过滤
Browse files Browse the repository at this point in the history
  • Loading branch information
xuejiazhi committed Jan 20, 2024
1 parent 295ee58 commit 1a8a86d
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/etcdii/v17/.suo
Binary file not shown.
2 changes: 2 additions & 0 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,62 @@ private void set_All_item()
}
}
}

private void button3_Click(object sender, EventArgs e)
{
var filterStr = textBox6.Text.Trim();
var endStr = "";

if (httpclient.GLOBAL_CONNECT_STATUS == true)
{
if (filterStr != "")
{
try
{
listBox1.Items.Clear();
var filterArr = filterStr.ToCharArray();
for (int i = 0; i < filterArr.Length; i++)
{
if (i == filterArr.Length - 1)
{
var n = Encoding.ASCII.GetBytes(filterArr[i].ToString());
endStr += Convert.ToChar(n[0] + 1);
}
else
{
endStr += filterArr[i];
}
}
var filterKey = "{\"key\": \"" + util.base64Encode(filterStr) + "\",\"range_end\": \"" + util.base64Encode(endStr) + "\"}";
var filterList = httpclient.PostEtcdValue(Operate.AllKeys, filterKey);
EtcdKvRange etcdKvRange = JsonSerializer.Deserialize<EtcdKvRange>(filterList);
if (etcdKvRange.kvs!=null&& etcdKvRange.kvs.Length > 0)
{
foreach (var item in etcdKvRange.kvs)
{
listBox1.Items.Add(util.base64Decode(item.key));
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
else
{
set_All_item();
}
}
else
{
MessageBox.Show("No Connect");
}
}

private void textBox6_TextChanged(object sender, EventArgs e)
{

}
}
}
Binary file modified bin/Debug/etcdii.exe
Binary file not shown.
Binary file modified bin/Debug/etcdii.pdb
Binary file not shown.
Binary file modified obj/Debug/etcdii.csproj.GenerateResource.cache
Binary file not shown.
Binary file modified obj/Debug/etcdii.exe
Binary file not shown.
Binary file modified obj/Debug/etcdii.pdb
Binary file not shown.

0 comments on commit 1a8a86d

Please sign in to comment.