
C#
文章平均质量分 61
程序员查理
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
提交数据时出现System.Web.HttpRequestValidationException (0x80004005)
修改web.config文件:原创 2012-07-07 00:17:16 · 1661 阅读 · 0 评论 -
【.net core 3.1】解决雪花ID跟前端交互问题
雪花ID本身是long,查了下json rfc,规范不限制范围,但说明了因为IEEE754广泛使用,[-(2**53)+1, (2**53)-1]范围内是可以互操作的,其他的可能会出问题,而这个可能会出问题就是实实在在的出问题了,前端直接接收到后端返回的long再回过来后,经度都会丢失。如后端给前端的是1297873308628307970,而前端拿到返回回来则变成了12978733086283000000。第一时间想到的是要把long改成字符串返回。而场景大多数是系统写了一大批接口,突然发现有问.原创 2021-04-14 15:12:06 · 1834 阅读 · 0 评论 -
ASP.NET 读取Json格式数据
数据如下:{"cacheCount":1,"count":"34","slice":"5, 5","list":[1001598,1001601,1001605,1001609,1001612],"page":1,"error":200}采用第三方组件Jayrock 和 Jayrock.Json首先引入命名空间using Jayrock.Json;其次,创建 JsonObj原创 2012-05-28 23:46:00 · 1886 阅读 · 0 评论 -
最近写的一个分页数据显示及分页导航
#region 数据显示 DataSet ds = new DataSet(); int allNum = messgeBll.GetRecordCount(" showType = 1 "); int pageTotalNum = allNum / 30; if (原创 2012-05-27 23:11:54 · 502 阅读 · 0 评论 -
获取文件字节数组byte[]
/// /// 获取文件字节数组byte[] /// /// /// public byte[] GetFileByte(string path) { Stream s = File.Open(path, FileMode.Open); int l原创 2012-09-27 17:36:30 · 1288 阅读 · 0 评论 -
byte[]与Image Image与 byte[] 之间的转换
/// /// 将byte[]转换为Image/// /// 字节数组/// Imagepublic Image ReadImage(byte[] bytes){ MemoryStream ms=new MemoryStream(bytes,0,bytes.Length); BinaryFormatter bf = new BinaryForma原创 2012-11-02 15:05:09 · 727 阅读 · 0 评论 -
字符串md5加密
/// /// 字符串md5加密 /// /// /// public static string StrToMD5(string str) { byte[] result = Encoding.Default.GetBytes(str.Trim());原创 2012-09-17 11:52:41 · 743 阅读 · 0 评论 -
Post和Get方式提交数据
/// /// post提交数据 /// /// /// /// private string PostWebRequest(string data, string url) { string result = string.Empty;原创 2012-09-21 10:47:05 · 619 阅读 · 0 评论 -
C# 检查文件是否正在使用
/// /// 检查文件是否正在使用 /// /// /// public static bool IsFileInUse(string fileName) { try { bool inUse = true;原创 2012-09-14 09:33:21 · 763 阅读 · 0 评论 -
C# 获取字符串长度(一个汉字算两个字节)
/// /// 获取字符串长度,一个汉字算两个字节 /// /// /// public static int GetLength(string str) { if (str.Length == 0) return 0; ASCIIEncoding原创 2012-09-14 09:35:02 · 1178 阅读 · 0 评论 -
一秒钟控制25个计算量的方法
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static int totalCount = 0; static int co原创 2012-09-13 13:31:02 · 1499 阅读 · 0 评论 -
C# 条件运算符
语法:condition ? first_expression_r : second_expression_r;说明:当 condition 为 true 时,返回 first_expression_r,否则返回 second_expression_r。有些参考书上说 ?: 等价于如下语句:if (condition){ first原创 2012-08-28 15:30:35 · 653 阅读 · 0 评论