Form1.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Filter_IP
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void btn_deal_Click(object sender, EventArgs e)
{
string[] array = GetIPAddresses(txt_content.Text);
string currentDirectory = Environment.CurrentDirectory;
if (cb_cf.Checked)
{
array = RemoveDuplicates(array);
}
string[] array2 = array;
foreach (string text in array2)
{
if (!cb_127.Checked || !(text == "127.0.0.1"))
{
lv_ip.Items.Add(text + " " + global::IPLocation.IPLocation.IPLocate(currentDirectory + "//data.dat", text));
}
}
}
private static string[] GetIPAddresses(string text)
{
string pattern = "\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b";
MatchCollection matchCollection = Regex.Matches(text, pattern);
string[] array = new string[matchCollection.Count];
for (int i = 0; i < matchCollection.Count; i++)
{
array[i] = matchCollection[i].Value;
}
return array;
}
private static string[] RemoveDuplicates(string[] array)
{
HashSet<string> hashSet = new HashSet<string>(array);
string[] array2 = new string[hashSet.Count];
后面还有 53 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
