Posts
40
Comments
79
Trackbacks
0
Monday, April 16, 2012
Announcing Microsoft All-In-One Code Framework Sample Browser v5 - A Big Refresh with Expansion to 3500+ code samples, Favorite Searches, Flexibilities & More

Microsoft All-In-One Code Framework this morning is releasing a brand new version for its Sample Browser, which introduces a big search expansion to over 3500 quality code samples, the new Favorite Searches and Favorite Samples functions for managing your beloved samples, the integration of social media sharing, the enriched query conditions & more.  Its Zune-style user experience is still stunning.   This is a big refresh of Sample Browser since the last release half a year ago.  We sincerely hope that worldwide developers will love it!

Install: http://aka.ms/samplebrowser

Detailed Introduction: http://blogs.msdn.com/b/codefx/archive/2012/04/16/samplebrowserbigrefresh.aspx

image

image

 

Posted On Monday, April 16, 2012 8:06 PM | Feedback (0)
Tuesday, February 21, 2012
Launching "Sample of the Day" - Learn an amazing code sample every 24 hours
HomepageMicrosoft All-In-One Code Framework
Sample of the DayRSS Feed

Every day is an opportunity to learn something or discover something new.

Microsoft All-In-One Code Framework offers "Sample of the Day". "Sample of the Day" introduces one amazing code sample every 24 hours that demonstrates the most typical programming scenarios of different Microsoft technologies. If you are curious about and passionate for learning something new, follow the “Sample of the Day” RSS feed or visit the "Sample of the Day" homepage, and share your feedback with us onecode@microsoft.com.

Posted On Tuesday, February 21, 2012 1:52 PM | Feedback (1)
Wednesday, February 08, 2012
Microsoft All-In-One Code Framework 2012 January Sample Updates
Translate this page

A new release of Microsoft All-In-One Code Framework is available on Feb 6th. We expect that its 8 new code samples covering typical programming scenarios in Windows Azure, Directory Services, Hyper-V, TFS, WDK, and Windows SDK would ease your development work.

image

You can download the code samples using Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates.

If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage http://1code.codeplex.com/.

--------------------------------------------

New Windows Azure Code Samples

image

Configure SSL for specific page(s) while hosting the application in Windows Azure (CSAzureSSLForPage)

Download: http://code.msdn.microsoft.com/CSAzureSSLForPage-e844c9fe

The sample was written by Narahari Dogiparthi – Escalation Engineer from Microsoft.

While hosting the applications in Windows Azure, developers are required to modify IIS settings to suit their application requirements. Many of these IIS settings can be modified only programmatically and developers are required to write code, startup tasks to achieve what they are looking for. One common thing customer does while hosting the applications on-premise is to mix the SSL content with non-SSL content. In Windows Azure, by default you can enable SSL for entire site. There is no provision to enable SSL only for few pages. Hence, Narahari has written sample that customers can use it without investing more time to achieve the task.

Change AppPool identity programmaticall​y (CSAzureChangeA​ppPoolIdentity)

Download: http://code.msdn.microsoft.com/CSAzureChangeAppPoolIdentit-27099828

The sample was developed by Narahari Dogiparthi – Microsoft Escalation Engineer too.

Most of customers test their applications to connect to cloud entities like storage, SQL Azure, AppFabric services via compute emulator environment. If the customer's machine is behind proxy that does not allow traffic from non-authenticated users, their connections fail. One of the workaround is to change the application identity. This cannot be done manually for Azure scenario since the app pool is created by Windows Azure when it is actually running the service. Hence, Narahari has written sample customers can use to change the AppPool identity programmatically.

--------------------------------------------

New Directory Services Code Samples

image

Write / add SPN to user or computer account in AD (CSDsWriteAccou​ntSPN)

Download: http://code.msdn.microsoft.com/CSDsWriteAccountSPN-95c31397

Developed by Shaleen Thapa – Microsoft Support Escalation Engineer, this sample application demonstrates how to write/add Service Principal Name (SPN) to any user or computer account object in Active Directory. This sample must be run on domain environment and under the Domain Admin privileges. You can execute this sample by creating the exe via Visual Studio but it must be running under the domain admin credentials. Also this code must be running either on Domain controller or any one of the member servers.

Get User Group Membership in AD (VBGetUserGroup​InAD)

Download: http://code.msdn.microsoft.com/VBGetUserGroupInAD-a94dc080

Developed by Shaleen Thapa – Microsoft Support Escalation Engineer, this sample application demonstrates how to perform a search on the user’s group membership in Active Directory. This demonstrates the recursive looping method. Also it shows how to get the Object SID for the group.

We are using System.DirectoryServices namespace to perform a search on AD. We will be passing the distinguishedName of the domain with the username whose membership we would like to fetch.

