摘要:
这个错误大概率是端口冲突, 这里不再赘述。具体(参考https://www.cnblogs.com/zhengdongdong/p/12001152.html) 我这边的原因是运行端口在被排除端口范围中(参考https://gsw945.com/index.php/archives/33/) cmd 阅读全文
摘要:
恢复内容开始 .Net 跨域 修改Global,添加如下代码 protected void Application_BeginRequest() { if (Request.Headers.AllKeys.Contains("Origin") && Request.HttpMethod == "OP 阅读全文
摘要:
参考链接:https://www.cnblogs.com/king-23100/p/11821020.html 唯一的补充是在Startup.cs中注册服务时加上 services.AddScoped<ITestService, TestService>(); 阅读全文
摘要:
先看下HttpClient在微软官方的解释: 这个类中的方法有多个,现在主要讲 SendAsync(HttpRequestMessage request)的用法; 示例代码: 1 var httpRequestMessage = new HttpRequestMessage 2 { 3 Method 阅读全文
摘要:
今天项目中有两个类,其中相同的属性比较多,手动代码量大。借鉴此篇博客https://www.cnblogs.com/gester/p/5816643.html,然后根据自身需求修改了一下,代码如下: [TestClass] public class UnitTest1 { [TestMethod] 阅读全文
摘要:
using System; using System.Text; using System.IO; using System.Net; using System.Threading; namespace Common { public class Utils { #region URL请求数据 // 阅读全文
摘要:
using System; using System.Web; using System.Web.Caching; namespace Common { public class CacheHelper { /// <summary> /// 创建缓存项的文件 /// </summary> /// 阅读全文
摘要:
using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using System.Collections.Generic; using System.Data; namespace Co 阅读全文
摘要:
1.配置文件 ASP.Net用Web.Config文件包含应用程序需要执行的所有配置参数,以及global.asax可以在启动 Web 应用程序期间编写代码来执行的一个地方。ASP.NET MVC、WebApi中 Global.asax、FilterConfig.cs 和 RouteConfig.c 阅读全文
摘要:
示例代码: [HttpGet] public ActionResult Test(string id="test") { return this.View(TetsViewModel, id); } 当我想将String类型的数据传递给页面时,会报错,大概意思是找不到符合条件的页面。这种情况下,我们 阅读全文