C#创建自己的程序 [英] C# Create Your Own Program

查看:113
本文介绍了C#创建自己的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用户能够编辑窗口中的所有内容,例如,按下button1和label2.text =魔兽世界";如果按下button2,label2.text ="Portal 2";
然后我可以将整个程序转换为已保存的exe,就像您将txt文件保存在C#中一样,有人可以帮助我吗?

因此,可以将其保存为self并将其self转换为self的另一个exe.并提供另一个对话框/表单,允许用户更改这些文本值并保存它们.在应用启动过程中,将这些标签从配置文件分配给相应的UI控件.如果配置文件丢失或损坏,则应使用默认的后备值.


从资源文件(例如XML)中选择文本


I want the user to be able to edit everything in the window eg, press button1 and label2.text = "World of warcraft"; and if button2 is pressed label2.text = "Portal 2";
and then I can turn the whole program into a exe that has been saved, just like you save a txt file in C# can anyone please help me?

So yeh it kinda saves it self and turns its self into another exe of its self

解决方案

You should store all the UI labels and captions in a config file. And provide another dialog/form that allows the user to change these text values and save them. And during app startup, assign these labels from the config file to the appropriate UI controls. If the config file is missing or corrupt, you should have default fall-back values to use.


Pick the text from a resource file (XML for example)


这篇关于C#创建自己的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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