Once we found the user, we will read the memberOF attribute’s value. It is one of the possibilities that the group can be member of another group as well; in this case we would need to do a recursive looping.

--------------------------------------------

New Hyper-V Code Samples

image

Clone Hyper-V VM Settings (CSHyperVCloneV​M)

Download: http://code.msdn.microsoft.com/CSHyperVCloneVM-81c4d648

Developed by Jithesh Nair – Microsoft Support Escalation Engineer, this sample demonstrates how to create VM from an existing VM template without copying the VHD file.

The existing methods of cloning VMs include exporting/importing the VM configuration along with VHD. If the VHD size is larger this method of cloning takes too much of times. There are scenarios where the customers wanted to creates VMs programmatically from an existing template. This sample demonstrates how one can use WMI and C# for cloning VMs without copying VHD.

--------------------------------------------

New TFS Code Samples

image

Add CheckOut Event to TFS (CSTFSAddCheckO​utEventType)

Download: http://code.msdn.microsoft.com/CSTFSAddCheckOutEventType-673d0536

Developed by Ruiz Yi – Sample Writer of Microsoft All-In-One Code Framework, the sample demonstrates how to enable checkout notification in TFS2010. In TFS2010, when a user sends a Check out (PendChanges) request to server, the server will send a PendChangesNotification before the items are checked out. If we subscribe this notification, we can do following things:

  1. Deny the request.
  2. Fire the custom CheckOut event. NOTE: As this notification is sent before the items are checked out, we can only know someone is trying to checkout some items.

--------------------------------------------

New WDK Code Samples

Virtual Device Driver (WDKRamDisk)

Download: http://code.msdn.microsoft.com/WDKRamDisk-c3322885

Developed by Bart Bartel – Microsoft Senior Escalation Engineer, this is the Ramdisk sample driver. This version of the driver has been modified to support the driver frameworks. This driver basically creates a nonpaged pool and exposes that as a storage media. User can find the device in the disk manager and format the media to use as FAT or NTFS volume. In addition, this version of Ramdisk integrates with Mount Manager, so that it is not necessary for you to assign a drive letter, the system will do this automatically.

--------------------------------------------

New Windows SDK Code Samples

List process type information for all running processes (CppCheckProces​sType)

Download: http://code.msdn.microsoft.com/CppCheckProcessType-1f81439d

Developed by Amit Dey – Microsoft Software Development Engineer, this sample code lists process type information for all running processes. like:

  • Is a Console Application or Is a Windows Application
  • Is a Managed Application or Is a Native Application
  • Is a .NET 4.0 Application
  • Is a WPF Application
  • Is a 64 Bit Application or Is a 32 Bit Application

image

If you have any feedback, please fill out this quick survey or email us: onecode@microsoft.comv

Posted On Wednesday, February 08, 2012 11:08 AM | Feedback (0)
Thursday, December 29, 2011
Microsoft All-In-One Code Framework December Sample Updates

Wishing a very happy and blessed New Year to you in advance!

A new release of Microsoft All-In-One Code Framework is available on December 29th. We expect that its 11 new code samples covering typical programming scenarios in Windows Phone 7, ASP.NET, WPF, Windows Shell, and WDK would ease your development in the coming New Year.

image

You can download the code samples using Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates.

If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage http://1code.codeplex.com/.

--------------------------------------------

New Windows Phone 7 Code Samples

image

Story Creator Sample Application for Windows Phone 7 (CSWP7AzureVideoStory)

Download: http://code.msdn.microsoft.com/CSWP7AzureVideoStory-2b9c3e12

Developed by Yi-Lun Luo – a sample writer of Microsoft All-In-One Code Framework, CSWP7AzureVideoStory is a big sample application combing many hot technologies such as Windows Phone 7, Windows Azure, HTML5.

This sample solution is a story creator for Windows Phone 7. You can use it to create photo stories on your phone, and send the stories to a Windows Azure service to encode them into videos. The Windows Azure Service includes a REST service built with WCF Web API, a simple HTML5 browser client that allows you to see encoded videos, and a native component encodes videos using WIC and Media Foundation.

While individual pieces of technologies are very interesting, the true power comes when the platforms are combined. We know most developers need to work with the combined platform rather than individual technologies. So we hope this sample solution will be helpful to you.

image image

imageimage

--------------------------------------------

New ASP.NET Code Samples

image

Using Direct2D for Server-Side Rendering with ASP.NET (CSD2DServerSideRendering)

Download: http://code.msdn.microsoft.com/CSD2DServerSideRendering-2d099ab6
Developed by Greg Binkerd – Microsoft Senior Escalation Engineer

Some server applications need to render images and send back the generated bitmaps to users connected through web clients. For example, ASP.NET web applications that needs to generate user profile picture on the fly. We observed that many developers choose to use GDI+ and System.Drawing to generate those images, but actually GDI+ and System.Drawing are not supported in a service or web application. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions (see the “Caution” section in http://msdn.microsoft.com/en-us/library/system.drawing.aspx).

Direct2D is the appropriate technology for rendering images to a bitmap on disk in a service context. Direct2D is completely supported in the context of a service. This is a C# ASP.NET sample which demonstrates how to render a Direct2D scene to an image file on disk. It demonstrates how to create a Direct2D bitmap based on image data in memory, draw Direct2D objects, such as an Ellipse and a Rectangle, and it also demonstrates how to use DirectWrite to render text. The sample uses the Direct2D and DirectWrite assemblies from the Windows API Code Pack for Microsoft .NET Framework. These provide developers access to Direct2D and DirectWrite from managed code.

image

For more information on DirectWrite, see the MSDN DirectWrite documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/dd368038(v=vs.85).aspx

For more information on DirectWrite, see the MSDN DirectWrite documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/dd368038(v=vs.85).aspx

For more information on the Windows API Code Pack for Microsoft .NET Framework, see: http://archive.msdn.microsoft.com/WindowsAPICodePack

Maintain ASP.NET TreeView State (CS/VBASPNETMainta​inTreeViewState​)

Downloads
C# version: http://code.msdn.microsoft.com/CSASPNETMaintainTreeViewSta-c7673683
VB version: http://code.msdn.microsoft.com/VBASPNETMaintainTreeViewSta-01591ffc
Developed by Arwind Gao – Microsoft All-In-One Code Framework Sample Writer

The code-sample illustrates how to maintain TreeView's state across postbacks. The web application use session store the TreeView nodes' status and restore them in the next postback event. This interesting function can be used as the signs of the navigator bar.

image

Client templating with jQuery and JSON (CS/VBASPNETClient​TemplateJQueryJ​SON)

Downloads
C# version: http://code.msdn.microsoft.com/Client-templating-with-0c85db68
VB version: http://code.msdn.microsoft.com/VBASPNETClientTemplateJQuer-fac556f6
Developed by Arwind Gao – Microsoft All-In-One Code Framework Sample Writer

This project illustrates how to display a tabular data to users based on some inputs in ASP.NET application. We will see how this can be addressed with JQuery and JSON to build a tabular data display in web page. Here we use JQuery plug-in JTemplate to make it easy.

image

--------------------------------------------

New WPF Code Samples

WPF ListBox Validation (CSWPFListBoxVa​lidation)

Download: http://code.msdn.microsoft.com/CSWPFListBoxValidation-a3023d06
Developed by Jon Burchel – Microsoft Senior Escalation Engineer

The sample demonstrates how to add validation to a ListBox, overriding the control to contain a ValidationListener property, which can be bound to provide validation using built in validation UI features in WPF.

To run the sample, simply open in Visual Studio 2010 and run it. It contains a ListBox, which was overridden to include a property called ValidationListener, which is used to bind the ListBox to a property used for validation, and a validation rule. The validation property is simply a text field added to the Window, in which error text is written if the ListBox is found having no selected items. Of course the rule could be more complex as necessary, but this demonstrates the approach. When the form first displays, no items are selected, so it is not valid. Validation UI displays a red outline around it, and another label control is also validated using the same criteria, and is outlined in red as well, and displays the validation error message. Selecting any items validates the control. Removing all selections will again invalidate the control.

image

Search and Highlight Keywords in TextBlock (CS/VBWPFSearchAndHighlightTextBlockControl)

Downloads
C# version: http://code.msdn.microsoft.com/CSWPFSearchAndHighlightText-3b5e207a
VB version: http://code.msdn.microsoft.com/VBWPFSearchAndHighlightText-f9f2fe58
Developed by Jason Wang – Microsoft All-In-One Code Framework Sample Developer

The WPF code sample demonstrates how to search and highlight keywords in a TextBlock control. The sample includes a custom user control "SearchableTextControl" and its search method is used to demonstrate how to highlight keywords using System.Windows.Documents.Run and System.Windows.Documents.Incline.

image

--------------------------------------------

New Windows Shell Code Samples

Print an image using ShellExecute (CSShellPrintIm​ageWithShellExe​cute)

Download: http://code.msdn.microsoft.com/CSShellPrintImageWithShellE-adda9973
Developed by Jon Burchel – Microsoft Senior Escalation Engineer

The sample demonstrates how to print an image using ShellExecute to invoke ImageView_PrintTo, equivalent to right clicking on an image and printing. Using the printto verb with ShellExecute may have unpredictable effects since this may be configured differently on different operating systems. The approach demonstrated here invokes ImageView directly with the correct parameters to directly print an image to the default printer.

To run the sample, simply open in Visual Studio 2010 and run it. It simply prompts the user to select any image file, using the OpenFileDialog, and then uses ShellExecute to launch ImageView_PrintTo, exposed in shimgvw.dll, with rundll32.exe, and providing the necessary parameters to this function. This is more reliable than trying to use the Shell printto verb, which may or may not be configured for a particular file type, and so may not work for images.

--------------------------------------------

New WDK Code Samples

Enumerating and locating specific attach storage devices. (CppStorageEnum​)

Download: http://code.msdn.microsoft.com/CppStorageEnum-90ad5fa9
Developed by Bart Bartel – Microsoft Senior Escalation Engineer

The code sample demonstrates the use of DeviceIoControl and SetupDiGetClassDevs in the everyday operations of enumerating and locating specific attach storage devices. To run this sample, you need to install the Windows Driver Kit (WDK). After building the sample successfully, just press Ctrl + F5 to run it. Then you may see something like this:

image

In closing, I want to take opportunity to wish you and your family my best wishes for this Holiday Season. The Holiday season is always a special time when we can spend time with our family and friends. I wish all of you the very best for the upcoming New Year!

Thank YOU for your support of Microsoft All-In-One Code Framework!

Posted On Thursday, December 29, 2011 6:47 PM | Feedback (0)
Tuesday, October 04, 2011
Microsoft All-In-One Code Framework Sample Browser v4 Released – A New Way to Enjoy 700 Microsoft Code Samples

image

Today, we reached a new milestone of Microsoft All-In-One Code Framework. It gives me great pleasure to announce our newest Microsoft All-In-One Code Framework Sample Browser - v4 available to the globe. With this release, we embrace the hope of giving global developers a completely new and amazing experience to enjoy over 700 Microsoft code samples.

Compared with the previous version, this new version of Sample Browser is completely redesigned from tip to toe. We heard lots of users’ voices about how we can do better. So in Sample Browser v4, its user interface, sample search and download experience have numerous changes. I hope that you will love our effort here.

Install: http://aka.ms/samplebrowser
If you have already installed our last version of Sample Browser, you simply need to restart the application. You will get the auto-update.

image

The main user interface of the Sample Browser is composed of three columns.

The left column is the search condition bar. You can easily enter the query keywords and filter the result by Visual Studio versions, programming languages, and technologies. The search history is recorded so you can resort to your past search with a single simple click.

In the middle, the sample browser lists the sample search result. We added the display of the customer ratings and the number of raters. We also integrated social media so that you can quickly share certain samples in your network – you are highly encouraged to do it! You can selectively download the samples, or download all samples after the search is completed.

image

All downloading samples are queued. You can find their download status by clicking the “DOWNLOADING” button.

image

If an update is available for the sample, your will be reminded to get the sample update. The sample download and cancel are very flexible. Enjoy the flexibility! :-)

The right column of Sample Browser displays the most detailed information of the selected code sample. You can learn all properties of the sample before you decide to download it, read the sample documentation, and in the near future, we will add the “social” feature that allows you to learn what people are saying about the sample in the social network.

Besides the above features, we added another heatedly requested one: NEWEST samples. If you click NEWEST, the search result displays samples released in the past two months. Clicking it again will cancel the NEWEST filter.

image

 

The Sample Request Service page introduces how you can request a code sample directly from Microsoft All-In-One Code Framework if you cannot find the wanted sample in Sample Browser. The service is free of charge!

image

Last but not least, here is the settings page, where you can configure the sample download location and the network proxy.

image

 

We love to hear you feedback. Your feedback is our source of passion. Please try the Sample Browser and tell us how you think about it. Our email address is onecode@microsoft.com

 

What’re Coming Soon?

We never stop improving the Sample Browser! Here are the features that are coming soon this year.

  1. Visual Studio Integration
    We will upgrade the old version of Sample Browser Visual Studio extension to the new, so you can enjoy the same experience from within Visual Studio!
  2. Expanding to all MSDN Samples Gallery samples
    Today, the Microsoft All-In-One Code Framework Sample Browser searches for only Microsoft All-In-One Code Framework code samples. We will start to expand the scope to all samples in MSDN Samples Gallery.
  3. Add the "social" feature in the details panel to allow you to see the discussion of a sample in the social network
    image
  4. Add the "FAVORITES" feature to allow you to tag certain samples as your favorites.
  5. Add the "MINE" to allow you to add your PRIVATE samples to Sample Browser.
  6. Add the offline search function – index the downloaded samples and allow you to search samples offline.
  7. Integrate the MSDN Samples Gallery Sample Request Forum with the Sample Browser

 

Special Thanks

