如何从“文本文件”加载数据进入“文本框” [英] How to load data from a "Text File" into "Text Boxes"

查看:76
本文介绍了如何从“文本文件”加载数据进入“文本框”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我对Visual Studio或C#几乎一无所知但是怎么做我将文本文件中的信息加载到Visual Studio的文本框中?
$


我正在尝试创建一个页面,显示一个足球队的球员列表他们各自的统计数据。 
$


到目前为止,我创建了以下标签,旁边有一个空白的文本框..



- 玩家姓名:(TextBox1)

- 位置(TextBox2)

- 国家(TextBox3)

- 年龄(TextBox4)
$
- GK统计(TextBox5)

- DF统计(TextBox6)

- MF统计(TextBox7)
- ST统计(TextBox8)



如何创建一个文本文件,在相应的框中显示以下统计信息.. 



Player1,GK,England,25,20,1,1,1 



Player2,DF,Spain, 24,1,20,5,5 



Player3,MF,Fr ance,27,1,10,20,10 $


Player4,ST,意大利,31,1,1,10,20 



如果有人能告诉我如何写出文本文件以及如何将其连接到文本框,我将非常感激,谢谢! 




解决方案

您好MarvellousDazza,


欢迎来到MSDN论坛。


根据描述,这个问题是关于Windows Forms开发的,我们的论坛是讨论VS IDE,我会帮你把这个帖子移到相应的论坛上更好的支持,谢谢你的理解。



祝你好运,


Sara


I have virtually no knowledge whatsoever when it comes to Visual Studio or C# but how do I load information from a text file into the text boxes in Visual Studio?

I'm trying to make a page which displays a list of players for a football team with their respective stats.. 

So far I've created the following Labels with a blank Text Box beside it..

- Player Name: (TextBox1)
- Position (TextBox2)
- Nation (TextBox3)
- Age (TextBox4)
- GK Stats (TextBox5)
- DF Stats (TextBox6)
- MF Stats (TextBox7)
- ST Stats (TextBox8)

How do I create a text file which will show the following stats into the respective boxes.. 

Player1, GK, England, 25, 20, 1, 1, 1 

Player2, DF, Spain, 24, 1, 20, 5, 5 

Player3, MF, France, 27, 1, 10, 20, 10

Player4, ST, Italy, 31, 1, 1, 10, 20 

If anyone could show me how to write out the text file and how to connect it to the text boxes I will be very grateful, thanks! 


解决方案

Hi MarvellousDazza,

Welcome to the MSDN forum.

According to the description, this issue is about the Windows Forms development and our forum is to discuss the VS IDE, I will help you move this thread to the appropriate forum for a better support, thank you for your understanding.

Best regards,

Sara


这篇关于如何从“文本文件”加载数据进入“文本框”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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