在C#中读取文件 [英] reading files in c#

查看:74
本文介绍了在C#中读取文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.我的文件有问题.
问题:我有多个.x文件.我需要读取选定的文件,并且该文件包含不同的方法,因为该方法只需要一个方法,而该方法应添加到另一个.x文件中.请任何人帮我.

hi to everyone.I have some problem with files.
problem:I have multiple .x files.I need to read selected file and that file containing different methods in that methods i need only one method and that method should be added into another .x file. please any one help me.

推荐答案

khareedusowjanya写道:
khareedusowjanya wrote:

我需要阅读选定的文件以及该文件中包含不同方法的文件,该方法只需要一个方法,并且该方法应添加到另一个.x文件中.

I need to read selected file and that file containing different methods in that methods i need only one method and that method should be added into another .x file.



恐怕这并不清楚您要做什么,或者.x文件格式可能有什么特殊之处.您可以尝试重新表达您的问题吗?



I am afraid this does not make it clear what you are trying to do, or what may be special about the format of .x files. Could you try and reword your question?


.x文件是动画文件.
我需要阅读该.x文件.
在那个.x文件中,我有不同的方法名称.
我只想读取该文件中的一种方法.
我正在读取的文件应存储在另一个.x文件中"

首先,除非您发布答案,否则不要发布答案.编辑您的信息以添加详细信息.

您是什么意思,它们包含方法"?无论哪种方式,您都需要了解.x文件格式的工作原理,无论如何.要读取文件,请使用File.ReadAllBytes,但是C#将为您提供文件内容,您需要编写代码来解释该文件并以对您有用的格式获取所需的信息.
".x files are animation files.
i need to read that .x files.
in that .x files i have different name of methods.
i want read only one method in that file.
what i am reading file should be stored in another .x file"

First of all, don''t post an answer unless you''re posting an answer. Edit your post to add details.

What do you mean, they contain ''methods'' ? Either way, to do this, you need to learn how the .x file format works, whatever that is. To read the file, use File.ReadAllBytes, but C# is going to give you the file contents, YOU need to write code to interpret that file and get the information you want in a format that is useful to you.


我只是用Google搜索
I just Googled this[^] and there are a number of references to .X file formats on the web. I suggest you try the same and go from there. Note, having browsed one of the file descriptions I think this is a non-trivial exercise, you may be better searching for a library that supports access to these file types.


这篇关于在C#中读取文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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