Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 22nd, 2007, 04:41 PM
Registered User
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Text File not Creating! =(

Hey there!, i'm using a simple method for creating a text file and writing on it, i'm doing this in two places of my application, and they are the same!! but one works and the other just does anything!!... and its being called! Here is the method:

public void createLog(){
            String file = "somefile.txt";
            StreamWriter log = File.CreateText(file);
            log.WriteLine("Log File for Go and Connect Emailer");
            log.WriteLine("");
            log.WriteLine("Date: " + DateTime.Today.ToString());
            log.WriteLine("Time: " + DateTime.Now);
            log.WriteLine("");
            log.WriteLine("Emails not sent to the following address: ");
            log.WriteLine(emailsNotSent);
            log.WriteLine("");
            log.WriteLine("Total emails not sent : " + errors);
            log.WriteLine("Total emails sent : " + sentOk);
            sentOk += errors;
            log.WriteLine("Total emails : " + sentOk);
            log.Close();
          }








Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a form with input text that is populated shawn.bordeaux Classic ASP Basics 0 November 10th, 2008 11:22 PM
Creating Text file in Mozilla Israr Java Basics 1 May 17th, 2007 06:34 AM
Creating an MS-Word like text editor srotondo Classic ASP Basics 8 October 18th, 2004 06:36 PM
Extract text from text file & put in dropdown box tsukey Beginning PHP 5 July 20th, 2004 09:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.