First of all, special thanks to all customers who provided feedback to onecode@microsoft.com. Your feedback helped us understand where we can do better than the last version, and we will do better and better thanks to your suggestions!

This new version of Sample Browser is written by our developer Leco Lin who put lots of effort on it. Our tester Qi Fu tested the application and strangled the bugs. Jialiang Ge designed the features and functions of the Sample Browser. The UI is worked out by Lissa Dai and Jialiang together. Special thanks to Anand Malli who reviewed the source code of Sample Browser and shared lots of suggestions. Special thanks to Ming Zhu and Bob Bao who gave seamless technical support of WPF to Leco and smoothened the development. Special thanks to the Garage – a Microsoft internal community of over twenty-three hundred employees who like building innovative things in their free time. These people gave us many ideas about the Sample Browser. Special thanks to Mei Liang and Dan Ruder for their supports and suggestions. They will next introduce the sample browser to other teams in Microsoft and collect feedback. Last but not least, I want to particularly thank Steven Wilssens and his MSDN Samples Gallery team. This team created the amazing MSDN Samples Gallery – the host of all samples. We have a beautiful partnership, and we together make the idea of Sample Browser come true.

Posted On Tuesday, October 04, 2011 9:04 AM | Feedback (2)
Wednesday, July 13, 2011
New code sample release from Microsoft All-In-One Code Framework in July

A new release of Microsoft All-In-One Code Framework is available on July 13th.  We expect that its 17 new code samples would reduce developers’ efforts in solving the following typical programming tasks.

Download address: http://1code.codeplex.com/releases/view/69942

Alternatively, you can download the code samples using Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates.

image

If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, and read the introduction on our homepage http://1code.codeplex.com/.

-------------------------------------------

New Windows Driver Kit (WDK) Code Samples

Bart Bartel (Microsoft Senior Escalation Engineer) and his great team members are continuing their efforts to ease Windows Driver developers’ lives with the customer-driven WDK samples.

CppVDSFormatVolume

Download: http://code.msdn.microsoft.com/CppVDSFormatVolume-c84cb6f2

This code sample demonstrates how to use Virtual Disk Service (VDS) to format volumes.  The sample takes the volume number and the target file system type as user input:

CppVDSFormatVolume.exe [-options]...
   -v <volume number (decimal)> REQUIRED INPUT
   -t <target file system type: NTFS, FAT32, etc.> UPPER CASE ONLY, REQUIRED INPUT
   e.g.: CppVDSFormatVolume.exe -v 3 -t NTFS

The sample project tries to find the volume based on the volume number, and format the volume with the specified file system type.

You should use this sample with care because formatting a volume may lead to potential data loss.  You can try out this sample with a useless USB drive.

CppVDSUninstallDisks

Download: http://code.msdn.microsoft.com/CppVDSUninstallDisks-7192ea26

This code sample demonstrates how to use Virtual Disk Service (VDS) to uninstall disks and volumes.  The sample project takes the disk number as user input and performs a complete uninstall, including the dismount of the volume and uninstall underlying disks.

You should use this sample with care because uninstalling a disk may lead to potential data loss.

CppVhdAPI

Download: http://code.msdn.microsoft.com/CppVhdAPI-4412d182

The code sample demonstrates various Windows 7 Virtual Hard Disk (VHD) API usage, such as VHD creation, attaching, detaching and getting and setting disk information.

The code sample must be run on Windows 7 / Windows Server 2008 R2 or newer.  The minimum supported client of the VHD APIs is Windows 7; and the minimum supported server of the VHD APIs is Windows Server 2008 R2.

The sample project takes the following commands as user input.

image

 

-------------------------------------------

New Windows Azure Code Samples

CSAzureWebRoleIdentity

Download: http://code.msdn.microsoft.com/CSAzureWebRoleIdentity-004bc8dd

CSAzureWebRoleIdentity is a web role hosted in Windows Azure. It federates the authentication to a local STS. This breaks the authentication code from the business logic so that web developer can offload the authentication and authorization to the STS with the help of WIF.

This code sample is created to answer a hot Windows Azure sample request: webrole-ADFS authentication with over 25 customer votes.

 
-------------------------------------------

New Silverlight Code Samples

CSSL4SessionCookie

Download: http://code.msdn.microsoft.com/CSSL4SessionCookie-be844333

Written by Jon Burchel – a senior support escalation engineer in Microsoft, this sample demonstrates a simple technique to preserve ASP.NET session ID from a web page hosting a Silverlight component making a client WebRequest to another web page on the same site.  Normally, the WebRequest will not by default preserve session id, and this can be frustrating for a Silverlight developer.  But by appending the Session ID cookie manually to the request, passing it into the Silverlight component through a parameter on the calling web page, the session can in fact be preserved.

