Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- using System.Net;
- namespace IDFinder
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Search(String sCategory, String sKeyword)
- {
- if (sCategory == String.Empty)
- {
- MessageBox.Show("Please select a category first.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- else if (String.IsNullOrWhiteSpace(sKeyword))
- {
- MessageBox.Show("Please enter a keyword first.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- else
- {
- this.lvResultViewer.Items.Clear();
- StreamReader srDataFile = new StreamReader("C:\\vApps\\ID Finder\\" + sCategory + ".txt");
- String sLine;
- while ((sLine = srDataFile.ReadLine()) != null)
- {
- String[] sSplit = sLine.Split('|');
- if (sSplit[1].ToUpper().Contains(sKeyword.ToUpper()))
- {
- this.lvResultViewer.Items.Add(sSplit[0]);
- this.lvResultViewer.Items[this.lvResultViewer.Items.Count - 1].SubItems.Add(sSplit[1]);
- }
- }
- }
- }
- private void GetData()
- {
- WebClient wcDownload = new WebClient();
- wcDownload.DownloadFile(new Uri("http://db.tt/lvcIV19U"), "C:\\vApps\\ID Finder\\Cash.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/hHAAp69Z"), "C:\\vApps\\ID Finder\\Consume.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/9WrdZIdp"), "C:\\vApps\\ID Finder\\Equipment.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/7hXCJXfH"), "C:\\vApps\\ID Finder\\Etc.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/YS8UZ7BL"), "C:\\vApps\\ID Finder\\Maps.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/tknROFeX"), "C:\\vApps\\ID Finder\\Monsters.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/IrDsqc3Y"), "C:\\vApps\\ID Finder\\NPCs.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/YCyHeF7j"), "C:\\vApps\\ID Finder\\Pets.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/7W3vyeJg"), "C:\\vApps\\ID Finder\\Quests.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/A6b40jhU"), "C:\\vApps\\ID Finder\\Set-Up.txt");
- wcDownload.DownloadFile(new Uri("http://db.tt/kUmXIJxq"), "C:\\vApps\\ID Finder\\Skills.txt");
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- if (!Directory.Exists("C:\\vApps\\ID Finder"))
- Directory.CreateDirectory("C:\\vApps\\ID Finder");
- if (!Directory.EnumerateFileSystemEntries("C:\\vApps\\ID Finder").Any())
- GetData();
- }
- private void tbKeyword_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == Convert.ToChar(Keys.Enter))
- {
- Search(this.cbCategory.Text, this.tbKeyword.Text);
- }
- }
- private void bCopyID_Click(object sender, EventArgs e)
- {
- if (this.lvResultViewer.Items.Count != 0)
- Clipboard.SetDataObject(this.lvResultViewer.SelectedItems[0].Text);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement