C# Custom Number Formatting


Very often the inbuilt numerical formatting in C# will be insufficent and you will want to apply the custom formatting for your numbers.The String.Format method is very flexible and can be used to apply custom formatting rules. The # character informs the Format method how to format the numerical value, for example to forma the number 12000.12 as 12,000.12 use can use the format “#,#.##” as in the below code:double dbl1 = 12000.12;string outputStr;outputStr = string.Format(“This is a custom formatting example {0:#,#.##} “, dbl1);Response.Write(outputStr);In this example the , character is used to denote the thousand separator and the ## [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - September 15, 2011 at 3:54 pm

Categories: C#   Tags: Custom, Formatting, Number

The Gig.U Ultra High Speed Internet Project

The Gig.U project aims to deliver ultra-high speed internet access to 29 universities and surrounding areas in the United States. Many of the universities are hoping that the enhanced access can increase economic growth and facilitate research and development in various communities.

How fast is ultra-high speed? The project looks to bring speeds up to 1Gbps to these areas. At speeds this fast, an entire high-definition movie could be downloaded in mere seconds. With this type of bandwidth, Gig.U has implications for other data intensive applications.

Who Does It Benefit?
Not only will universities benefit from internet providers offering ultra-high speed internet, [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Blake Sanders - September 5, 2011 at 12:40 am

Categories: Internet   Tags: Gig.U, Ultra High Speed Internet Project

Measure Memory Usage of .NET Applications

There are primarily two main methods for measuring the memory usage of a .NET Framework application, using the GC class or using System.Diagnostics
The .NET Framework’s GC class contains many useful memory-related methods, including GetTotalMemory(), which returns the amount of memory the garbage collector believes is allocated to your app. The number not be exact right since some objects may not have been garbage collected yet. This, however does have the advantage of being able to inform you of the amount of memory a certain part of your app uses, as opposed to the entire process:
long memAvailable = GC.GetTotalMemory(false);
Console.WriteLine(“Before allocations: [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - August 26, 2011 at 1:55 pm

Categories: C#   Tags: Applications, Measure, Memory, Usage

Press release: The iMacros team releases Microsoft WebBrowser Control Replacement

Developers that are building .NET applications that interact with websites – e.g. for web automation, web testing, BPO process automation or web scraping – are often struggling to find a way to automate websites with the standard Microsoft WebBrowser control. Developed by iopus, a Heidelberg, Germany based company, the new iMacros Component for .NET is built with support for Ajax, Flash and Silverlight automation.

The iMacros Component is a .NET professional component that enables .NET developers to automate websites from their .NET applications (C#, VB.NET). A set of well-considered and clear API functions allows developers to automate form filling, data [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - August 25, 2011 at 12:17 am

Categories: News   Tags: iMacros team, Microsoft WebBrowser Control Replacement

Passing Parameters in C#

Methods are one of the primary concepts in C#. You can pass parameters to C# methods. There are basically three primary methods of passing parameters to C# methods:

This is passing parameters with no modifying keywords :

void MyMethod(Student studentObj, int aNumber)
{

aNumber += 5;

studentObj.Name = “Jon”;

}

In the above example MyMethod takes two parameters – a Student object and an Integer. Note the difference between the passing a Value Type (such as an Integer) and a Reference Type (such as any class such as a ‘Student’ object in the above example). Any operations performed on a value type will no be reflected [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - August 11, 2011 at 1:04 am

Categories: C#   Tags: Passing Parameters in C#

How to Format Numerical Data in C#

You will be required to make use of numerical data while programming with C#. This article examines how to format numerical data in C#.

C# ships with several inbuilt formatting specifies which can be used to quickly format a number, for example the ‘c’ specifier will format the number as a currency:

double dbl1 = 7777777.7777777;
outputStr = string.Format(“This is the currency format {0:c}”, dbl1);

This will output the numerical value as a currency based on the user’s current currency setting. In my case this will output:

This is the currency format $10,000,000.00

Note firstly that String.Format is a static method – ie you can [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - August 9, 2011 at 7:16 pm

Categories: C#   Tags: Format Numerical Data in C#, Formatting, Numerical

Introducing C# Strings

Strings are the fundamental concept to be learned in every programming language. Working with strings is a very common task for most C# developers. The .NET Framework offers good variety of tools for working with strings, but care must be taken as there are several gotchas to trip up the beginner.

The first thing to note about strings in .NET is that they are Reference Types. Reference types are live on the managed heap in .NET and so they are managed by the .NET Garbage Collector and unlike Value types they are not automatically destroyed when they are out of [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - August 8, 2011 at 7:47 am

Categories: C#   Tags: c# strings, Strings

WAPT Pro 2.5: A load testing solution for mobile web applications and Silverlight

SoftLogica Inc has announced the release of a new version of its flagship product WAPT Pro. WAPT is a load, stress and performance testing tool for web sites and software applications with web interface.

Its main advantage is the ability to create realistic tests very quickly with help of a regular browser. The product does not require any programming background, so it can be used by quite a wide range of specialists from QA engineers to managers and business analysts.

The Pro version of WAPT combines technical affordability with high performance and scalability required by industry standards. The product can use [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - August 5, 2011 at 5:49 am

Categories: News   Tags: load testing solution for silverlight, WAPT Pro 2.5

PowerMockup 2.0 Released – Rapid Wireframing Plugin for PowerPoint

Wulfsoft is announcing the release of version 2.0 of PowerMockup, a tool for rapidly sketching user interfaces of websites and software applications. Following the old adage that a picture is worth a thousand words, PowerMockup helps developers, designers and managers to bring form to design ideas and make concepts tangible.

The screen sketches created with PowerMockup provide stakeholders with a clear representation of the proposed solution. This enables design flaws and misunderstandings to be revealed early, before they are implemented in code and become expensive to correct.

PowerMockup works as a plugin for Microsoft PowerPoint, making it easy to use in [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - August 4, 2011 at 3:44 am

Categories: News   Tags: PowerMockup 2.0, Rapid Wireframing Plugin for PowerPoint

Windows Azure Toolkit for Social Games

Microsoft has announced the release of the Windows Azure Toolkit for Social Games (PREVIEW)!  This toolkit allows you to quickly get started building new social games in Windows Azure. 

It includes accelerators, libraries, developer tools, samples and has specific services and code to handle capabilities unique to games, such as storing user profiles, maintaining leader boards, in-app purchasing, and so forth.

In addition to releasing the toolkit, Microsoft also teamed with industry innovator Grant Skinner and his team to create a game called Tankster.

 

 

 

 

 

 

 

 

 

 

Tankster is built with HTML5 and comes complete with reusable service-side code and documentation.  It also supports a [...] Continue Reading…

Be the first to comment - What do you think?
Posted by Anand Narayanaswamy - July 28, 2011 at 12:57 am

Categories: Windows Azure   Tags: Windows Azure, Windows Azure Toolkit, Windows Azure Toolkit for Social Games

« Previous PageNext Page »