image

 

-------------------------------------------

New Windows General Code Samples

CSTiffImageConverter

Download: http://code.msdn.microsoft.com/CSTiffImageConverter-92ac2358

This sample demonstrates how to convert JPEG images into TIFF images and vice versa. This sample also allows to create single multipage TIFF images from selected JPEG images.

TIFF (originally standing for Tagged Image File Format) is a flexible, adaptable file format for handling images and data within a single file, by including the header tags (size, definition, image-data arrangement, applied image compression) defining the image's geometry. For example, a
TIFF file can be a container holding compressed (lossy) JPEG and (lossless) PackBits compressed images. A TIFF file also can include a vector-based clipping path (outlines, croppings, image frames).

image

CSHexStringByteArrayConverter, VBHexStringByteArrayConverter

Downloads
C# version: http://code.msdn.microsoft.com/CSHexStringByteArrayConvert-a80e955d
VB version: http://code.msdn.microsoft.com/VBHexStringByteArrayConvert-be271820

This sample demonstrates how to convert byte array to hex string and vice versa. For example,

   "FF00EE11" <--> { FF, 00, EE, 11 }

image

CSImageFullScreenSlideShow, VBImageFullScreenSlideShow

The sample demonstrates how to display image slideshow in a Windows Forms application.  It also shows how to enter the full screen mode to slide-show images.

image

 

------------------------------------------------

New ASP.NET Code Samples

CSASPNETControlPermissionForFiles, VBASPNETControlPermissionForFiles

Downloads
C# version: http://code.msdn.microsoft.com/CSASPNETControlPermissionFo-8ed8306b
VB version: http://code.msdn.microsoft.com/VBASPNETControlPermissionFo-a67f4b12

The project illustrates how to control the permission for project files and folders on server, and protect them from being downloaded. Here we give a solution that when the web application receive a URL request, we will make a judgment that if the request file's extension name is not .jpg file then redirect to NoPermissionPage page. Also, user can not access the image file via copy URL.

image

CSASPNETFixedHeaderGridView, VBASPNETFixedHeaderGridView

Downloads
C# version: http://code.msdn.microsoft.com/CSASPNETFixedHeaderGridView-9782c89b
VB version: http://code.msdn.microsoft.com/VBASPNETFixedHeaderGridView-7b359f7d

As we know, GridView usually has many rows with a vertical scroll bar. When users scroll using vertical bar, the header of the GridView will move and disappear. This sample illustrates how to fix the header of GridView via JQuery, and this approach can also cross multiple browsers at client side.

image

CSASPNETDisableScriptAfterExecution. VBASPNETDisableScriptAfterExecution

Downloads
C# version: http://code.msdn.microsoft.com/CSASPNETDisableScriptAfterE-8bf228fd
VB version: http://code.msdn.microsoft.com/VBASPNETDisableScriptAfterE-7b6d469c

The sample code illustrates how to register script code at code behind and to be disabled after execution. Sometimes users who register scripts do not want them execute again, Actually they with to achieve this either in an automatic manner or by imitating an action for example, by clicking a link or button. This maybe due to functional purpose, user experience or security concerns.

CSASPNETShowSpinnerImage, VBASPNETShowSpinnerImage

Downloads
C# version: http://code.msdn.microsoft.com/CSASPNETShowSpinnerImage-d7ac1552
VB version: http://code.msdn.microsoft.com/VBASPNETShowSpinnerImage-53ce1d10

This project illustrates how to show spinner image while retrieving huge amount of data. As we know, handle a time-consuming operate always requiring a long time, we need to show a spinner image for better user experience.

 

--------------------------------------------

New TFS Code Samples

CSTFSWorkItemLinkInfoDetails, VBTFSWorkItemLinkInfoDetails

Downloads
C# version: http://code.msdn.microsoft.com/CSTFSWorkItemLinkInfoDetail-d141169b
VB version: http://code.msdn.microsoft.com/VBTFSWorkItemLinkInfoDetail-e22ecdfd

The sample demonstrates how to get the link details of a WorkItemLinkInfo object.  The detailed information is like :

Source:[Source title] ==> LinkType:[Link Type] ==> Target:[Target title]

 

If you have any feedback, please fill out this quick survey or email us: onecode@microsoft.com

Posted On Wednesday, July 13, 2011 11:38 PM | Feedback (3)
Thursday, July 07, 2011
Check out the new All-In-One Code Framework demo in Channel 9

Mei Liang - one of the owners of All-In-One Code Framework was interviewed by Robert Green - the famous host in Channel 9 Visual Studio Toolbox, to introduce All-In-One Code Framework and demonstrate Sample Browser Visual Studio extension.

http://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Visual-Studio-Toolbox-All-In-One-Code-Framework

