2019年10月30日

C#上传文件到WebAPI

摘要: 1 上传文件 <input type="file" id="file" /> 2 <input type="button" id="upload" value="上传文件" /> 3 4 <script> 5 //上传 6 $("#upload").click(function () { 7 var formData = new FormData(); 8 var file = document. 阅读全文

posted @ 2019-10-30 15:39 Oldmovie 阅读(7808) 评论(0) 推荐(0) 编辑

C# 导入

摘要: @*前台 1 /// 2 /// 导出Excel 3 /// 4 public void ExcelExprot() 5 { 6 //创建Excel文件的对象 7 NPOI.HSSF.UserModel.HSSFWorkbook book ... 阅读全文

posted @ 2019-10-30 15:36 Oldmovie 阅读(172) 评论(0) 推荐(0) 编辑

C# 解析Xml接口

摘要: 1 public string GetWeather() 2 { 3 string weatherXML = GetRequestData("http://flash.weather.com.cn/wmaps/xml/china.xml?spm=a2c4e.10696291.0.0.5c5019a4nz9oyZ&file=china.xml"); 4 XmlDocument xml = new X 阅读全文

posted @ 2019-10-30 13:58 Oldmovie 阅读(3111) 评论(0) 推荐(0) 编辑

C# 解析Json接口

摘要: 1 /// 2 /// 使用动态类型加载Json接口数据 提交到数据库 3 /// 4 /// 5 /// 6 public string A2(TestModel test) 7 { 8 HttpClient client = new... 阅读全文

posted @ 2019-10-30 13:48 Oldmovie 阅读(600) 评论(0) 推荐(0) 编辑

C# 类型转换

摘要: /// /// 将DataTable 转换为 List集合 /// /// /// /// public List DtToModel(DataTable dt) where T : class, new() { List list = ne... 阅读全文

posted @ 2019-10-30 13:43 Oldmovie 阅读(127) 评论(0) 推荐(0) 编辑

导航