
.net
文章平均质量分 62
yangzhenping
我坚信让我一往无前的唯一力量就是我热爱我所做的一切!
展开
-
【dotnet跨平台】微软昨天宣布正式发布.NET Core RC2和.NET Core SDK Preview 1,还有Entity Framework Core RC2
【dotnet跨平台】微软昨天宣布正式发布.NET Core RC2和.NET Core SDK Preview 1,还有Entity Framework Core RC2期待已经的版本终于在昨天发布了微软昨天宣布正式发布.NET Core RC2和.NET Core SDK Preview 1:https://blogs.msdn.microsoft.com/dotnet/2016/05/16/announcing-net-core-rc2/微软昨天宣布正式发布Entity Framework原创 2016-05-17 15:34:27 · 10766 阅读 · 0 评论 -
ServiceStack.Redis——Redis在.net上的客户端解决方案
ServiceStack.Redis——Redis在.net上的客户端解决方案源码及使用:https://github.com/ServiceStack/ServiceStack.Redis例子:https://github.com/ServiceStack/ServiceStack.Examples/tree/master/src/RedisStackOverflow上面的例子中container.Register<IRedisClientsManager>(c => new PooledRed原创 2015-03-20 17:54:04 · 15393 阅读 · 0 评论 -
OOP已死,AOP为未来而生(.net+java)
OOP已死,AOP为未来而生未来用于构建复杂的基于服务的应用将是面向方面编程AOP(Aspect-Oriented Programming),而面向对象编程OOP将成为辅助。•控制反转(IOC:Inversion of Control)模式。这个通用模式描述为支持插件架构,其中的对象可以“查询”,他们需要的其他对象的实例方法。•依赖注入(DI:Dependency Injection)模式。这是IoC模式一种特殊情况,是基于改变类行为的接口编程技术,而不改变类的内部。开发人员针对为类的接口编码,并使原创 2015-03-16 14:19:42 · 1942 阅读 · 0 评论 -
网站安全攻击和防御中的屏蔽代理服务器
网站安全攻击和防御中的屏蔽代理服务器网站安全一直是个重要话题,本人写了网络攻防的屏蔽代理服务器相关代码,分享下:原创 2014-12-05 11:09:25 · 4852 阅读 · 0 评论 -
写个页面检查阿里云的账号是否存在
写个页面检查阿里云的账号存在与否之前无聊写了个阿里云账号注册的页面,主要是检查账号是否存在,现在分享下:主要通过webrequest实现:原创 2014-12-05 10:54:00 · 3277 阅读 · 0 评论 -
Asp.net MVC 4 动作方法结果
Action Method Result动作方法结果ActionResultgeneric return value for an action and is used to perform a framework-level operation on behalf of the action method.通用的返回值的一个动作,是用来代表的动作方法执行框架级操作原创 2013-09-29 19:16:31 · 2574 阅读 · 0 评论 -
C#3。0 集合
实现IEnumerable伴随一个迭代:public class MyGenCollection : IEnumerable{ int[] data = {1, 2, 3}; public IEnumerator GetEnumerator() { foreach (int i in data) yield return i; } IEnumera原创 2013-09-29 16:37:13 · 1570 阅读 · 0 评论 -
Asp.net MVC 4 模型的数据注释
[Bind(…)]Lists fields to exclude or include when binding parameter or form values to model properties列表字段时,排除或包括绑定参数或表单模型属性值[Compare("…")]To compare two properties.对比两个属性。[Credit原创 2013-09-29 14:59:50 · 3354 阅读 · 0 评论 -
ASP.NET MVC 4 Attribute特性
Attributes特性[AcceptVerbs(…)]To specify HTTP verbs an action method will respond to.要指定HTTP动词的将响应的一个操作方法。[ActionName(…)]To define the name of an action定义一个动作的名称[Additional原创 2013-09-29 12:44:53 · 2277 阅读 · 0 评论 -
快速预览:C# 3.0的新东西
Lambda 表达式:Func doubleAppend= x => x + x;Console.WriteLine (doubleAppend(“test”)); // testtestLINQ 查询:string[] names = { "Tom", "Dick", "Harry" };IEnumerable filteredNames = Enumerable.Whe原创 2013-09-28 22:58:15 · 1454 阅读 · 0 评论 -
C# 3.0 其他XML技术
使用XmlReader枚举结点: Jim BoXmlReaderSettings settings = new XmlReaderSettings();settings.IgnoreWhitespace = true;using (XmlReader reader = XmlReader.Create ("customer.xml", settings)) while原创 2013-09-29 16:55:22 · 2121 阅读 · 0 评论 -
Asp.net MVC 4 Html帮助类 II
Html Helpers@Html.AntiForgeryTokenIt generates a hidden form field (anti-forgery token) that is validated when the form is submitted.它会产生一个隐藏的表单字段(防伪标记),提交表单时验证。@Html.AttributeEnco原创 2013-09-29 18:27:08 · 3514 阅读 · 0 评论 -
6种.net分布式缓存解决方案
6种.net分布式缓存解决方案1. 使用内置ASP.NET Cache (System.Web.Caching) : https://msdn.microsoft.com/en-us/library/system.web.caching(v=vs.110).aspx2. 使用System.Runtime.Caching: https://msdn.microsoft.com/en-us/library/system.runtime.caching(VS.100).aspx3.原创 2015-03-13 17:53:05 · 11581 阅读 · 4 评论 -
Asp.net跨站脚本攻击XSS实例分享
Asp.net跨站脚本攻击XSS实例分享原创 2015-10-10 15:31:15 · 6794 阅读 · 0 评论 -
【dotnet跨平台】你知道dnx run和dotnet run有什么区别吗?
你知道dnx run和dotnet run有什么区别吗?dotnet run是基于dotnet-cli项目:http://github.com/dotnet/cli,而dnx run是https://github.com/aspnet/dnx项目,dotnet run已经取代dnx run。dotnet run会编译出IL二进制文件和可执行文件放在磁盘上,而dnx run是直接在内存中编译和执行,不存储在磁盘上。参考:http://www.talkingdotnet.com原创 2016-03-29 17:26:54 · 2008 阅读 · 0 评论 -
【dotnet跨平台】谈一谈dotnet-cli开源社区的产品持续集成
【dotnet跨平台】谈一谈dotnet-cli开源社区的产品持续集成进入其中一个PR:https://github.com/dotnet/cli/pull/2580可以看到微软使用自己搭建的持续集成平台来保证产品和代码的质量,其中每一个即将整合代码到rel/1.0.0这个主分支的代码都要经过7个测试通过,其中2个windows平台,4个linux平台和一个OS X平台如下: Details Windows_NT x64 Release Build — Build finished. 6原创 2016-04-19 16:12:00 · 9878 阅读 · 1 评论 -
【dotnet跨平台】dotnet-cli典型场景
【dotnet跨平台】dotnet-cli典型场景1、启动一个控制台应用程序dotnet new myapp2、启动一个类库dotnet new mylib –type lib3、加入第三方依赖库到项目中dotnet pkg install Newtonsoft.Json –version 8.0.24、运行单元测试dotnet new tests –type xunit5、发布一个共享运行的控制台原创 2016-04-07 15:06:48 · 5040 阅读 · 0 评论 -
【dotnet跨平台】最新版dotnet-cli下的ASP.NET Core和asp.net mvc【RC2尝鲜】
【dotnet跨平台】最新版dotnet-cli下的ASP.NET Core和asp.net mvc【RC2尝鲜】【方法一,这个方法尝试失败了,请不要再次尝试】【方法二,这个方法成功,大家可以试试】原创 2016-04-03 15:12:25 · 4878 阅读 · 1 评论 -
当开源库碰到错误怎么办?
当开源库碰到错误怎么办?开源有个好处就是免费,但是使用开源项目经常会碰到各种问题,下面列举下我碰到的其中一个问题。项目中使用开源库:https://sshnet.codeplex.com/连接某台Linux机器时碰到下面的问题:Renci.SshNet.Common.SshAuthenticationException: No suitable authentication method found to complete 查了Google,各种修改方法,最后找到了解决方案:1.原创 2016-02-25 16:51:48 · 2167 阅读 · 2 评论 -
跨平台.NET Core--微软开源方向
跨平台.NET Core--微软开源方向微软宣布.net开源已经有一段时间了,新的跨平台的.net框架叫.NET Core.当前支持Windows/Linux/OSX/Docker,官网:https://dotnet.github.io/getting-started/.NET Core开发工具源码:https://github.com/dotnet/cli.NET Core源码:https://github.com/dotnetASP.NET Core 1.0: https://g原创 2016-02-25 12:53:22 · 5825 阅读 · 0 评论 -
【dotnet跨平台】"dotnet restore"和"dotnet run"都做了些什么?
【dotnet跨平台】"dotnet restore"和"dotnet run"都做了些什么?前言:关于dotnet跨平台的相关内容,可以参考:跨平台.NET Core--微软开源方向其中,.net core基础库叫CoreFX:https://github.com/dotnet/corefx,.net core运行时叫CoreCLR:https://github.com/dotnet/coreCLR, asp.net core各组件库:https://github.com/aspnet。在原创 2016-03-09 20:17:51 · 9244 阅读 · 4 评论 -
【dotnet跨平台】Asp.net 正在经历的变革
【dotnet跨平台】Asp.net 正在经历的变革Asp.net 正在经历一场变革,从官网:https://get.asp.net/ 我们可以看到多个版本的字眼如下:ASP.NET 4.6:过去一直在构建Web应用的技术(使用了Web Forms, MVC, Web API and SignalR)ASP.NET 5 RC:新的开源的,跨平台的,高可用的,轻量级框架的构建Web应用的技术。最上面写着横条Asp.net 5正在被重命名为Asp.net core 1.0,了解关于Asp.n原创 2016-04-01 16:48:53 · 1701 阅读 · 0 评论 -
【dotnet跨平台】VSCode Linux 32位和Linux 64位下载地址分享
【dotnet跨平台】VSCode Linux 32位和Linux 64位下载地址分享首先给个百度云的地址:http//pan.baidu.com/s/1qXPV5Ha 然后提供个微软某个cdn地址:https://az764295.vo.msecnd.net/stable/5b5f4db87c10345b9d5c8d0bed745bcad4533135/VSCode-linux-ia32-stable.ziphttps://az764295.vo.msecnd.net/stable/5b5f原创 2016-03-30 23:15:52 · 4744 阅读 · 0 评论 -
【dotnet跨平台】如何启用远程访问asp.net mvc 5网站并指定端口?
【dotnet跨平台】如何启用远程访问asp.net mvc 5网站并指定端口?按照这篇博客https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-app-using-vscode/搭建asp.net mvc 5网站之后默认的网站和端口是http://localhost:5000/ , 你用远程访问这台机器的网站是不会显示的,那么怎么解决?在项目下的project.json文件中的"c原创 2016-03-30 17:46:24 · 3297 阅读 · 0 评论 -
【dotnet跨平台】关于VS Code扩展和主题市场
【dotnet跨平台】关于VS Code扩展和主题市场如果你安装了VS Code:http://code.visualstudio.com/Docs/editor/setup 主页:https://code.visualstudio.com/那么你你可以了解下VS Code扩展和主题市场:https://marketplace.visualstudio.com/VSCode, 这上面有各种开发者开发的各种扩展(插件)和主题,你可以点击相应的页面,里面有安装命令,一般是按Ctrl+P,然后输原创 2016-03-30 15:07:53 · 3596 阅读 · 0 评论 -
【dotnet跨平台】Visual Studio Code常见问答
【dotnet跨平台】Visual Studio Code常见问答如果你没找到想要的问题答案,请看已知问题:https://github.com/microsoft/vscode/issues和我们的更新:https://code.visualstudio.com/Updates。1. VS Code和VS Community(社区版)有什么区别?VS Code是流线型代码编辑器,同时支持一些开发操作如调试,任务运行和版本控制。它的目标是提供开发者需要的工具,开发者需要一个快速的”原创 2016-03-30 14:48:17 · 4400 阅读 · 0 评论 -
Asp.net MVC 4 视图相关和其他
@{ Layout = “…”}To define layout page Equivalent to asp.net master-page要定义相当于ASP.NET母版页的页面布局@model To define strongly-typed model要定义强类型的模型@section { }To define named secti原创 2013-09-29 17:49:17 · 1726 阅读 · 0 评论 -
Asp.net MVC 4 Html帮助类
Html帮助类used to render (modify and output) HTML form elements用来渲染HTML表单元素(修改和输出)Html.ActionLink输出: ..Html.BeginForm输出: Html.CheckBox输出: Html.DropDownList输出: .. Html原创 2013-09-29 18:23:02 · 2024 阅读 · 0 评论 -
csc.exe
/out/target:exe/target:library/target:module/target:winexe Sample:Csc /target:exe TestApp.csCsc /t:exe TestApp.csCsc TestApp.cs Csc /r:System.Windows.Forms.dll TestApp.csCsc原创 2011-06-16 16:38:00 · 1607 阅读 · 0 评论 -
Process relationship command
C:/Windows/system32>netstat -b Active Connections Proto Local Address Foreign Address State TCP 10.195.174.54:3389 172.18.28.140:7342 ESTABLISHED TermSer原创 2011-06-16 16:58:00 · 1219 阅读 · 0 评论 -
BAT test
@echo offRem A batch file for SimpleCSharpApp.exeRem which captures the apps return value SimpleCSharpApp@if "%ERRORLEVEL%" == "0" goto success:fail echo This application has failed原创 2011-06-16 16:38:00 · 1801 阅读 · 0 评论 -
WSDL.EXE - Microsoft (R) Web Services Description Language Utility
Microsoft (R) Web Services Description Language Utility[Microsoft (R) .NET Framework, Version 4.0.30319.1]Copyright (C) Microsoft Corporation. All rights reserved. wsdl.exe - Utility t原创 2011-06-16 16:55:00 · 1479 阅读 · 0 评论 -
How to determine if a machine is localhost?
Dns.GetHostEntry(remote).HostName == Dns.GetHostEntry(“localhost”).HostName原创 2011-06-16 16:51:00 · 1256 阅读 · 0 评论 -
CLR, CTS and CLS
CLR(Common Language Runtime) managedCTS(Common Type System) Implement variable compatible type of COM and define the way of use user-defined type to extend types. Support all possible data type a原创 2011-06-16 16:34:00 · 1122 阅读 · 0 评论 -
Inconsistent accessibility: field type '...' is less accessible than field '...'
<br />Inconsistent accessibility: field type '...' is less accessible than field '...'<br /> <br />this means it's access is "internal". you can change it to "public", then it will be OK.原创 2010-11-24 14:41:00 · 4190 阅读 · 4 评论 -
.Net version and CLR
<br /> <br />Framework<br />CLR and Assemblies<br />Release<br />1.0 RTM<br />1.0.3705.0 <br /> Visual Studio .NET (aka VS.NET 2002)<br />1.0 SP1<br />1.0.3705.209<br /> <br />1.0 SP2<br />1.0.3705.288<br /> <br />1.0 SP3<br />1.0.3705.6018<br /> <br />1.1原创 2010-12-09 13:18:00 · 1343 阅读 · 0 评论 -
幻想中的微软技术
C#.NET核心编程与C#3.0/3.5的新特性C#从3.0开始尝试将静态语言和动态语言进行整合,微软吸收了很多动态语言的特长,并全新地改变了C#3.0/3.5的语法,提供了很多静态语言(比如Java)无法实现的高效开发体验。该课程主要是讲解C#.NET核心编程基础并推荐使用C#3.0/3.5的新语法特征替换原先的语法模型。方向:原创 2010-07-20 21:23:00 · 1351 阅读 · 0 评论 -
WPF改成xbap
除了将改成URI的路径也要做相应调整,在调试时和发布时都应该对应相应的路径,否则程序会因为找不到资源而出逻辑或者运行错误当然在xbap中,因为Page并非继承Window,所以其某些属性或者方法相对于WPF应用程序有别或者增减原创 2010-05-02 23:05:00 · 2836 阅读 · 0 评论 -
将各种媒体格式转换成XAML格式
http://www.wpftutorial.net/XAMLConverters.html Adobe Illustrator XAML Export Plugin Adobe Photoshop to XAML Converter Blender XAML Export Plugin Lightwave XAML Export Plugin Visio XAM原创 2010-05-04 15:55:00 · 2376 阅读 · 0 评论 -
Inheritance and polymorphism
sealed keyword.base keyword.protected keyword.Contain/delegate model(has-a relationship):Class A{}Partial class B{ protected A a=new A();}public partial class B{ protect原创 2011-06-16 16:41:00 · 1381 阅读 · 0 评论