All-In-One Code Framework Sample Browser and Sample Browser Visual Studio Extension give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates.

Sample download and management was a pain to many developers. In the past, developers download various samples to their local folders. They would easily forget where the sample was downloaded, and have to download the sample again and again. Now, Sample Browser allows you to download code samples with a single click. It automatically manages all downloaded samples in a centralized place. If a sample has already been downloaded, Sample Browser displays the "Open” button next to the code sample. If an update becomes available for a code sample, an [Update Available] button will remind you to download the updated code sample.

You can try out Sample Browser and Sample Browser Visual Studio extension from the following links:
http://1code.codeplex.com/releases/view/64539
http://visualstudiogallery.msdn.microsoft.com/4934b087-e6cc-44dd-b992-a71f00a2a6df

At the end of July, you will see a new version of the Sample Browsers with many novel features. Please follow up in twitter, facebook or the blog RSS feed to get the first-hand news. You are also welcome to email onecode@microsoft.com and tell us your suggestions.

Posted On Thursday, July 07, 2011 10:49 PM | Feedback (8)
Monday, July 04, 2011
All-In-One Code Framework surpasses 1,000,000 downloads!

We are proud to announce the arrival of a key milestone through the All-In-One Code Framework project. With strong partnership, dedication and commitment, and big supports from the community, All-In-One Code Framework has now exceeded its Fiscal Year 2011 target of 1 million downloads - 10 times over our last year's download number!

All-In-One Code Framework reduces the efforts of developers in solving typical programming tasks. Sample codes are made available for download; reducing the time developers need to create commonly used codes. Every single sample code reduces the efforts of developers worldwide.

We want to share our gratitude for the strong supports from our customers and the developer communities such as MSDN, CodePlex, CSDN, and cnblogs. We want to thank IT media such as Softpedia, Microsoft News Center, MSDN news flash and social media, for helping us spread the word. We also appreciate the seamless partnership with over 8 business groups in Microsoft. This would not have been possible without them.

In Fiscal Year 12, we are preparing lots of new features, expansions, improvements and innovations around this project. We look forward to another outstanding year.

 

All-In-One Code Framework Team

 

----------------------
① Fiscal Year 2011 in Microsoft starts from July 2010 to June 2011

Posted On Monday, July 04, 2011 11:00 PM | Feedback (4)
Tuesday, April 19, 2011
Introducing 14 new ASP.NET and Azure code samples released in April

A new release of Microsoft All-In-One Code Framework is available on April 16th. This blog introduces 14 ASP.NET and Azure code samples in the release. The rest new samples will be introduced next week.

Download address: http://1code.codeplex.com/releases/view/64551

Alternatively, you can download the code samples using Sample Browser v3. The new Sample Browser gives you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about new releases.

If it’s the first time that you hear about Microsoft All-In-One Code Framework, please read this Microsoft News Center article http://www.microsoft.com/presspass/features/2011/jan11/01-13codeframework.mspx, or watch the introduction video on YouTube http://www.youtube.com/watch?v=cO5Li3APU58, or read the introduction on our homepage http://1code.codeplex.com/.

---------------------------------------

New Azure Code Samples

CSAzureWorkflowService4, VBAzureWorkflowService4

Downloads
CSAzureWorkflowService4: http://code.msdn.microsoft.com/CSAzureWorkflowService4-2519c571
VBAzureWorkflowService4: http://code.msdn.microsoft.com/VBAzureWorkflowService4-62a20440

This sample demonstrates how to run a WCF Workflow Service on Windows Azure. It uses Visual Studio 2010 and WF 4. While currently Windows Azure platform AppFabric does not contain a Workflow Service component, WCF Workflow Services can be run directly in a Windows Azure Web Role. By default, a Web Role runs under full trust, so it supports the workflow environment.

The workflow in this sample contains a single Receive activity. It compares the service operation's parameter's value with 20, and returns "You've entered a small value." or "You've entered a large value.". The client application invokes the Workflow Service twice, passing a value less than 20, and a value greater than 20.

---------------------------------------

New ASP.NET Code Samples

CSASPNETReverseAJAX, VBASPNETReverseAJAX

Downloads
CSASPNETReverseAJAX: http://code.msdn.microsoft.com/CSASPNETReverseAJAX-7a1f0c2b
VBASPNETReverseAJAX: http://code.msdn.microsoft.com/VBASPNETReverseAJAX-321a68b0

Reverse Ajax is also known as Comet Ajax, Ajax Push, Two-way-web and HTTP server push. This technique persists a HTTP request to allow the server push data to a browser, without requesting the server in an individual time. This sample shows how to use this technique in ASP.NET Ajax.

CSASPNETAutoLogin, VBASPNETAutoLogin

