随笔分类 -  C#

摘要:先上个效果图:,类似的对应的google的扩展程序。 环境:win10,vs2017 如果是其他版本的就不知道有没有对应的模板。(如果没有可能需要下载一下对应的模板) 第一步:新建项目 新建好以后会出现一个页面:大概意思插件的 一些介绍。 第2步:对着项目右击【添加项】 需求:给js,css 添加版 阅读全文
posted @ 2019-07-31 09:51 s_p 阅读(806) 评论(0) 推荐(0) 编辑
摘要:A 帮忙把这段js脚本转换 c#语言. JS: 开始一看都是 &,^,>> 16进制头晕。中间想过 c# 执行js http://www.voidcn.com/article/p-aydnjind-be.html 后面老大说 方案不通过。只能翻译了。 过程: 第一步 :内心思考 有没有JavaScr 阅读全文
posted @ 2019-06-14 17:19 s_p 阅读(973) 评论(0) 推荐(0) 编辑
摘要:前言:作为开发人员,对象的序列化经常用到,特别是在现在前后端分离 采用json 交互 ,就将原来用过的几种方式总结了下,也算是做一个记录,顺便做了下性能测试。 1:内置 JavaScriptSerializer 2:常用 Newtonsoft.Json.dll 3:第3方 Jil https://g 阅读全文
posted @ 2019-01-07 11:09 s_p 阅读(1261) 评论(4) 推荐(0) 编辑
摘要:public class BlogUser { public int Id { get; private set; } public Lazy> Articles { get; private set; } public BlogUser(in... 阅读全文
posted @ 2015-07-23 15:20 s_p 阅读(310) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;using System.ComponentModel;namespace Consol... 阅读全文
posted @ 2014-07-30 17:17 s_p 阅读(387) 评论(0) 推荐(0) 编辑
摘要:介绍: http://www.cnblogs.com/bomo/archive/2013/01/28/2879361.html 实战 c#获取外网ip 网址:http://ip138.com/ 如图:分析 有个iframe 实际上查看网页源代码是没有ip的 原因浏览器引擎解析会解析src 地址: 所 阅读全文
posted @ 2014-07-23 16:24 s_p 阅读(260) 评论(0) 推荐(0) 编辑
摘要:最近做一个项目,由于是在别人框架里开发app,导致了很多限制,其中一个就是不能直接引用webservice 。我们都知道,调用webserivice 最简单的方法就是在 "引用" 那里点击右键,然后选择"引用web服务",再输入服务地址。确定后,会生成一个app.config 里面就会自动生成了一些... 阅读全文
posted @ 2014-05-15 16:17 s_p 阅读(305) 评论(0) 推荐(0) 编辑
摘要://实例方法1 //new CreateCalss cc1 = new CreateCalss(); //实例方法2 //获取当前程序集 Assembly asse... 阅读全文
posted @ 2014-05-07 09:14 s_p 阅读(999) 评论(0) 推荐(0) 编辑
摘要:int result = 0; try { string fileType = this.upLoadExel.FileName.Split('.')[this.upLoadExel.FileName.Sp... 阅读全文
posted @ 2014-01-08 15:54 s_p 阅读(296) 评论(0) 推荐(0) 编辑
摘要:1:缓存。你需要了解大数据高并发的瓶颈在哪里,一般都是数据库层面的,机械硬盘承载不起非常快速的读写操作,cpu承载不起大量的逻辑运算,所以最基本的解决思路就是:1.换固态硬盘加快硬盘的读写效率。2.建立缓存中间件降低对硬盘的读写次数,缓存不用多说了,最最最基本和重要的优化策略。3.将硬盘的读写或者数... 阅读全文
posted @ 2013-08-26 00:25 s_p 阅读(480) 评论(0) 推荐(0) 编辑
摘要:1: Response.BinaryWrite() 其实就是和输出文字一样 只是图片是流的形式; delegate long myDel(int first, int second); FileStream fs; byte[] _byte; protected void Page_Load(object sender, EventArgs e) { Response.ContentType = "image/jpeg"; fs = new FileStream(Server.Ma... 阅读全文
posted @ 2013-06-17 00:26 s_p 阅读(1576) 评论(0) 推荐(0) 编辑
摘要:C# Timer用法有哪些呢?我们在使用C# Timer时都会有自己的一些总结,那么这里向你介绍3种方法,希望对你了解和学习C# Timer使用的方法有所帮助。关于C# Timer类 在C#里关于定时器类就有3个C# Timer使用的方法1.定义在System.Windows.Forms里C# Ti... 阅读全文
posted @ 2013-06-06 17:18 s_p 阅读(2139) 评论(0) 推荐(1) 编辑
摘要://创建xml XDocument employeeDoc = new XDocument( new XElement("html", new XElement("body... 阅读全文
posted @ 2013-06-06 16:57 s_p 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-05-18 20:09 s_p 阅读(112) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Runtime.Remoting.Messaging;using System.Threading;namespace asyncResult{ delegate long myDel(int first,int second); class Program { static void Main(string[] args) { Console.WriteLine("Main begin"); ... 阅读全文
posted @ 2013-05-09 01:42 s_p 阅读(182) 评论(0) 推荐(0) 编辑
摘要:首先引入ChnCharInfo.dll 第3方的一个库代码:btn_chinChar_Click事件: private void btn_chinChar_Click(object sender, EventArgs e) { ChineseChar cr =null; string str = "", txtString = txt_string.Text.Trim(); if (!string.IsNullOrEmpty(txtString)) { ... 阅读全文
posted @ 2013-04-17 10:10 s_p 阅读(222) 评论(0) 推荐(0) 编辑
摘要:是笔记 所以代码没有优化。一切从简存储过程:方法1:返回一个集合,此方法灵活。ALTER PROCEDURE [dbo].[Porc_temp] AS BEGIN select * from admin ; END 代码: public ActionResult Index() { DataTable dt; string conString = "server=.;database=xx;uid=sa;pwd=xxx;"; using (SqlConnection con = new SqlCo... 阅读全文
posted @ 2013-04-10 10:50 s_p 阅读(449) 评论(0) 推荐(0) 编辑
摘要:学c语言的时候就知道第2将里面专门介绍了大小写字母传化 而也有人问过 大多数都是用的微软封装好的方法.下面参照c语言的改写的 不考虑性能和扩展性好不好 只是一个娱乐而已。 string str = "HELLOWORD"; Console.WriteLine(str.ToLower()); byte[] array = Encoding.ASCII.GetBytes(str); byte[] aa = new byte [100]; string ascii=string.Empty; ... 阅读全文
posted @ 2013-02-05 14:39 s_p 阅读(189) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace ObjDelegate{ delegate void ObjExtDe(string name); delegate int ObjExtDe<T>(T t1, T t2); public partial cl... 阅读全文
posted @ 2012-10-20 18:23 s_p 阅读(196) 评论(0) 推荐(0) 编辑
摘要:在数据接收线程中,当接收到数据并且校验正确后,我怎么显示这些数据到窗体中呢?要显示数据,必须要访问主线程(A)的各种控件,而数据接收是另一个线程(B)。有两种方案可以解决这个问题,和上文一样,也是第二个较好。方法一:取消跨线程操作检查当线程B在访问线程A创建的控件时,线程A会对控件的线程锁进行检验,当多个线程同时对控件进行写操作时,必然产生冲突,因此此时的程序会非常不稳定,经常突然就退出,Debug显示原因是跨线程操作控件了。既然如此,那就让线程A不去检验其他线程了,在Form_Load函数里加一句:System.Windows.Forms.Control.CheckForIllegalCro 阅读全文
posted @ 2012-10-10 14:07 s_p 阅读(1986) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示