C#
bug小能手-tp
主要从事asp.net 电费系统和天然气系统开发。
展开
-
关于C# Enum扩展方法的代码
public static class StringEnumExtension { public static string GetDescription(this T e) where T : IConvertible { string desc = string.Empty; if (e is Enum) { Type type = e....原创 2018-11-17 12:03:37 · 2303 阅读 · 1 评论 -
关于Asp.net WebAPI自定义验证并处理model,
获取客户端发来的数据方法: protected virtual string GetRequestFromData() { HttpContextBase context = Request.Properties["MS_HttpContext"] as HttpContextBase; if (context == null) re...原创 2018-11-17 12:16:36 · 944 阅读 · 0 评论 -
Asp.net WebForm 下载大文件代码记录
protected void DownloadFile(){ const long ChunkSize = 1024 * 100;//100K 每次读取文件,只读取100k string filepath = "F:\\Win桌面主题\\1501216057239.jpg"; string filename = System.IO.Path.GetFileName(filepath); usi...原创 2018-11-17 12:48:10 · 824 阅读 · 0 评论