Java中的Scanner是否具有C#中的等价物? [英] Does Scanner from Java have an equivalent in C#?
本文介绍了Java中的Scanner是否具有C#中的等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建一个排行榜,我将在(.txt)文档中保存分数,因为我还不熟悉实现数据库系统。
我之前在Java中使用 Scanner
和 PrintWriter
。但是,我完全不知道如何在C#中做到这一点。
将存储在文档中的信息只是名称和分数玩家。
I am creating a leaderboard, and I'm going to have the scores saved in a (.txt) document since I'm not yet familiar with implementing database systems.
I have done this before in Java, using Scanner
and PrintWriter
. However, I am completely clueless about how I will be able to do that in C#.
The information that will be stored in the document are only the names and scores of the players.
推荐答案
请参阅 .NET Book Zero [< a href =http://www.charlespetzold.com/dotnet/target =_ blanktitle =新窗口> ^ ]以获取有助于您的教程和示例代码。
See .NET Book Zero[^] for tutorials and sample code that will help you.
在C#中打开,读取和写入文本文件非常容易。网上有很好的例子(甚至......来自微软的喘息......):
从这里开始:
http://msdn.microsoft.com/en-us/library/db5x7c0d(v = vs.100).aspx
读取:
http://msdn.microsoft.com/en-us/library/db5x7c0d(v=vs.110).aspx < br $> b $ b
写道:
http://msdn.microsoft.com/en-us/library/6ka1wd3w(v = vs.100).aspx
阅读,学习,试验,编写代码,调试,观察,分析:重复完成:)
It's extremely easy to open, read, and write text files in C#. There are good examples on-line (even ... gasp ... from Microsoft):
Start here:
http://msdn.microsoft.com/en-us/library/db5x7c0d(v=vs.100).aspx
read:
http://msdn.microsoft.com/en-us/library/db5x7c0d(v=vs.110).aspx
write:
http://msdn.microsoft.com/en-us/library/6ka1wd3w(v=vs.100).aspx
Read, study, experiment, write code, debug, observe, analyze: repeat until done :)
这篇关于Java中的Scanner是否具有C#中的等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文