27 Apr 2009 @ 3:17 PM 
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
499 views
C#:
  1. using (StreamReader re = File.OpenText("engineeringserver.txt"))
  2. {
  3. string input = null;
  4. while ((input = re.ReadLine()) != null)
  5. {
  6. Console.WriteLine(input);
  7. }
  8. }

This code snippet has been sponsored by FruitfulTime. Try out FruitfulTime ProductivityMeter Business Editiona employee monitoring software

Your Ad Here
Tags Tags:
Categories: .Net
Posted By: gaetano
Last Edit: 25 Apr 2009 @ 03 20 PM

EmailPermalinkComments (0)
 26 Apr 2009 @ 3:08 PM 
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
419 views
C#:
  1. public class Writetextfile
  2. {
  3. public static void Main(string[] args)
  4. {
  5. FileInfo t = new FileInfo("engineeringserver.txt");
  6. using (StreamWriter Tex = t.CreateText())
  7. {
  8. Tex.WriteLine("Visit engineeringserver.com");
  9. Tex.Write(Tex.NewLine);
  10. }
  11. }
  12. }

This code snippet has been sponsored by FruitfulTime. Try out FruitfulTime TaskManager a to do list software

Your Ad Here
Tags Tags:
Categories: .Net
Posted By: gaetano
Last Edit: 25 Apr 2009 @ 03 20 PM

EmailPermalinkComments (0)
 25 Apr 2009 @ 3:07 PM 
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5 out of 5)
Loading ... Loading ...
412 views

1.  Register your handler

C#:
  1. static void Main(string[] args)
  2. {
  3. AppDomain currentDomain = AppDomain.CurrentDomain;
  4. currentDomain.UnhandledException += new UnhandledExceptionEventHandler(unhandledExceptionsHandler);
  5.  
  6. }

2. Log information about the unhandled exception. You can write the information to console or to a log file

C#:
  1. static void unhandledExceptionsHandler(object sender, UnhandledExceptionEventArgs args)
  2. {
  3. Exception e = (Exception)args.ExceptionObject;
  4. Console.WriteLine(e.Message);
  5. Console.WriteLine(e.StackTrace);
  6. }

This code snippet has been sponsored by FruitfulTime.  Try out FruitfulTime TaskManager a task list software

Your Ad Here
Tags Tags:
Categories: .Net
Posted By: gaetano
Last Edit: 25 Apr 2009 @ 03 21 PM

EmailPermalinkComments (0)
\/ More Options ...
Change Theme...
  • Users » 888
  • Posts/Pages » 1,444
  • Comments » 506
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Online Users



    No Child Pages.

Forum



    No Child Pages.