摘要: public class MyContainer { private readonly Dictionary<Type, object> services = new Dictionary<Type, object>(); public void Register<T>(T service) { s 阅读全文
posted @ 2023-04-18 09:21 Agreoself 阅读(26) 评论(0) 推荐(0) 编辑
摘要: .NET Web API 和 Web Services 都是通过 HTTP 协议来提供服务的方式,它们的主要区别在于以下几个方面: 接口方式的不同 Web API 通常使用 RESTful API,即使用 HTTP 动词对资源进行 CRUD 操作,比如 GET、POST、PUT 和 DELETE 请 阅读全文
posted @ 2023-04-18 09:17 Agreoself 阅读(3375) 评论(0) 推荐(0) 编辑
摘要: var httpClient = new HttpClient(); //实例化一个请求对象 httpClient.DefaultRequestHeaders.Add("Authorization", "123456");//添加请求头的相关内容 HttpContent content = new 阅读全文
posted @ 2022-11-14 10:11 Agreoself 阅读(73) 评论(0) 推荐(0) 编辑
摘要: function customPrint(content, option = {}) { const removeOldIframe = () => { const oldPrintIframe = document.getElementById('printIframe'); oldPrintIf 阅读全文
posted @ 2022-11-10 11:20 Agreoself 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 去除首字符 1.json = json.Substring(1, json.Length-1); 2.strInfo = strInfo.Remove(0, 1); 去除尾字符 1.json = json.Substring(0,json.Length-1); 2.strInfo = strInfo 阅读全文
posted @ 2019-05-23 11:44 Agreoself 阅读(84) 评论(0) 推荐(0) 编辑
摘要: select a.TradeType,a.TradeState,a.Pname,a.OutTradeNo,a.*, (CASE a.TradeType when '1' then '充值' when '2' then '退款'when '3'then '撤销' end)交易类别, (CASE a.T 阅读全文
posted @ 2019-04-28 15:45 Agreoself 阅读(787) 评论(0) 推荐(0) 编辑
摘要: 1.跨域问题 跨域问题是: 浏览器的同源安全策略 没错,就是这家伙干的,浏览器只允许请求当前域的资源,而对其他域的资源表示不信任。那怎么才算跨域呢? 请求协议http,https的不同 域domain的不同 端口port的不同 好好好,大概就是这么回事啦,下面我们讲2种中规中矩的办法:CORS,JS 阅读全文
posted @ 2019-04-23 18:09 Agreoself 阅读(334) 评论(0) 推荐(0) 编辑