主题:大姥救火呀
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace arrayfile
{
class Program
{
static void Main()
{
/////////////////此段程序为存储数组数据到文件。
byte[] m_Temp = new byte[] { 168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 86, 33, 22};
////////////////////////////////////////////////////////////////////
FileStream ft = new FileStream("d:\\11.txt", FileMode.OpenOrCreate );
StreamWriter st = new StreamWriter(ft);
int i = 0;
foreach (byte bt in m_Temp)
{
st.WriteLine((i++) +","+bt);
}
st.Flush();
// ft.Close();
//上面的程序执行后,在D盘找到文件用记事本打开后,查看保存的数据不全,不知为什么?
/////////////////////////////下面程序为读D盘1.txt文件到数组.
StreamReader sr=new StreamReader ("d:\\11.txt");
//string noshow=sr.ReadLine ();//读入一行
string []Want=new string [720];//接收数组
for(int j=0;j<720;j++)
{
string noshow = sr.ReadLine();//读入一行
string [] res=noshow.Split (',');//分割元素
string a;
a=res[1];
Want[j]=a;
}
}
//附件是C# cs文档。[em8][em8]
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace arrayfile
{
class Program
{
static void Main()
{
/////////////////此段程序为存储数组数据到文件。
byte[] m_Temp = new byte[] { 168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 88, 77, 11, 22, 33, 44, 55, 66,77,88,99,00,11,22,33,44,55,66,77,
168, 126, 83, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99, 86, 33, 22};
////////////////////////////////////////////////////////////////////
FileStream ft = new FileStream("d:\\11.txt", FileMode.OpenOrCreate );
StreamWriter st = new StreamWriter(ft);
int i = 0;
foreach (byte bt in m_Temp)
{
st.WriteLine((i++) +","+bt);
}
st.Flush();
// ft.Close();
//上面的程序执行后,在D盘找到文件用记事本打开后,查看保存的数据不全,不知为什么?
/////////////////////////////下面程序为读D盘1.txt文件到数组.
StreamReader sr=new StreamReader ("d:\\11.txt");
//string noshow=sr.ReadLine ();//读入一行
string []Want=new string [720];//接收数组
for(int j=0;j<720;j++)
{
string noshow = sr.ReadLine();//读入一行
string [] res=noshow.Split (',');//分割元素
string a;
a=res[1];
Want[j]=a;
}
}
//附件是C# cs文档。[em8][em8]