![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
文章平均质量分 69
专注开发
我编程,我骄傲
展开
-
Log4Net 写入日志文件
步骤1:当然是添加 log4net.dll 的引用l原创 2014-11-25 16:30:01 · 661 阅读 · 1 评论 -
NopiHelper Excel导出 导入
先上一个Helper类:public class NopiHelper { public string DataTableToExcel(DataTable tempDataTable, string path, bool is2007 = true) { try { //创原创 2017-09-25 10:48:08 · 700 阅读 · 0 评论 -
MVC路由Route
控制器方法: public ActionResult Index(string controller, string action, int id) { ViewBag.Name1 = controller; ViewBag.Name2 = action; ViewBag.Name3 = id原创 2017-09-13 10:39:08 · 375 阅读 · 0 评论 -
WebApi生成接口文档
1.修改文件:Areas>HelpPage>App_Start>HelpPageConfig.cs config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));原创 2017-01-12 11:09:43 · 1865 阅读 · 0 评论 -
获取客户端Mac地址
/// /// 返回IP地址的MAC地址 /// /// /// /// /// /// [DllImport("Iphlpapi.dll")] private static extern int SendARP(Int32 dest, In原创 2016-09-05 14:44:09 · 399 阅读 · 0 评论 -
多查询条件的MVC分页
1、查询 @using (Ajax.BeginForm("方法", "控制器", new RouteValueDictionary { { "id", "" } }, new AjaxOptions() { HttpMethod = "Get",原创 2016-07-19 09:41:30 · 1690 阅读 · 0 评论 -
MVC复选框选中方法
1、Model类 public class News { public int ID { get; set; } public string Name { get; set; } }2、Controller返回数据 private List GetALL() { List li原创 2016-07-19 09:36:05 · 5337 阅读 · 0 评论 -
WebApi 跨域调用
1.WebAPI添加类库引用2.WebApiConfig添加config.EnableCors(new EnableCorsAttribute("*", "*", "*"));3.控制器示例 namespace WebApiTest.Controllers{ [EnableCors("*", "*", "*")] public class UserMode原创 2016-04-18 23:19:00 · 427 阅读 · 0 评论 -
模拟Http登录
class Program { //Cookie private static CookieContainer m_Cookie = new CookieContainer(); static void Main(string[] args) { try {原创 2016-05-24 10:28:49 · 790 阅读 · 0 评论 -
Mapper映射
Mapper.CreateMap();var borrowListReturn = Mapper.Map, List>(borrowList);原创 2015-09-09 16:07:41 · 520 阅读 · 0 评论 -
利用list的Contains判断是否包含
1.如果为实体类型//实体类型 var stu = new Student() {StudentId = 1, StudentName = "aaaaa"}; if (list.Contains(stu)) { Console.WriteLine("实体类型包含");原创 2015-06-23 11:15:51 · 13566 阅读 · 1 评论 -
ADO.NET 备份还原数据库
献给需要的人和我自己原创 2015-06-16 16:29:25 · 1314 阅读 · 0 评论 -
Chart 图表 柱图
以下是一些关于柱图的显示代码: MyChart.Series.Clear(); //Chart var series = new Series(); series.Label = "#VAL"; series.LegendText = "金额(单位:元)"; series.Color = Color.Green; series.YValueMembers原创 2015-03-16 13:37:19 · 984 阅读 · 0 评论 -
Chart 图表 饼图
以下是一些关于饼图的显示代码原创 2015-03-16 13:28:33 · 1235 阅读 · 0 评论 -
对象转化成键值对
控制台程序:class Program { static void Main(string[] args) { User u = new User(); u.name = "ahbool"; u.gender = "男"; u.age = "1";原创 2017-09-21 16:05:09 · 4574 阅读 · 0 评论