CCNetConfig

Continuous Integration, Simplified Configuration

Home | Wiki | About | Login | Contact |
subscribeSubscribe
Subscribe
CCNetConfig
Releases
Beta Releases
Stable Releases
Work Items
Discussions
CPRP
Releases
Beta Releases
Stable Releases
RSS Builds Publisher
Releases
Beta Releases
Stable Releases
Current Release
0.5.0.120
Sun, Jan 20 2008 at 10:02 PM
All Releases
CCNetConfig Build Status
  • Build StatusSuccess
  • Label0.6.420.32915
  • Last Build4/28/2008 6:43 AM
  • Next Build7/24/2008 12:00 AM
Recent Work Items
  • Automated: Unhandled exceptio…
  • Automated: Object reference n…
  • support for SvnRevisionLabell…
  • Automated: Uncommon behaviour…
  • Automated: create a new confi…
  • Copying and pasting a task do…
  • Automated: Invalid URI: The U…
  • Automated: Cannot import a nu…
  • Remove support for plugins in…
  • Show splash screen on initial…
Legend: Proposed Active Fixed Closed
Tag Cloud
  • A Little Class
  • Automation
  • C#
  • CCNet
  • CCNetConfig
  • codeplex
  • CodePlexAPI
  • Continuous Integration
  • CruiseControl.NET
  • feedburner
  • google
  • JSON
  • LOLCode
  • MSBuild
  • RssBuildsPublisher
  • Sandcastle
  • subtext
  • subversion
  • SvnLabeller
  • tfs
  • twitter
  • Visual Studio
  • Wix
  • XML
  • xna
more tags...
Archives
  • July, 2008 (2)
  • May, 2008 (3)
  • April, 2008 (5)
  • March, 2008 (8)
  • February, 2008 (6)
  • January, 2008 (7)
  • December, 2007 (11)
  • November, 2007 (7)
  • October, 2007 (5)
  • September, 2007 (8)
  • August, 2007 (5)
  • June, 2007 (7)
  • May, 2007 (5)
  • April, 2007 (23)
  • March, 2007 (27)
  • February, 2007 (12)
  • January, 2007 (9)
  • December, 2006 (2)
  • November, 2006 (12)
  • October, 2006 (17)
  • September, 2006 (8)
  • August, 2006 (30)
 
Image Galleries
  • Screenshots
  • A Little Class
Post Categories
  • Announcements
  • Automation
  • Beta
  • Beta Marker
  • C#
  • CCNetConfig
  • CCNetConfig.BugTracking
  • CCnetConfig.CCNet
  • CCNetConfig.Core
  • CCNetConfig.GUI
  • CCNetConfig.Updater
  • CCNetConfig.Updater.Core
  • CodePlex
  • CodePlex Release Publisher
  • CodePlexAPI
  • Continuous Integration
  • CruiseControl.NET
  • Extending CCNetConfig
  • MSBuild
  • MsBuild Extended Tasks
  • News
  • Nightly
  • Orcas
  • Project Extension
  • Rant
  • Reflector
  • Release
  • RssBuildsPublisher
  • Sandcastle
  • SubText
  • SubVersion
  • TFS
  • TFS Plugin
  • Tools
  • TortiseSVN
  • Vista
  • Visual Studio
  • Wiki
  • Wix
  • XAML
  • Xbox Live
  • Zune
 

Blog Statistics
  • Posts219
  • Articles0
  • Comments36
  • Trackbacks5
Home
Download
Screenshots
Support
License
Source

November 2007 Entries

A Little Class (System.Net.Mail.SmtpClient)
This week I am showing a class that allows applications to send emails by using the Simple Mail Transport Protocol (SMTP). The System.Net.Mail.SmtpClient class provides the functionality to send the emails. This class replaces the now obsolete System.Web.Mail.SmtpMail class. SmtpClient does not just contain just static methods an properties like its predecessor did. It also makes it easier to send mail if your Smtp server requires authentication before sending the email.

Code