Downloads
CSASPNETAutoLogin: http://code.msdn.microsoft.com/CSASPNETAutoLogin-25cfae2b
VBASPNETAutoLogin: http://code.msdn.microsoft.com/VBASPNETAutoLogin-023c5ab4

The code sample demonstrates creating an ASP.NET web application that supports user login using HttpWebRequest Class without manually filling out username and password textboxes. In the code sample, the Login.aspx page implements the normal login, and the AutoLogin.aspx page implements the programmatic login.

VBASPNETInfiniteLoading

Download: http://code.msdn.microsoft.com/VBASPNETInfiniteLoading-10c3f379

Infinite scroll, has also been called autopagerize, unpaginate, endless pages. But essentially it is pre-fetching content from a subsequent page and adding it directly to the user’s current page. The code sample demonstrates loading a large number of data entries in an XML file. It support infinite scroll with the AJAX technology.

CSASPNETLimitDownloadSpeed, VBASPNETLimitDownloadSpeed

Downloads
CSASPNETLimitDownloadSpeed: http://code.msdn.microsoft.com/CSASPNETLimitDownloadSpeed-819f5d04
VBASPNETLimitDownloadSpeed: http://code.msdn.microsoft.com/VBASPNETLimitDownloadSpeed-fe1dc09a

This project illustrates how to limit the download speed via coding. If you have installed IIS 7.0 we strongly recommend you use the Bit Rate Throttling feature instead of what this code sample demos to limit the download speed. Please refer to http://www.iis.net/download/BitRateThrottling.

CSASPNETServerClock, VBASPNETServerClock

Downloads
CSASPNETServerClock: http://code.msdn.microsoft.com/CSASPNETServerClock-23c659d4
VBASPNETServerClock: http://code.msdn.microsoft.com/VBASPNETServerClock-aff6fbca

This project illustrates how to get the time of the server side and show it to the client page. Sometimes a website needs to show a unified clock on pages to all the visitors. However, if we use JavaScript to handle this target, the time will be different from each client. So we need the server to return the server time and refresh the clock per second via AJAX.

 

If you have any suggestions for the code samples, please email us: onecode@microsoft.com.

Posted On Tuesday, April 19, 2011 8:34 PM | Feedback (12)
Thursday, April 14, 2011
New Microsoft All-In-One Code Framework “Sample Browser” v3 Released

Microsoft All-In-One Code Framework Sample Browser v3 was released today, targeting to provide a much better code sample download and management experience for developers.

Install: http://1code.codeplex.com/releases/view/64539#DownloadId=229757 (a tiny ClickOnce install)

Background of Sample Browser v3

Last month, we reached the milestone of releasing Sample Browser v2, whose features focus on providing better experience for browsing and searching around 600 code samples of Microsoft All-In-One Code Framework. We heard an important feedback from developers after that release: the sample browser accompanied with all 600 code samples is too large to download and hard to update when new releases come. We took this feedback seriously and make the enhancement in this new version of Sample Browser. In partnership with the MSDN Code Sample Gallery, the code sample download and management experience is now dramatically improved in Sample Browser v3.

Key features of Sample Browser v3

1. "on-demand" sample downloading

The Sample Browser v3 itself is a very tiny and easy-to-install application. It searches for Microsoft All-In-One Code Framework code samples. Based on your demands, you have the flexible choice between downloading individual code sample by clicking the “Download” button next to the code sample:

and downloading all code samples in one click:

2. Sample download management

In Sample Browser v3, you can configure the folder for managing all downloaded code samples

We recommend that you download all code samples to a centralized place, e.g. "D:\Samples". Microsoft All-In-One Code Framework Sample Browser will help you manage the downloaded code samples. If a sample has already been downloaded, Sample Browser displays the “Open” button next to the code sample:

If an update becomes available for a code sample, a [Update Available] button will remind you to download the updated code sample.

3. Auto-update

Thanks to ClickOnce, you will automatically get updates of Microsoft All-In-One Code Framework Sample Browser when its new versions come out.

Besides the above key improvements, the font in the Sample Browser user interface is adjusted to have better contast with the background color.

If you have any feedback, please feel free to let us know by sending email to us at here: onecode@microsoft.com. Your suggestions are very much appreciated.

[Appreciations]

Appreciate Steven Wilssens and his MSDN Code Sample Gallery team for enabling us to implement the on-demand download feature.

Appreciate my team members Leco Lin, Dandan Shi for writing this new version of Sample Browser.

Appreicate Celia Liang, Lixia Dai for creating banners and evagalizing the new Sample Browser.

Posted On Thursday, April 14, 2011 11:35 PM | Feedback (1)
Advertise on this site through Lake Quincy Media
Tag Cloud