实际上,我想从一个文件中读取并转换读取的数据,然后将其写入另一个文件中 [英] Infact I want to read from one file and convert data read and after it i write it in another file

查看:49
本文介绍了实际上,我想从一个文件中读取并转换读取的数据,然后将其写入另一个文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此代码:

I have this code:

FileInfo theSourceFile = new FileInfo(@"C:\WindowsFormsApplication1.txt");
StreamWriter str1 = new StreamWriter(@"C:\WindowsFormsApplication2.txt", false);
StreamReader stream = theSourceFile.OpenText();
string sline;
while ((sline = stream.ReadLine()) != null)
{
    string hex = "";
    foreach (char c in sline)
    {
        int tmp = c;
        hex += String.Format("{0:x2}", (uint)System.Convert.ToUInt32(tmp.ToString()));
    }

    str1.WriteLine(hex);
    str1.Close();

}
stream.Close();


实际上,我想从一个文件读取并转换读取的数据,然后将其写入另一个文件中
是错误是vshost.exe


Infact I want to read from one file and convert data read and after it i write it in another file
is error is vshost.exe

推荐答案

在这里查看我的答案
See my answer here I want read from the file and write line by line it in another file.[^]


这篇关于实际上,我想从一个文件中读取并转换读取的数据,然后将其写入另一个文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