
net
文章平均质量分 60
放开那段代码让我来
努力学习
展开
-
net发送邮件
// public bool SendEmail() { System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(); msg.To.Add("1158694377@qq.com");//收件人地址 msg.CC原创 2017-07-04 09:43:53 · 462 阅读 · 0 评论 -
Ajax访问一般处理程序进入三层处理逻辑
//前台页面:================================= $(function () { $(function () { $("#ts").click(function () { var url = 'Handler/MobileHandler.ashx'原创 2017-07-14 16:21:46 · 1034 阅读 · 0 评论 -
获取浏览器端操作系统名称
public static string GetOSName() { string osVersion = System.Web.HttpContext.Current.Request.Browser.Platform; string userAgent = System.Web.HttpContext.Current.Requ原创 2017-01-12 08:57:58 · 527 阅读 · 0 评论 -
后台读取配置文件里面key的值
Web.Config里面配置key: 后台取这个值(引入命名空间System.Configuration.Configuration): System.Configuration.ConfigurationManager.AppSettings["UploadFileType"];原创 2017-01-12 09:07:22 · 1043 阅读 · 0 评论 -
C#操作SqlDataReader对象
1. 接收转数组并读取:原创 2017-08-01 15:29:14 · 10927 阅读 · 1 评论 -
C#语法(List、方法的调用)
class GroupSample1{ // The element type of the data source. public class Student { public string First { get; set; } public string Last { get; set; } public原创 2017-06-16 11:54:04 · 7827 阅读 · 0 评论 -
Linq语法I
1、Linq查询:var re = from o in db.Order join d in db.OrderDetail on o.Code equals d.OrderCode join p in db.Product on d.ProductID equals p.id wher...原创 2019-02-24 19:21:54 · 370 阅读 · 0 评论 -
net 非Mvc模板引擎RazorEngine
1、VS2017在管理Nuget程序包里搜索安装RazorEngine,下面有关于模板使用的介绍:页面使用必须引入以下命名空间:using RazorEngine;using RazorEngine.Templating;gitthub实例:https://antaris.github.io/RazorEngine/介绍:https://www.cnblogs.com/mcad...原创 2019-04-21 15:57:36 · 685 阅读 · 0 评论 -
C# 3Des两种加密方式
1、3Des两种加密方式 //3DES的cbc加密[24位密钥对应192位加密] public static string TripleDesEncryptorCBC(string text, string key, string iv) { var tripleDESCipher = new TripleDESCryptoSer...原创 2019-07-30 14:07:55 · 3994 阅读 · 1 评论 -
C#知识积累
1.Session的存值和取值: 存值: DataTable dr = dt.Tables[0]; Session["dr"] = dr;取值: DataTable dl = Session["dr"] as DataTable;原创 2017-07-23 20:19:29 · 322 阅读 · 0 评论 -
C#去除HTML标记
1、using System;using System.Collections.Generic;using System.Linq;using System.Text.RegularExpressions;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace WebAppli原创 2017-12-05 14:29:25 · 540 阅读 · 0 评论 -
JSON序列化、JSON反序列化
三、JSON序列化、JSON反序列化 public static string JsonSerial(T t) { DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(T)); MemoryStream ms = new MemorySt原创 2017-01-11 11:17:09 · 378 阅读 · 0 评论 -
Web.Config中文件上传限制
文件上传限制: 指定 ASP.NET 配置节的根元素,并包含用于配置 ASP.NET Web 应用程序和控制应用程序行为的配置元素。 文件上传配置: Web.config 文件中的 system.webServer 节用于指定适用于 Web 应用程序的 IIS 7.0 设置。system.WebServer 是 conf原创 2017-01-12 08:31:11 · 1138 阅读 · 0 评论 -
文件下载
// 文件下载public static bool DownloadFile(string path) { HttpRequest request = HttpContext.Current.Request; HttpResponse response = HttpContext.Current.Response;原创 2017-06-13 10:15:24 · 420 阅读 · 0 评论 -
ADO.NET五大对象
ADO.NET五大对象:客户端操作数据库服务器。所谓的数据的增删差改。1.连接(Connection):连接制定的服务器。 给定连接字符串。对于我们的SQL SERVER来说可以有WINDOWS身份验证和SQL身份验证。一般用SQL身份验证,就需要指定:数据源(就是对应的数据库服务器的实例名称)、数据库、SQL身份验证用户名、密码using System.Data.S原创 2017-06-21 16:20:41 · 492 阅读 · 0 评论 -
C#web知识
1.aspx页面input按钮提交a.初次加载页面: if (!IsPostBack) { }b.点击查询按钮后台cs页面运行代码: if (IsPostBack) { if (!string.IsNullOrEmpty(Request.Form["GCMC"]))原创 2017-07-19 19:53:17 · 746 阅读 · 0 评论 -
net开发错误问题收集
vs2017创建的webApi接口,测试页面用vs2013打开报错相关解决博客:http://blog.youkuaiyun.com/reidcheng/article/details/51850485原创 2017-07-03 09:17:44 · 358 阅读 · 0 评论 -
C#图片转二进制、二进制转图片
1. public class ConvertByte { /// /// 图片路径转二进制 /// /// /// public byte[] returnbyte(string strpath) { // 以二进制方式读文件原创 2017-08-25 08:31:55 · 4540 阅读 · 0 评论 -
net CRC16校验
1、CRC16校验 // CRC16效验 public string CalcCRC16(string strInput) { ushort crc = 0xffff; ushort x; byte[] data = GetBytesFromHexString(strInput); ...原创 2019-07-30 14:12:57 · 1498 阅读 · 0 评论