C#相关
听梦雨
编程爱好者 易语言、C#、Python
展开
-
Asp.Net Core报错System.Text.Json.JsonException: A possible object cycle was detected which is not supp
Asp.Net Core报错:System.Text.Json.JsonException: A possible object cycle was detected which is not supported. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32检测到不支持的可能对象循环。这可能是由于周期或物体深度大于最大允许深度32。这是由于进原创 2020-06-20 23:35:28 · 6241 阅读 · 0 评论 -
.net core中修改cshtml代码不用重启项目的方法
1. 添加Nuget包安装 Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 包2. 配置服务stratup的ConfigureServices中添加services.AddRazorPages().AddRazorRuntimeCompilation(); //添加运行时编译功能...原创 2020-04-19 23:32:56 · 1395 阅读 · 1 评论 -
EF Core更新表中某一个字段的值
/// <summary>/// 更新浏览次数/// </summary>public void UpdateViews(Article article){ _context.Articles.Attach(article); article.Views += 1; _context.SaveChanges();}...原创 2020-04-19 00:56:15 · 2022 阅读 · 0 评论 -
webbrowser内核指定
webbrowser内核指定手动指定webbrowser内核找到注册表项:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION在右侧空白区域内单击鼠标右键,点击[新建]→[DWORD(32-位)值],新建的项取名为MyApplication...转载 2019-12-09 08:38:24 · 499 阅读 · 0 评论 -
C#弹出ContextMenuStrip菜单时禁用某些选项
C#弹出ContextMenuStrip菜单时禁用某些选项//菜单弹出前根据条件禁用某些菜单 private void CmsRoomRightBtn_Opening(object sender, CancelEventArgs e) { UCRoomInfo.RoomInfo room = (UCRoomInfo.RoomInfo)cmsRoom...原创 2019-12-04 09:59:23 · 1961 阅读 · 0 评论 -
C#动态创建控件并绑定事件
C#动态创建控件并绑定事件 private void Form1_Load(object sender, EventArgs e) { for (int i = 0; i < 5; i++) { Button btn = new Button(); //创建对象 ...原创 2019-12-04 09:48:02 · 2942 阅读 · 0 评论