using Microsoft.Office.Interop.Excel;
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
using System.Data;
using System.Linq;
using System.Threading;
using System.Diagnostics;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using WEIXIN.Properties;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System.Text.RegularExpressions;
string outdat= " ";
string datas = " ";
string[] outarry = new string[50];
string[] intdat = new string[50];
byte[] bytes;
OpenFileDialog exceldat = new OpenFileDialog();
exceldat.Filter = "Text File(*.txt)|*.txt";
if (exceldat.ShowDialog() != DialogResult.OK)
{
return;
}
string pathname = exceldat.FileName;
StreamReader sr = new StreamReader(pathname);
string strLine = sr.ReadLine();
string[] colors = Convert.ToString(strLine).Split(',');
try
{
if (colors.Length != 0)
{
for (int k = 0; k < colors.Length; k++)
{
outdat = colors[k].ToString();
for (int i = 0; i < colors[k].Length; i++)
{
bytes = Encoding.Default.GetBytes(outdat.Substring(i, 1));
if (bytes.Length == 2)
{
intdat[k] = intdat[k] + outdat.Substring(i, 1);
}
}
}
}
else
{
return;
}
}
catch (Exception E)
{
E.Source = "Error";
}