随笔分类 - C#、ASP.NET、ASP.NET MVC、WINFORM
开发与实践总结
摘要:环境说明: Win2008 R2(中文版) x64 、IIS 7.0 功能说明:上传Excel到服务器,并在服务器端读取Excel中的数据; 异常信息:Retrieving the COM class factory for component with CLSID {00024500-0000-0
阅读全文
摘要:对于word操作一般是对已有word模板的操作,直接新建的不考虑,网上教程很多,自己看吧一般有以下几种办法(忘了具体几种了,一般情况下以下就够了)1、通过书签替换顾名思义,就是先定义一个书签,然后在书签的位置填进去相应的数据或图片,具体操作 1 >先在word上插入->书签->定义书签名 2 >在程
阅读全文
摘要:在调试中发现错误如下: Response.Redirect引起的“无法在发送HTTP标头之后进行重定向” 跳转失败 解决方案如下: 使用js方法来跳转地址 1 const string url="<script>window.location.href='/login/index'</script>
阅读全文
摘要:(1) 第一种方法: (2) 第二种方法: 注意: 用IList需要using System.Collections; 数组中不能直接indexOf这个方法,需要 Array.IndexOf(x,x);这样来使用 字符串转换成数组:str.split(",");括号内按照字符串中的符号来写 数组转换
阅读全文
摘要:在ASP.NET的web.config中,可以用两种方式来写连接字符串的配置。 如上代码所示:两种方式为appSettings和connectionStrings appSettings: ①它是asp.net1.1的时候用的,在vs2003中用的 ②里面存的相当于键值对的形式,key和value。
阅读全文
摘要:今天研究一天的导出word,一开始准备选用为软件自带的office,但是有局限性,机子上必须安装office才能使用,最后在网上搜了一下资料aspose开源的 小公司没得钱,你懂得。最后选择了这款 开源地址:http://www.oschina.net/p/aspose-words/similar_
阅读全文
摘要:1.在写程序中经常操作字符串,需要去重,以前我的用方式利用List集合和 contains去重复数据代码如下: 2.现在我推荐大家使用一下方式去重复数据 转载说明原文来源 https://i.cnblogs.com/EditPosts.aspx?postid=6224960
阅读全文
摘要:1.权限控制使用controller和 action来实现,权限方式有很多种,最近开发项目使用控制控制器方式实现代码如下 二.单点登录方式使用application方式来实现 1.用户登录成功后记录当前信息 2.使用ActionFilter来实现单点登录,每次点击控制器都去查询过滤是否在其它地方登录
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WindowsFormsApplication1 { public class Contract { public string employeename { get...
阅读全文
摘要:具体代码如下: private void button1_Click(object sender, EventArgs e) { string StartIp = ""; string EndIp = ""; StartIp = Startinput.Text; EndIp = Endinput.T
阅读全文
摘要:本地开发环境没问题,但是发布到服务器出现问题或则直接在IIS上修改东西就给我抛出以下错误: 未能写入输出文件“c:\Windows\Microsoft.NET\Framework64 \v4.0.30319\Temporary ASP.NET Files\root\106f9ae8\cc0e1169
阅读全文
摘要:大家做了很多文本框查询并且赋值回来 1.先是把数据对象查询结果后台,然后把对象赋值给对象在赋值回来前台页面 2.使用@html helerper 数据查询,使用 ViewContext.RouteData.GetRequiredString("Controller") 在路由中获取参,使用get方式
阅读全文
摘要:在开发过程中,我们有时候需要启动区域中的页面为起始页面,那我们就需要子啊路由中添加一段代码 如何完整案例: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{
阅读全文
摘要:1.时间比较大小 DateTime t1 = new DateTime(100); DateTime t2 = new DateTime(20); if (DateTime.Compare(t1, t2) > 0) Console.WriteLine("t1 > t2"); // t1 大 if (
阅读全文
摘要:1传入json 字符进行转换 public DateTime ConvertTime(string milliTime) { long timeTricks = new DateTime(1970, 1, 1).Ticks + long.Parse(milliTime) * 10000; retur
阅读全文
摘要:1. 先添加System.Web.Extensions.dll引用
阅读全文
摘要:CookieContainer cookies = new CookieContainer(); string url = "http://120.24.56.48:8889/api/auth/login?username=13590372650&password=wjkj110"; HttpWeb
阅读全文
摘要:public class HttpClientHelper { /// <summary> /// get请求 /// </summary> /// <param name="url"></param> /// <returns></returns> public static string Get
阅读全文
摘要:创建页面 进行初始化 默认 男 被选中 [csharp] view plain copy print? <div class="label"> <div class="editor-label"> @Html.LabelFor(model => model.Sex) </div> <div clas
阅读全文
摘要:以下是方法 返货json数据 代码都有注释 /// <summary> /// 请求webpapi /// </summary> /// <param name="url">地址</param> /// <returns>json字符串</returns> public static string
阅读全文

浙公网安备 33010602011771号