c#保存对exe文件的更改 [英] c# saving changes to the exe file

查看:102
本文介绍了c#保存对exe文件的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c#中创建了一个exe文件,其中我在日期时间选择器控件中有一个日期,并根据所选日期的范围,我以粗体样式制作月历中的日期。然后我关闭了我的exe.next时间我打开我的exe我希望看到之前完成的日期加粗,只是在开始时如何做?

解决方案

甚至不想改变你的EXE文件 - 立即被反病毒产品打耳光!



相反,请查看使用Settings.Settings文件在执行运行之间存储突出显示的信息。 br />
在VS中打开项目,查看解决方案资源管理器窗格,打开属性分支,然后双击Settings.Settings

在结果页面中添加新设置。

然后,您可以通过

 ... = Properties.Settings.Default.YourSettingName; 并使用以下方法保存:

 Properties.Settings.Defa ult.YourSettingName = newValue; 
Properties.Settings.Default.Save();


i have made a exe file in c# where in i have a date in date time picker control and based on the range of selected date i make the dates in the month calendar in bold style.then i close my exe.next time i open my exe i want to see the dates bolded which were done before,instatnly upon opening.how to do it?

解决方案

Don't even think of changing your EXE file - that will get slapped by anti-virus products immediately!

Instead, look at using the Settings.Settings file to store your highlighted info between execution runs.
Open you project in VS, look at the Solution Explorer pane, open the Properties branch, and double click on Settings.Settings
In the page that results add a new setting.
You can then access the value in your code via

... = Properties.Settings.Default.YourSettingName;

And save it by using:

Properties.Settings.Default.YourSettingName = newValue;
Properties.Settings.Default.Save();


这篇关于c#保存对exe文件的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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