Click here to Skip to main content
15,922,630 members
Home / Discussions / C#
   

C#

 
GeneralRe: FileSystemWatcher and Threading Pin
JoeRip20-Dec-07 1:40
JoeRip20-Dec-07 1:40 
GeneralRe: FileSystemWatcher and Threading Pin
#realJSOP20-Dec-07 2:37
professional#realJSOP20-Dec-07 2:37 
GeneralRe: FileSystemWatcher and Threading Pin
JoeRip20-Dec-07 1:42
JoeRip20-Dec-07 1:42 
GeneralProblems with CSV file blowing out memory Pin
LongRange.Shooter19-Dec-07 11:05
LongRange.Shooter19-Dec-07 11:05 
GeneralRe: Problems with CSV file blowing out memory Pin
Ed.Poore19-Dec-07 11:19
Ed.Poore19-Dec-07 11:19 
GeneralRe: Problems with CSV file blowing out memory Pin
LongRange.Shooter19-Dec-07 13:53
LongRange.Shooter19-Dec-07 13:53 
GeneralRe: Problems with CSV file blowing out memory Pin
Skippums19-Dec-07 12:39
Skippums19-Dec-07 12:39 
Generalrandom files with different date Pin
Shani Aulakh19-Dec-07 9:09
Shani Aulakh19-Dec-07 9:09 
The following code is generating files perfectly, But when i change the date on my laptop to get files with different modified times. It just overrides all the files with the recent date.

private void GenerateTestFiles_Click(object sender, EventArgs e)
{
StreamWriter outStream = null;
string message = null;

for (int i = 0; i < (100); i++)
{
string filename = "output";
filename += i.ToString();

if (i % 3 == 0)
{//multiple of three
filename += ".txt";
}
else if (i % 5 == 0)
{//multiple of 5
filename += ".log";
}
else if (i % 7 == 0)
{// multiple of 7
filename += ".exe";
}
else if (i % 9 == 0)
{// miltiple of 9
filename += ".dat";
}
else if (i % 11 == 0)
{// multiple of 11
filename += ".jpq";
}
else
{
filename += ".bmp";
}

FolderWatcher fw = new FolderWatcher();
filename = fw.FolderPath + "C:\\CsharpTempFolder\\" + filename;

try
{
outStream = new StreamWriter(filename);
outStream.WriteLine("Hello World");
outStream.Close();
}
catch (Exception Ex)
{
message = "Unable to create " + filename + "\r\n";
message += String.Format("Reason: {0}", Ex.Message);
MessageBox.Show(message);
}
}
}

1. Can i generate files with random numbers. Like, in the loop i takes random values using System.Random class. Or, add datetime object. what is the most simpliest way of doing it.
GeneralRe: random files with different date Pin
pmarfleet19-Dec-07 9:20
pmarfleet19-Dec-07 9:20 
GeneralRe: random files with different date Pin
Anthony Mushrow19-Dec-07 9:48
professionalAnthony Mushrow19-Dec-07 9:48 
GeneralRe: random files with different date Pin
pmarfleet19-Dec-07 9:58
pmarfleet19-Dec-07 9:58 
GeneralRe: random files with different date Pin
Shani Aulakh19-Dec-07 17:50
Shani Aulakh19-Dec-07 17:50 
GeneralRe: random files with different date Pin
Dave Kreskowiak20-Dec-07 8:57
mveDave Kreskowiak20-Dec-07 8:57 
GeneralRe: random files with different date Pin
pmarfleet20-Dec-07 9:14
pmarfleet20-Dec-07 9:14 
GeneralRe: random files with different date Pin
Dave Kreskowiak20-Dec-07 15:56
mveDave Kreskowiak20-Dec-07 15:56 
GeneralRe: random files with different date Pin
pmarfleet20-Dec-07 21:16
pmarfleet20-Dec-07 21:16 
GeneralWCF ASMX Web Service Client with HTTP Compression woes Pin
martin_hughes19-Dec-07 9:03
martin_hughes19-Dec-07 9:03 
GeneralReg:Change Text on DataGridViewLinkColumn Pin
P.T.R.K19-Dec-07 8:37
P.T.R.K19-Dec-07 8:37 
GeneralSimple File Counting Pin
ffowler19-Dec-07 8:20
ffowler19-Dec-07 8:20 
GeneralRe: Simple File Counting Pin
Giorgi Dalakishvili19-Dec-07 8:24
mentorGiorgi Dalakishvili19-Dec-07 8:24 
GeneralRe: Simple File Counting Pin
Jimmanuel19-Dec-07 8:24
Jimmanuel19-Dec-07 8:24 
GeneralRe: Simple File Counting Pin
ffowler19-Dec-07 8:26
ffowler19-Dec-07 8:26 
GeneralListView Pin
half-life19-Dec-07 7:30
half-life19-Dec-07 7:30 
GeneralRe: ListView Pin
mav.northwind19-Dec-07 9:13
mav.northwind19-Dec-07 9:13 
NewsSwitching internet connections Pin
new2pgrmg19-Dec-07 6:54
new2pgrmg19-Dec-07 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.