Try the New Azure .NET SDK

Recently, Microsoft unveiled a new Azure .NET SDK, it's not a simple version upgrade, but a major change in the programming experience. While it may take a while to adapt to the new SDK, it is worth learning. The new SDK is more powerful, more flexible and easier to use. Current Status of Azure .NET SDKs Currently, the official packages for .NET SDKs for Azure are confusing and unfriendly to …

.NET Azure SDK

About Per Monitor-DPI aware for WinForms Applications

WinForms is the traditional .NET desktop application workload running on Windows. For historical reasons, there are some problems with its support for high DPI and for different DPI screens, and this article explores the possible solutions. Windows "96" PPI history The default DPI for Windows systems (more precisely called PPI) is 96. PPI means pixel per inch, which means how many pixels are …

.NET WinForm DPI


自从有了.NET4.5,我们又多了一个装逼语法:async/await,可以写出优越感然后进一步鄙视Java。然而,有时候一些老的API只提供了基于事件的异步方法,没有提供返回Task的异步方法,影响我们的逼格,怎么办呢? 就像Windows Phone 8的webclient,只提供了基于事件的DownloadStringAsync方法,写的时候就像这样: var client = new WebClient(); client.DownloadStringCompleted += (s, e) => { ... }; client.DownloadStringAsync(...); 为了保住我们的逼格,大微软早就为我们提供了解决方法:TaskCompletionSource,非常适合把基于事件的异步封装成Task方法。这个类型返回是一个可以被await的Task,事件 …

.NET Async await

如何手动将一个普通.NET类库转换成可移植类库(Portable Class Library)

可移植类库是.NET程序员装逼的必备良药,至于它有多牛逼,我也不知道,大家可以自己看一下 http://msdn.microsoft.com/en-us/library/vstudio/gg597391%28v=vs.110%29.aspx 但是万一你装逼的时候手一滑,建成了一个普通的Class Library肿么办?普通青年的做法是删掉再建一个,这当然是OK的。但是,作为文艺青年,我们可以继续装逼:自己动手把这个类库转换成Portable Class Library。 为了演示,我先建一个普通的.NET类库:AVeryNBClassLibrary 在这个项目的属性页里面,自然是看不到Portable Class Library的选项的。 接下来,在项目上点右键,选择Unload Project,然后再次右键选择Edit AVeryNBClassLibrary.csproj。细心的观众 …


  • 1