1 土块123

尚未进行身份认证

我要认证

暂无相关简介

等级
TA的排名 29w+

添加上传图片前台显示

<table style="border-collapse:separate; border-spacing:100px 20px;"> <tr> <td>名称:</td> <td> <input id="foodname" type="text" /> </td> </tr...

2020-08-12 19:18:43

添加上传图片方法

private IWebHostEnvironment _hostEnvironment;public ValuesController1(IWebHostEnvironment hostEnvironment){_hostEnvironment = hostEnvironment;} [HttpPost] [Route("/ValuesController1/AddFood")] public int AddFood(string ff) { Fo.

2020-08-12 16:27:04

导出帮助类

using NPOI.HSSF.UserModel;using NPOI.SS.UserModel;using NPOI.XSSF.UserModel;using System;using System.Collections.Generic;using System.Data;using System.IO;/// /// 注意修改命名空间/// namespace WebApplicationMVC{public static class NPOIExcelHelper{//

2020-07-10 08:26:02

EF最新删除方法

public int Delete(int id){T t = new T();t = db.Set().Find(id);db.Set().Remove(t);return db.SaveChanges();}

2020-07-10 08:14:48

MVC控制器导出

public ActionResult ExportFile(){//判断是否有数据if (Session[“StuList”]!=null&& (Session[“StuList”] as List).Any()){var stulist = Session[“StuList”] as List;var dt = new DataTable();var props = typeof(StudentInfo).GetProperties();//添加列dt.Columns.

2020-07-09 21:13:26

MVC Dapper+缓存

1、MVC控制器using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace WebApplication37_MVC.Controllers{public class DefaultController : Controller{// GET: Defaultpublic ActionResult Index(){re.

2020-07-09 21:12:34

Redis缓存+Dapper,API方法

1、Dapper DAL层方法using System;using System.Collections.Generic;using System.Data.SqlClient;using System.Linq;using System.Text;using System.Threading.Tasks;using Dapper;using Model;namespace DAL{public class UserDAL{//显示public List Show(){u.

2020-07-09 21:01:07

导出API方法

[HttpGet]public int Export(string FileName=“123”){var users = user.GetUserInfos();var types = type.GetUTypes();List list = (from u in usersjoin t in types on u.TId equals t.TIdselect new AllModel(){UId = u.UId,UName = u.UName,UAge = u.UAge,TId

2020-07-08 20:48:33

添加显示分页修改反填MVC

1、控制器using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace WebMVC2.Controllers{public class UserController : Controller{// GET: Userpublic ActionResult Index(){return View();}public .

2020-07-08 20:44:18

上传和下载

1、//DAL层FileDAL类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Model;namespace DAL{public class FileDAL{/// /// 上传文件/// /// 文件模型/// public int OnLoad(FileInfo mod){str.

2020-07-08 14:12:46

EF迁移+应用

1、//NewDal类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace DAL.EF_CodHelper{public class NewDal where T:class,new(){Model1 db = new Model1();public List Show(){return d.

2020-07-08 10:29:07

dapper帮助类

using System;using System.Collections.Generic;using System.Configuration;using System.Data;using System.Data.Common;using System.Data.SqlClient;using System.Linq;using Dapper;namespace DAL{public class DapperHelper{/// /// 数据库连接字符串/// privat

2020-07-07 14:31:58

使用MVC + CacheManager,调用Redis实现数据存储操作

1//FileOperation控制器using Day18ExamRedisMVC.Models;using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace Day18ExamRedisMVC.Controllers{public class FileOperationController : Controller{AP.

2020-07-05 20:44:35

红包方法

控制台应用using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using ServiceStack.Redis;namespace testRedis{class Program{static void Main(string[] args){double totalAmount = 100;int num =

2020-06-30 19:56:17

EF迁移创库+使用

using System;using System.Collections.Generic;using System.Data.Entity;using System.Linq;using System.Reflection;using System.Web;namespace G6.EFCode.DALS{public class EFHelper where T:class,new(){MyContext db = new MyContext();//实例化一个上下文对象///

2020-06-30 19:49:58

分配权限前台ajax显示

@{Layout = null;}<meta name="viewport" content="width=device-width" /><title>Main</title><link href="~/Content/bootstrap.css" rel="stylesheet" /><script src="~/Content/jquery-3.3.1.js"></script><style>

2020-06-29 20:10:54

分配权限MVC DAL+控制器

using System;using System.Collections.Generic;using System.Linq;using System.Web;using Day13ExamMVC.Models;namespace Day13ExamMVC.DAL{public class UserDAL{/// /// 列表显示/// /// public List ShowUserRole(){string sql = @“select u.UId,UName,RName

2020-06-29 20:06:16

验证码

<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>图片验证码</title><canvas id="canvas" width="120" height="40"><.

2020-06-26 20:10:11

二维码,条形码,显示页面

@{Layout = null;}<meta name="viewport" content="width=device-width" /><title>Index</title><script src="~/Scripts/jquery-3.4.1.min.js"></script><script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>

2020-06-26 18:58:24

二维码,条形码MVC控制器

using System;using System.Collections.Generic;using System.Drawing;using System.IO;using System.Linq;using System.Web;using System.Web.Mvc;namespace G6.MVC.TwoCode.Controllers{public class CodeController : Controller{// GET: Codepublic ActionRe

2020-06-26 18:56:53

查看更多

勋章 我的勋章
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv3
    勤写标兵Lv3
    授予每个自然周发布7篇到8篇原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。