.NET Core WPF 没有 Properties.Settings 了,有替代方法吗?

独立观察员 2020-07-10 10:03:25
.NET Core WPF 没有 Properties.Settings 了,有替代方法吗?

本来可以用 Properties.Settings.Default 储存数据,实现记住密码等功能,在 .NET Core 里有什么方法可以用吗?
...全文
6845 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
独立观察员 2020-07-10
  • 打赏
  • 举报
回复
引用 3 楼 icoolno1 的回复:
项目属性里添加添加资源就有了。


找到了 是添加“设置文件”:
独立观察员 2020-07-10
  • 打赏
  • 举报
回复
引用 4 楼 icoolno1 的回复:
存储密码,可以试试这玩意。
https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-3.1&tabs=windows#secret-manager


好像挺复杂,我看看
独立观察员 2020-07-10
  • 打赏
  • 举报
回复
引用 3 楼 icoolno1 的回复:
项目属性里添加添加资源就有了。


资源和设置应该还是不一样的:
八爻老骥 2020-07-10
  • 打赏
  • 举报
回复
存储密码,可以试试这玩意。
https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-3.1&tabs=windows#secret-manager
八爻老骥 2020-07-10
  • 打赏
  • 举报
回复
项目属性里添加添加资源就有了。
独立观察员 2020-07-10
  • 打赏
  • 举报
回复
引用 1 楼 icoolno1 的回复:
Properties.Settings 是存在的,数据库配置写个 appsettings.json.
通过Configuration.GetConnectionString("BloggingDatabase")获取字符串

{
"ConnectionStrings": {
"BloggingDatabase": "Server=(localdb)\\mssqllocaldb;Database=EFGetStarted.ConsoleApp.NewDb;Trusted_Connection=True;"
},
}


这个是储存配置项的吧。我是想储存用户输入的内容,虽然类似,但还是不太一样吧?
比如我要储存用户的登陆密码,没有加密,但是存在 Properties.Settings.Default 里别人还是看不到的。下次启动可以加载出来。
类似这种:

if (string.IsNullOrWhiteSpace(Settings.Default.IP))
{
TB_IP.Text = NetHelper.GetIpv4Address("192.168");
}
else
{
TB_IP.Text = Settings.Default.IP;
}
Chrome based Browser Engine for .NET EO.WebBrowser is a web browser engine based on Google's Chromium project but with native .NET programming interface --- don't worry, it's not a wrapper around the Chrome browser installed on your machine. In fact EO.WebBrowser has the whole browser engine embedded inside a single .NET DLL. In another word, it has zero external dependency. Just reference and use. Why use EO.WebBrowser? • Based on Google's Chrome Project EO.WebBrowser uses the same core Google's Chrome and Apple Safari uses. It does not rely on IE. The engine is much faster and safer. • Zero External Dependency What if user updates/uninstall their browser? What if user disables JavaScript in Internet Explorer's settings dialog? These questions does not exist with EO.WebBrowser because everything is embedded inside our DLL files. • Native .NET components written in C# Because it's written in .NET, you can use it with any .NET based language/development tool. The same DLL works for both 32 bit and 64 bit environments; • Easy to use Programming Interface EO.WebBrowser offers core components that can be used in any Windows application, as well as wrapper controls for both Windows Forms applications and WPF applications; • Extensive Customization Options EO.WebBrowser offers extensive customization options that allow you to customize context menu, hot keys, JavaScript dialogs, file dialogs, focus and window control. Together these features allow you to seamlessly integrate the browser engine into your application; • .NET code -> JavaScript code Turn any web page into an integral part of your application -- both visually and programmatically. You can execute JavaScript code and access all the JavaScript objects directly from your .NET code. Access their properties or even call a JavaScript function are all different options available to you; • JavaScript code -> .NET code Things always go both ways --- and this is reflected in our programming interface as well. You can call JavaScript code from .NET code, and the other way around is also true --- you can call .NET code from your JavaScript code. This allows your Web page to seamlessly interact with the host application; • Custom Resource Handler Want to keep an eye on everything? Or want to keep everything to yourself? We got you covered. EO.WebBrowser offers ability to intercept and modify all requests that originate from the browser engine. For example, you can automatically deny all request sent to a specific host. It also offers you the ability to implement custom protocols or custom resource handlers. For example, you can implement a custom request handler to load images from your database instead of a Web server;

13,347

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET技术前瞻
社区管理员
  • .NET技术前瞻社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