首页
归档
留言
友链
广告合作
壁纸
更多
美女主播
Search
1
博瑞GE车机升级/降级
5,649 阅读
2
Mac打印机设置黑白打印
5,043 阅读
3
修改elementUI中el-table树形结构图标
4,946 阅读
4
Mac客户端添加腾讯企业邮箱方法
4,705 阅读
5
intelliJ Idea 2022.2.X破解
4,451 阅读
后端开发
HarmonyOS Next
Web前端
微信开发
开发辅助
App开发
数据库
随笔日记
登录
/
注册
Search
标签搜索
Spring Boot
Java
Vue
Mac
Spring Cloud
MyBatis
WordPress
MacOS
asp.net
Element UI
Nacos
MySQL
.Net
Spring Cloud Alibaba
Mybatis-Plus
Typecho
jQuery
Java Script
IntelliJ IDEA
微信小程序
Laughing
累计撰写
629
篇文章
累计收到
1,421
条评论
首页
栏目
后端开发
HarmonyOS Next
Web前端
微信开发
开发辅助
App开发
数据库
随笔日记
页面
归档
留言
友链
广告合作
壁纸
美女主播
搜索到
629
篇与
的结果
2019-05-30
WebApi JSONP的支持
最近遇到一个问题,在js中通过ajax访问webapi,出现了跨域的问题就把ajax的datatype改成jsonp,但是随之而来还有其他问题,就是paraserror = 0解决方法:在NuGet中下载webapi对jsonp的支持在Global中添加GlobalConfiguration.Configuration.AddJsonpFormatter(GlobalConfiguration.Configuration.Formatters.JsonFormtter, "callback");这样服务端就算是配好了!ajax调用示例:$.ajax({ url: "http://localhost:37262/api/door", type: "get", dataType: 'JSONP', jsonp:"callback", success: function (data) { console.log(data); }, });
2019年05月30日
1,486 阅读
0 评论
0 点赞
2019-05-21
Asp.NetCore MVC控制器分离
DotNetCore默认创建的项目,控制器是放到Controller文件夹下面,为了实现项目松耦合,我们可以见控制器分离到单独的类库项目中。创建控制器类库如上图,我这里创建了一个名为Cn.Com.DotNetCore.Controllers的类库项目,单独用于存储控制器。修改startup.cs类修改startup.cs类中的ConfigureServices方法,修改如下代码var mall = Assembly.Load(new AssemblyName("Cn.Com.DotNetCore.Controllers")); //类库的程序集名称 services.AddMvc().AddApplicationPart(mall).SetCompatibilityVersion(CompatibilityVersion.Version_2_2); 至此,就实现了控制器的分离。
2019年05月21日
1,291 阅读
0 评论
1 点赞
2019-05-17
普通解决方案增加webapi支持
添加程序集System.Net.Http System.Net.Http.Formatting System.Web.Http System.Web.Http.Common System.Web.Http.WebHost增加全局配置文件Global.asaxusing System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Mvc; using System.Web.Routing; using System.Web.Security; using System.Web.SessionState; namespace WebApplication4 { public class Global : System.Web.HttpApplication { protected void Application_Start(object sender, EventArgs e) { AreaRegistration.RegisterAllAreas(); RouteTable.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional }); } protected void Session_Start(object sender, EventArgs e) { } protected void Application_BeginRequest(object sender, EventArgs e) { } protected void Application_AuthenticateRequest(object sender, EventArgs e) { } protected void Application_Error(object sender, EventArgs e) { } protected void Session_End(object sender, EventArgs e) { } protected void Application_End(object sender, EventArgs e) { } } }
2019年05月17日
1,215 阅读
0 评论
1 点赞
2019-05-07
Oracle跟踪Sql语句
alter system flush shared_pool / select * from v$sql where parsing_schema_name='LC0019999' order by last_load_time desc
2019年05月07日
1,726 阅读
2 评论
2 点赞
2019-05-05
jsp中文乱码问题
初学JSP,尤其是Tomcat环境,经常会因为中文汉字字符集设置问题导致中文乱码,本文就这一问题提出解决方案,解决中文乱码问题,供各位参考,我采用的方案是统一字符集至UTF-8,同时避免GB2312所带来的中文字符集不够用的隐患,需注意的地方有三点,默认情况下是英文字符集。Tomcat 的 server.xml 文件,设置服务器端口工作方式Servlet 和 JavaBean 对字符串字符集处理的统一JSP页面的字符集统一完成这三点统一,中文想乱码都难,如果使用MySQL的话,数据表也需要做UTF-8统一。修改Tomcat的server.xml文件,该文件位于 tomcat/conf,红色部分为添加部分,也就是当前使用的HTTP端口的连接方式的设置。找到Connector 标签,使 Tomcat 服务器以UTF-8模式进行工作,从底层对乱码进行处理,修改如下:<Connector URIEncoding="utf-8" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> 运行代码内设置如下:JavaBean 和 Servlet 内需要处理中文的地方之前,或者所有函数最前端加上request.setCharacterEncoding ("UTF-8"); response.setCharacterEncoding ("UTF-8");避免在 JavaBean 和 Servlet 内出现汉字乱码。JSP代码中的 JAVA 字符编码设置,在页面上对乱码进行处理。<%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%>红色为制定JSP处理字符采用UTF-8编码处理方式。<div class="dp-highlighter nogutter"><div class="bar"></div><ol start="1" class="dp-j"><li class="alt"><span><span><%request.setCharacterEncoding (</span><span class="string">"UTF-8"</span><span>);%> </span></span></li></ol></div>JSP内JAVA代码设定接收参数为UTF-8编码JSP 内 HTML 头的编码设置,页面处理以UTF-8,避免显示乱码。<form action=index.jsp method="post"><h3>Please Input Your Name:</h3> <input type="text" size="30" name="中文名字" value="" > <input type=submit value="提交"> </form>接收代码如下:<% // 通过二进制传递的参数,因为UTF-8的设置,无须转换,直接中文操作,而不会出现乱码。 String temp1 = request.getParameter ("yourname"); …… %>采用get方式略有不同,若只采用以上设定,遇中文参数,因编码不同,会导致部分文字信息丢失,所以在提交前务必进行编码,这里用到两个函数java.net.URLDecoder.decode 和java.net.URLDecoder.encode,分别是编码和解码。<a href=" <%=request.getContextPath()%>/index.jsp?传递的参数名= <%=java.net.URLEncoder.encode (传递的汉字变量,"UTF-8")%>"> <%=超链接热点显示内容%> </a>作为参数传递的中文,由 java.net.URLEncoder.encode函数将要发送的变量解析为16进制数字编码,进行URL传递,接收代码如下:<%String str = request.getParameter ("传递的参数名");%> 由此,获得参数后的 str 内将是正确的中文信息,完全避免了乱码的显示。可用 java.net.URLDecoder.decode 函数例如<% String str1 = java.net.URLDecoder.decode(request.getParameter("传递的参数名"),"UTF-8"); %>
2019年05月05日
1,123 阅读
0 评论
1 点赞
2019-04-01
word2013标题编号变成黑框
在使用word2013时,之前正常的标题编号有部分变成了黑框{mtitle title="解决方法"/}将光标移动到标题中黑框右侧按动键盘上的左方向键,直到黑框变成灰色同时按键盘 Ctrl+Shift+S键,弹出“应用样式”对话框。点击“重新应用”即可
2019年04月01日
1,288 阅读
0 评论
0 点赞
2019-03-09
sublime text3 python代码去除白色框框
之所以会出现白色框框,是因为代码不符合PEP8规范!!!可以装一个 AUTOPEP8 插件,然后按 Ctrl + Alt + r 就会自动帮你PEP8格式化,白色框框就会消失了。。。要去掉只需在 Sublime > Preferences > Package Settings > Anaconda > Settings User 中设置关闭:{"anaconda_linting": false}
2019年03月09日
1,378 阅读
0 评论
0 点赞
2019-02-27
asp.net core视图组件
what试图组件是ASP.NET Core MVC中的新特性,类似于部分视图,但是它更加强大。驶入组件不使用模型绑定,并且仅依赖于调用它时所提供的数据。how创建视图组件类using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Web.ViewComponents { [ViewComponent(Name = "TopicRankList")] public class TopicRankList : ViewComponent { public IViewComponentResult Invoke() { return View(); } } } 视图搜索路径视图组件的默认视图名称是Default,这意味着你的视图文件通常名为Default.cshtml,可以在创建视图组件结果或调用View方法时指定其他视图名称。视图组件运行时会在以下路径中搜索视图:Views//Components// Views/Shared/Components//所以根据创建的类,我们需要在Views/Shared/Components/TopicRankList文件夹中创建Default.cshtml文件。@{ ViewData["Title"] = "Default"; } <h1>Default</h1>调用视图@await Component.InvokeAsync("TopicRankList")
2019年02月27日
1,136 阅读
0 评论
1 点赞
2019-02-26
ASP.NET Core之NLog使用
添加NLog插件修改NLog配置文件可以通过Nuget安装,NLogConfigure手工添加NLog.Configure文件,如下using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using NLog; using Web.Models; namespace Web.Controllers { public class HomeController : Controller { private readonly ILogger<HomeController> _log; public HomeController(ILogger<HomeController> log) => _log = log; static Logger logger = LogManager.GetCurrentClassLogger(); public IActionResult Index() { logger.Info("测试日志乱码"); return View(); } public IActionResult Privacy() { return View(); } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } }修改StartUp.cs文件public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { app.UseRequestIP(); loggerFactory.AddNLog(); env.ConfigureNLog("NLog.configure"); app.Use(async (context, next) => { context.Items["IsVerified"] = true; await next.Invoke(); }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Error"); } app.UseStaticFiles(); //app.UseDirectoryBrowser(); app.UseAuthentication(); app.UseSession(); app.UseMvc(routes => { routes.MapRoute( name:"area", template: "{area:exists}/{controller=Home}/{action=Index}/{id?}" ); routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }使用NLogpublic class HomeController : Controller { private readonly ILogger<HomeController> _log; public HomeController(ILogger<HomeController> log) => _log = log; static Logger logger = LogManager.GetCurrentClassLogger(); public IActionResult Index() { logger.Info("测试日志乱码"); return View(); } }
2019年02月26日
1,270 阅读
0 评论
2 点赞
2019-01-17
CSDN在无耻的道路越走越远
曾经CSDN也很辉煌,也是比较喜欢浏览的一个技术网站。但是近年来,CSDN可谓越发垃圾。阅读更多CSDN博客一般都是技术文章,而且里面肯定很多人在粘贴代码,粘贴代码一般文章就会比较长,这个时候,CSDN给你来个阅读更多,必须得点一下才能继续看。强推公众号想注册?可以,先关注一下我们的公众号吧。已经注册,想登录?可以,先绑定手机号吧!好的想绑定手机号,可以,先关注我们公众号吧。......
2019年01月17日
1,101 阅读
0 评论
0 点赞
2018-12-28
使用自定义协议实现Chrome打开IE
将下面的内容保存为 .reg 文件,直接运行即可完成协议添加(最后一行的IE地址64位机器会有不同需要修改一下)Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\openIE] @="URL:OpenIE Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOT\openIE\DefaultIcon] @="iexplore.exe,1" [HKEY_CLASSES_ROOT\openIE\shell] [HKEY_CLASSES_ROOT\openIE\shell\open] [HKEY_CLASSES_ROOT\openIE\shell\open\command] @="cmd /c set m=%1 & call set m=%%m:openIE:=%% & call \"C:\\Program Files\\Internet Explorer\\iexplore.exe\" %%m%% & exit" 测试方法<a href="openIE:www.baidu.com">百度</a>
2018年12月28日
1,473 阅读
0 评论
0 点赞
2018-12-11
根据WSDL文件(java Web Service)生成.cs文件
我们添加webService引用,一般是通过 添加服务引用完成的,其实 添加服务引用 在背后为我们生成了代理类。我们手动生成代理类方法:通过java Web Service,生成wsdl文件:1.1 IE地址栏中输入wsdl的url 例如:http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl1.2 通过IE的 【文件】-->【另存为】-->文件名中输入 UserService55.wsdl, 保存类型: 所有文件(.) ;开始菜单-->Microsoft Visual Studio 2010 -->Visual Studio Tools-->Visual Studio Command Prompt (2010) ;输入wsdl wsdl文件路径(D:\UserService55.wsdl) /out:UserService55.cs,cs文件生成在 Microsoft Visual Studio 10.0\VC\目录中;
2018年12月11日
1,065 阅读
0 评论
0 点赞
1
...
38
39
40
...
53