51CTO博客开发Coders' Text
using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Xinleda.Common; usin
开启codefirst迁移命令:Enable-Migrations -ContextTypeName BlogEntitiesBlogEntities(上下文,继承DbContext的那个类)更新数据库命令:Update-Database -Verbose新增变更类文件命令:Add-Migration AddBolgAddBolg(生成的文件名)Add-Migration AddBolg-Igno
1,参照一下T4模版2,赋值上面部分和下面部分公共函数理解说明--------------------------------引用命名空间模版<#=codeStringGenerator.UsingDirectives(inHeader: false)#> |using System;using System.Collections.Generic;-------------
<?xml version="1.0" encoding="utf-8" ?> <log4net> <!--<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender" >-
<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="unity" type="Microsoft.Practi
代码:using System; using System.Collections.Generic; using System.Linq; using System.Text; using Newtonsoft.Json;//引用命名空间 namespace ConsoleApplication3 {  
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; //Singleton设计模式(单实例) namespace ConsoleApplication6 {
js 获取标签name属性this.getAttribute("name") | document.getElementById(id).getAttribute('name')CSS操作背景图片background-size:100% 100%;background-size:cover;background-size:cover;background-size:auto;运行里敲:dcomcn
http://apix.sinaapp.com/weather/?city=钟祥
例子:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; namespace ConsoleAppli
*首先需要安装JQuery模板(右键引用->管理NuGet程序包->搜索jquery.templates->安装)--引用脚本<script type="text/javascript" src="@Url.Content("~/Scripts/jQuery.tmpl.min.js")"></script>--控制器代码:public Actio
1,标签<input type="text" data-autocomplete-source="@Url.Action("QuickSearch","Demo")" />2,需要引用样式和脚本<link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="Stylesheet" type="te
<div> <div class="bshare-custom"> <a title="分享到QQ空间" class="bshare-qzone"&
Monitor类与Lock语句相比,Monitor类的主要优点是:可以添加一个等待被锁定的超时值。缺点:开销非常大 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tas
1,自定义验证类:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ComponentModel.DataAnnotations; using System.Web.Mvc; namespa
字段与属性:字段通常都是为类的方法所使用,而属性则常用于表示类的状态(比如StringBuilder的 Length),类的能力(比如StringBuilder的 Capacity),方法进行的状态或者阶段 对象的原子性:对象的状态是一个整体,如果一个字段改变。其他的字段也要同时做出相应的改变。简单 的来说,就是要么不改,要么全改 对
===================Ajax.ActionLinkActionLink方法可以创建一个具有一步行为的锚标签。例如:给页面一个链接,点击链接在当前页面显示信息,而不是打开一个新的页面--视图代码:@Ajax.ActionLink("ajax",//页面链接名称 "GetAjax",//控制器中的方法 new AjaxOptions {
如果在线程之间共享数据,则可能会出现线程争用的问题1,局一个线程争用的例子:using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threadi
===========================Parallel.For()方法的取消(在1秒钟之后取消并行循环)using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
1,用Parallel.For()方法循环 class Program { static void Main(string[] args) &nb
1.启动任务 class Program { static void Main(string[] args)
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; namespace ConsoleApplicat
需引用命名空间:using System.Threading; static void Main(string[] args) {
===========================投票案例:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading
=======================================一、防止跨站脚本攻击(XSS) ①: @Html.Encode("<script>alert('123')</script>")编码后:<script>alert('123')</script&
一、性能监控的作用 性能监控可以用于获取关于应用程序的正常行为的一般消息,性能监控是一个强大的工具,有助于理解系统的工作负载,观察变化和趋势,尤其是运行在服务器上的应用程序 二、性能监控类(System.Diagnostics):PerformanceCounter类:监控计数与写入计数。还可以
一、如何禁止匿名访问1,配置Web.config文件 <authentication mode="Forms"> <forms loginUrl="~/Account/ZhangDi" timeout="2880"&nbs
EventLogEntryType 枚举(指定事件日志项的事件类型。) 成员名称说明Error<?xml:namespace prefix="[default]" xhtml="" ns="http://www.w3.org/1999/xhtml">错误事件。?xml:namespace>它指示用户应该知道的严重问题(通常是功能或数据的丢失)。Failure
--------------DisplayName:显示名称Order:排序(只针对 @Html.EditorForModel(),@Html.DisplayForModel())[Display(Name = "确认名称", Order = 10001)]--------------ScaffoldColumn隐藏属性(只针对 @Html.EditorForModel(),@Html.Displ
Copyright © 2005-2023 51CTO.COM 版权所有 京ICP证060544号