Pages
-
Recent Posts
- Revolving Door: MPAA Hires Chief USTR Negotiator Behind ACTA And TPP’s IP Chapter
- Copyright Maximalists’ Incredible Sense Of Entitlement: If It Challenges The Biz Model We Chose, It Must Be Illegal
- Turkey’s Prime Minister Sues His Own Country Over Twitter
- Picturefill 2
- Police File On Student ‘Bullied Into Committing Suicide’ Strangely Lacking In Evidence Of Bullying
Archives
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- December 2008
- November 2008
- October 2008
Meta
Category Archives: C#
PHPHOST BLOG
Web Hosting Related Articles You May Need
C#: Find Previous Month’s First and Last Day
Here’s a simple query that gives you the first and last day of the previous month.
static void Main(string[] args)
{
var yr = DateTime.Today.Year;
var mth = DateTime.Today.Month;
var firstDay = new DateTime(yr, mth, 1).AddMonths(-1);
var lastDay = new DateTime(yr, mth, 1).AddDays(-1);
Console.WriteLine(“First day Previous Month: {0}”, firstDay);
Console.WriteLine(“Last day Previous Month: {0}”, Continue reading
Posted in .NET, C#, Syndicated
Comments Off on C#: Find Previous Month’s First and Last Day
LINQ: Calculate Average File Size in C#
Let us see a simple code using LINQ and C# that calculates the average FileSize of the files kept in a folder.
First import the following namespaces:
using System.Linq;
using System.IO;
Then write the following code:
class Program
{
static v… Continue reading
Posted in C#, LINQ, Syndicated
Comments Off on LINQ: Calculate Average File Size in C#
LINQ: Calculate Average File Size in C#
Let us see a simple code using LINQ and C# that calculates the average FileSize of the files kept in a folder.
First import the following namespaces:
using System.Linq;
using System.IO;
Then write the following code:
class Program
{
static v… Continue reading
Posted in C#, LINQ, Syndicated
Comments Off on LINQ: Calculate Average File Size in C#
WCF 4.0 REST POX Service with Help Page
Representational State Transfer (REST) support was included in WCF 3.5. In WCF 4.0, this feature has been enhanced with Help page support. This facility was added as WCF REST allows direct call to OperationContracts, using HTTP protocol by the client a… Continue reading
Posted in .NET, C#, Syndicated
Comments Off on WCF 4.0 REST POX Service with Help Page
WCF 4.0 REST POX Service with Help Page
Representational State Transfer (REST) support was included in WCF 3.5. In WCF 4.0, this feature has been enhanced with Help page support. This facility was added as WCF REST allows direct call to OperationContracts, using HTTP protocol by the client a… Continue reading
Posted in .NET, C#, Syndicated
Comments Off on WCF 4.0 REST POX Service with Help Page
Early June 2011 Software Development Posts of Interest
This post summarizes some blog posts that I have found very interesting in the past week (posts may be older than this, but I saw them in the past week). The topics covered are fairly diverse.
Learning Groovy
I like Vasanth Dharmaraj’s post Learning… Continue reading
Posted in Android, C#, General Development, Groovy, PHP, Syndicated
Comments Off on Early June 2011 Software Development Posts of Interest
List<T>.ConvertAll<>() with Lambda Expression
List<T> has many useful methods for dealing with sequences and collections. One such method is the ConvertAll<>() method. All those who have used the List<T>.ConvertAll<>() are aware how useful this method is to convert the curr… Continue reading
Posted in C#, LINQ, Syndicated
Comments Off on List<T>.ConvertAll<>() with Lambda Expression
List<T>.ConvertAll<>() with Lambda Expression
List<T> has many useful methods for dealing with sequences and collections. One such method is the ConvertAll<>() method. All those who have used the List<T>.ConvertAll<>() are aware how useful this method is to convert the curr… Continue reading
Posted in C#, LINQ, Syndicated
Comments Off on List<T>.ConvertAll<>() with Lambda Expression
Remove all Lower Case Letters using C#
I came across a discussion where the OP wanted to use only the first letter of a word in a string. The first letter of each word was capitalized, so his requirement was to abbreviate the sentence by removing all lower case letters in a string.
For exam… Continue reading
Posted in C#, Syndicated, VB.NET
Comments Off on Remove all Lower Case Letters using C#
Remove all Lower Case Letters using C#
I came across a discussion where the OP wanted to use only the first letter of a word in a string. The first letter of each word was capitalized, so his requirement was to abbreviate the sentence by removing all lower case letters in a string.
For exam… Continue reading
Posted in C#, Syndicated, VB.NET
Comments Off on Remove all Lower Case Letters using C#