1using System; 2using System.Net.Mail; 3using System.Net; 4 5namespace ALittleClass ...{ 6 class Program ...{ 7 static void Main ( string[] args ) ...{ 8 // create the smtp client, defining the smtp server and port. 9 SmtpClient client = new SmtpClient ( "smtp.mydomain.com", 25 ); 10 // set the login credentails 11 client.Credentials = new NetworkCredential ( "username@mydomain.com", "p@ssw0rd1" ); 12 // if we need ssl, enable it 13 client.EnableSsl = false; 14 // set the time out to 60 seconds 15 client.Timeout = 60000; 16 // create the email message 17 MailMessage msg = new MailMessage ( new MailAddress ( "my@email.com", "Ryan" ), new MailAddress ( "your@email.com", "You" ) ); 18 // set the body of the email message. 19 msg.Body = "This is an email sent using System.Net.Mail.SmtpClient"; 20 // i will get a delivery notification if it was successfull 21 msg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess; 22 // we are not sending HTML 23 msg.IsBodyHtml = false; 24 // this is a very important message 25 msg.Priority = MailPriority.High; 26 // set the subject of the email 27 msg.Subject = "A Little Class (System.Net.Mail.SmtpClient)"; 28 // lets add an attachment to the email. 29 msg.Attachments.Add ( new Attachment ( @"C:\Files\ALittleClass\ALittleClass\Program.cs" ) ); 30 // send the email 31 // client.Send ( msg ); 32 // we can send the message asynchronously also if we would like 33 // but we may also want to listen for when the send has completed as well. 34 client.SendCompleted += delegate ( object sender, System.ComponentModel.AsyncCompletedEventArgs e ) ...{ 35 if ( !e.Cancelled ) ...{ 36 if ( e.Error != null ) ...{ 37 Console.WriteLine ( "Error sending your message: {0}", e.Error.Message ); 38 } else ...{ 39 Console.WriteLine ( "Your message was sent." ); 40 } 41 } else ...{ 42 Console.WriteLine ( "The message was not sent." ); 43 } 44 }; 45 client.SendAsync ( msg, null ); 46 47 } 48 } 49} 50

Output

Your message was sent.
Technorati Tags:[ A Little Class ] [ System.Net.Mail.SmtpClient ] [ SmtpClient ] [ C# ] [ SmtpMail ]
Filed Under [ C# ]
Ryan Conrad posted @ Friday, November 30, 2007 9:13 AM | Comments (0)
CCNetConfig source now searchable on Koders.com
using a modified version of the SVNBridge that I changed to allow outside requests, I was able to get CCNetConfig indexed on koders.com. There stats put the total lines of code just shy of 24K. I am still waiting for google to start index the code for their code search. I am already following the requirements for adding the xml file that explains the contents of the zip file and I have requested that the package be indexed. Now it's all about just waiting for the spider.
Technorati Tags:[ koders ] [ ccnetconfig ] [ svnbridge ]
Filed Under [ CCNetConfig ]
Ryan Conrad posted @ Monday, November 26, 2007 1:13 PM | Comments (0)
A Little Class (System.Media.SoundPlayer)
Since this week is a holiday week, I wanted to post the Little Class a little early. This week I will show a class that will allow you to play a *.wav file easily using the System.Media.SoundPlayer class. This class can load the wave file on the same thread as the UI or you can load it asynchronously. Playing of the file can also be done on the same thread as the UI or on a separate thread.

To get this example working on your machine, you will need to place a *.wav file in the binary directory and name it "test.wav".
1using System; 2using System.Media; 3using System.IO; 4 5namespace ALittleClass ...{ 6 class Program ...{ 7 static void Main ( string[] args ) ...{ 8 // get the path of the calling assembly 9 string path = Path.GetDirectoryName(typeof(Program).Assembly.Location); 10 // create a stream to the file 11 FileStream fileStream = new FileStream ( Path.Combine ( path, "test.wav" ), FileMode.Open, FileAccess.Read ); 12 // make sure the stream is closed and disposed of 13 using ( fileStream ) ...{ 14 // create the sound player 15 SoundPlayer player = new SoundPlayer ( fileStream ); 16 // you could just pass the path to the file as well in the constructor 17 // SoundPlayer player = new SoundPlayer ( Path.Combine ( path, "test.wav" ) ); 18 // or you could use the default constructor 19 // SoundPlayer player = new SoundPlayer ( ); 20 // if you use the default constructor, you need to specify the sound file location or stream 21 // player.SoundLocation = Path.Combine ( path, "test.wav" ); 22 // or 23 // player.Stream = fileStream; 24 // you can also listen for the stream or file location changing using the following events 25 player.SoundLocationChanged += delegate ( object sender, EventArgs e ) ...{ 26 // The location changed 27 }; 28 29 player.StreamChanged += delegate ( object sender, EventArgs e ) ...{ 30 // the stream changed 31 }; 32 33 // when the wave finishes loading, we want to play the file. To do so, we will listen for the 34 // LoadCompleted event. 35 player.LoadCompleted += delegate ( object sender, System.ComponentModel.AsyncCompletedEventArgs e ) ...{ 36 SoundPlayer sp = sender as SoundPlayer; 37 // check that the loading wasn't canceled 38 if ( !e.Cancelled ) ...{ 39 // play the file on a new thread. 40 // Play will load the file if it isn't already loaded, but you obviously couldn't call play here 41 // without loading the file first since we are in the LoadCompleted event. 42 sp.Play ( ); 43 // you can also play the wave on the same thread as the UI by using the following line 44 // sp.PlaySync ( ); 45 // or if you want to play the file continuously use the next line 46 // sp.PlayLooping ( ); 47 } 48 }; 49 // set a timeout in milliseconds for loading the wave file. 50 player.LoadTimeout = 100; 51 // load the file 52 player.Load ( ); 53 // you can also load the file asynchronously using the following line 54 //player.LoadAsync ( ); 55 // wait for the user to press enter 56 Console.ReadLine ( ); 57 // we can stop the file from playing now. 58 player.Stop ( ); 59 } 60 } 61 } 62}
Technorati Tags:[ A Little Class ] [ System.Media.SoundPlayer ] [ SoundPlayer ] [ C# ]
Filed Under [ C# ]
Ryan Conrad posted @ Tuesday, November 20, 2007 9:29 AM | Comments (0)
A Little Class (System.Drawing.ColorTranslator)
This week I am going to show you a class that has a few static methods that will convert a color to an HTML color, an Ole color or a Win32 color. You can also use the class to convert from those types of colors as well to create a System.Drawing.Color. The class is defined in System.Drawing and is the ColorTranslator. The purpose of this class is to convert to and from GDI+ Color structures and it can not be inherited.

1using System; 2using System.Drawing; 3 4namespace ALittleClass ...{ 5 class Program ...{ 6 static void Main ( string[] args ) ...{ 7 // convert from a Hex color to a System.Drawing.Color 8 // note that you can also specify the alpha in the color as well. 9 Color color = ColorTranslator.FromHtml ( "#9947d32a" ); 10 // display the name. if the color is a defined color (ie Red) the name will be 11 // the defined name. Otherwise, it will be the hex values including the alpha. 12 // In order to get the defined name, you must define the alpha in your color. 13 // #ffff0000 = Red, but #ff0000 = ffff0000 14 Console.WriteLine ( "Color: {0}", color.Name ); 15 16 // Translate the Color to an OLE color. 17 int ole = ColorTranslator.ToOle ( color ); 18 Console.WriteLine ( "Ole = {0}", ole ); 19 20 // Translate the Color to a Windows color. 21 int win32 = ColorTranslator.ToWin32 ( color ); 22 Console.WriteLine ( "Win32 = {0}", win32 ); 23 24 // create a new ole color 25 ole = 0xff00; 26 color = ColorTranslator.FromOle ( ole ); 27 Console.WriteLine ( "FromOle: {0}", color.Name ); 28 29 // create a new win32 color 30 win32 = 0xa000; 31 color = ColorTranslator.FromWin32 ( win32 ); 32 Console.WriteLine ( "FromWin32: {0}", color.Name ); 33 34 // FromHtml also supports converting from a named color as well. 35 color = ColorTranslator.FromHtml ( "aqua" ); 36 Console.WriteLine ( "FromHtml: {0}", color.Name ); 37 38 Console.ReadLine ( ); 39 } 40 } 41}

Output

Color: 9947d32a
Ole = 2806599
Win32 = 2806599
FromOle: Lime
FromWin32: ff00a000
FromHtml: Aqua
Technorati Tags:[ A Little Class ] [ System.Drawing.ColorTranslator ] [ C# ]
Filed Under [ C# ]
Ryan Conrad posted @ Thursday, November 15, 2007 8:41 AM | Comments (0)
A Little Class (System.IO.IsolatedStorage.IsolatedStorageFile)
This weeks Little Class is System.IO.IsolatedStorage.IsolatedStorageFile. IsolatedStorage represents an isolated storage area containing directories and files. The storage object can be created at the machine level or at the user level. It allows an application to store data on an isolated portion of the file system with out having to specify a particular path within the file system. Isolated stores are scoped to assemblies so most other managed assemblies will not be able to access your codes data. Highly trusted assemblies and administration tools can access stores from other assemblies, unmanaged code can also access any isolated store.

1using System; 2using System.IO.IsolatedStorage; 3using System.IO; 4 5