- 博客(23)
- 收藏
- 关注
原创 sourcetree推送失败,提示: Logon failed, use ctrl+c to cancel basic credential prompt.
sourcetree推送时,在弹出框中输入github用户名和密码,但是推送失败,提示:。。。sourcetree Logon failed, use ctrl+c to cancel basic credential prompt.。。。原因:新版的GIT不再支持弹出框验证用户名密码的方式,所以推送请求被拒绝了。解决办法:到https://gitforwindows.org/下载最新版本的git, 安装好后重新推送, 就会引导你到浏览器中输入用户名密码,之后推送成功。...
2020-11-17 22:24:49
10171
6
原创 关于asp.net core项目中MvcOptions.ReturnHttpNotAcceptable的设置
MvcOptions.ReturnHttpNotAcceptable的默认值为false, 此时,如果服务器端不支持http request中Accept的格式值,比如application/xml,则不会报错,返回默认格式的结果,比如application/json的结果。如果MvcOptions.ReturnHttpNotAcceptable的值设置为true,那么,如果服务器端只支持application/json的输出,不支持http request中Accept的格式值,比如application
2020-09-24 01:34:53
611
原创 asp.net core 3.1项目中Add-Migration 执行报错
错误提示:Add-Migration : The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.解决办法:nuget 安
2020-09-17 00:26:20
1188
原创 IIS管理器无法打开。启动后,在任务栏中有,但是窗口不见了
启动【IIS管理器】后,在任务栏中有,但是窗口不见了。尝试在【设置=》控制面板=》程序=》程序和功能】重新安装IIS相关组件,重启电脑后还是没解决。google一下,找到解决办法:开始=》运行命令=》输入:inetmgr.exe /reset搞定!!By the way, if you run Inetmgr.exe /reset it will run and reset its preferences which includes the starting position which
2020-09-10 15:44:20
5116
7
原创 visual studio右键菜单中Add -> New Scaffolded Item缺失
问题:visual studio 2019,右键菜单中Add -> New Scaffolded Item缺失解决办法:在项目中下载安装以下nuget package:Microsoft.VisualStudio.Web.CodeGeneration.ToolsMicrosoft.VisualStudio.Web.CodeGenerators.Mvc
2020-09-06 23:13:02
672
原创 服务器端js/css文件已更新,浏览器刷新后没更新,还是使用缓存中保存的更新之前的文件,解决办法:添加参数:?v=1
WEB应用开发过程中,经常遇到服务器端js/css文件已修改更新上传后,刷新浏览器,但是页面并没有展示更新的内容。原因:浏览器缓存中存在更新之前的同名文件,所以就没有下载更新的文件,还是继续使用缓存中的旧文件,也就无法展示更新的内容了。解决办法:方法1. 在浏览器设置中清除缓存后,再刷新浏览器,就可以得到更新后的文件。方法2. 在页面中引用更新的文件时添加参数如下:<link rel="stylesheet" type="text/css" href="reset.css?v=1"
2020-07-18 10:18:04
1295
原创 dotnet tool install --global dotnet-ef 失败原因及解决办法
给.net core 3.1.1安装ef时报错,如下-> dotnet tool install --global dotnet-eferror NU1100: Unable to resolve 'dotnet-ef ' for '.NETCoreApp,Version=v3.1'.error NU1100: Unable to resolve 'dotnet-ef ' for '.NETCoreApp,Version=v3.1/any'.The tool package could no
2020-07-10 00:26:27
4323
原创 sourcetree无法推送,要推送的分支不显示,需要下载最新版本的git
引用:https://blog.youkuaiyun.com/Shiyaru1314/article/details/102822486原因:git版本太低导致。解决办法:下载最新版本的git,安装后就号了。
2020-07-08 23:26:36
1404
原创 c# .net json 序列化时DateTime格式化
static void Main(string[] args) { var json = JsonConvert.SerializeObject(new Order() { OrderTitle = "ABC", Created = DateTime.Now }, new JsonSerializerSettings {
2020-06-24 14:16:48
1766
原创 Newtonsoft C# 序列化Enum时用字符串 而不是数值
在序列化时中实现var json = JsonConvert.SerializeObject(model, new StringEnumConverter());在定义类时添加属性class ThreadModel { public System.Threading.ThreadState ThreadStateEnum { get; set; } [JsonConverter(typeof(StringEnumConvert.
2020-06-24 11:38:35
882
原创 C# 用 Newtonsoft JsonConvert.DeserializeObject 直接解析json 不用定义对应的类
static void Main(string[] args) { var json = @"{ 'DisplayName': '新一代算法模型', 'CustomerType': 1, 'Report': { 'TotalCustomerCount'
2020-06-24 11:25:56
8406
原创 C# 日期格式转换 8位整数
string str = “201000607”;DateTime dtime = DateTime.ParseExact(str,“yyyyMMdd”,null);return dtime.ToString(“yyyy-MM-dd”));
2020-06-23 10:22:20
2960
原创 c# linq查询语句 转换为 DataTable
c# linq查询语句 转换为 DataTableIEnumerable<DataRow> query = from order in orders.AsEnumerable() where order.Field<DateTime>("OrderDate") > new DateTime(2001, 8, 1) select order;DataTable boundTable = query.CopyToDataTable<DataRow
2020-06-10 17:27:32
914
原创 easyui datagrid deleteRow删除行时异常,删除了其他行
easyui框架datagrid调用deleteRow方法后,有个bug,rowIndex没有正确更新,会导致你想删除某一行,而结果却是删除了另外一行。解决办法是,删除一行后重新loadData一下就可以了。function deleteDgRow(index){ //console.log(index); $("#datagrid").datagrid("deleteRow", index); var rows = $('#data
2020-06-08 13:56:38
573
原创 SQL: 用 group by + for xml path 将一个字段的字符串合并
表结构,数据如下:id value1 aa1 bb2 aaa2 bbb2 ccc需要得到结果:id values1 aa,bb2 aaa,bbb,cccselect id, [values]=stuff((select ','+[value] from tb t where id=tb.id for xml path('')), 1, 1, '') from tb group by id ...
2020-05-29 10:56:53
1089
原创 sql server:把一张表的数据复制到另一个数据库里
select * into [FZ_0513].[dbo].[stock_PriceModify_detail] from [FZ_0320].[dbo].[stock_PriceModify_detail]数据库名称.dbo.表名
2020-05-19 15:01:09
593
原创 JQuery 常用正则表达式
一、校验数字的表达式1 数字:^[0-9]*$2 n位的数字:^\d{n}$3 至少n位的数字:^\d{n,}$4 m-n位的数字:^\d{m,n}$5 零和非零开头的数字:^(0|[1-9][0-9]*)$6 非零开头的最多带两位小数的数字:^([1-9][0-9]*)+(.[0-9]{1,2})?$7 带1-2位小数的正数或负数:^(\-)?\d+(\.\d{1,2...
2020-05-05 15:43:53
2633
原创 asp.net code first 更新model和数据库
There are a few approaches to resolving the error:Have the Entity Framework automatically drop and re-create thedatabase based on the new model class schema. This approach is veryconvenient early ...
2020-04-09 11:26:16
190
原创 C# async/await用法
async/await是C#5.0中推出的static void Main(string[] args){ Console.WriteLine("-------主线程启动-------"); Task<int> task = GetStrLengthAsync(); Console.WriteLine("主线程继续执行"); Console.Writ...
2020-04-03 14:29:47
296
原创 sql server中将逗号分隔字符串转换,使其放入in()可用
create Function StrToTable(@str varchar(1000))Returns @tableName Table(str2table varchar(50))As--该函数用于把一个用逗号分隔的多个数据字符串变成一个表的一列,例如字符串’1,2,3,4,5’ 将编程一个表,这个表Beginset @str = @str+','Declare @inse...
2020-03-31 09:59:39
3001
3
原创 用C#配置log4net
log4net Tutorial - The Complete Guide for beginners and prosvar hierarchy = (Hierarchy)LogManager.GetRepository();PatternLayout patternLayout = new PatternLayout{ ConversionPattern = "%date %l...
2020-03-12 15:30:53
272
原创 easyui datebox 只能选择今天以后的日期
<input type="datetime" id="auxDate1" name="auxDate1" style="height: 30px;width: 70%;" class="easyui-datebox 0" data-options="onSelect:onChangeDate,editable:false" value="">//需求日期只能选今天之后 ...
2020-03-03 15:01:15
1463
原创 查找数据库中含有已知列名的表
查找数据库中含有已知列名的表Search Tables:SELECT c.name AS ‘ColumnName’,t.name AS ‘TableName’FROM sys.columns cJOIN sys.tables t ON c.object_id = t.object_idWHERE c.name LIKE ‘%My...
2020-03-03 14:43:52
346
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人