|
It takes a little time to create a file, but the time it takes is enough to pretty much guarantee a unique name every time, especially if your code is performing exception handling (which it should), and properly closing the file (which it should). If you include the millisecond portion of the date time, you should be good to go. Besides, if you think there's a chance of it, the simple solution is to insert the line Thread.Sleep(25); just before you create the file. Doing so guarantees a unique filename using the date/time naming method, and it will introduce unnoticeable latency in your code.
If you don't really care what the file name is as long as it's unique, use a GUID for the name. A GUID is guaranteed to be unique no matter how many you create in a given second.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Sunday, May 4, 2008 10:04 AM
|
|
|
|
|
Kwagga wrote: In South Africa we use "ddMMyyyy" as date format
Well, get out there and start teaching people about ISO 8601[^]
Think globally, act locally. 
|
|
|
|
|
You're welcome.
|
|
|
|
|
Good Day everyone,
Is it possible to get the total CPU and RAM usage of your application and display it on your form?
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
|
Hey everyone,
Ever tried to extract text from your controls "say datagrid, text boxes or labels" and save in in a word file and format these data "colors and fonts" in the created word file??
ps. I found many third party tools on the internet, but I still need your suggestions guys before I start so please tell me how do you do it and what do you prefer to use
Cheers
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
modified on Sunday, May 4, 2008 1:57 AM
|
|
|
|
|
|
Ghee! Thanks!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Can somebody please tell me how to make autorun.ini file and how coding can be done inside this file?
modified on Sunday, May 4, 2008 1:06 AM
|
|
|
|
|
I cant see how this's related to the C# forum or the subject of your post, but there you go..
[autorun]
OPEN=myprogram.EXE
ICON=myicon.ICO
And here is some useful link to start with
www.google.com
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Sorry for mistake of subject.But I want some C# code embedded inside that autorun.ini file.I want it to run when I open the folder containing this autorun.ini file.
Thank u.
|
|
|
|
|
Prabhat003 wrote: I want some C# code embedded inside that autorun.ini file.I want it to run when I open the folder containing this autorun.ini
You cant do that
Maybe you need to initiate your compiled C# application using the autorun file, otherwise, excuse me
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi
I am programming a application to control any media player (Windows media player or Winamp or iTunes...) with a Nintendo Wiimote.
I got everything else working but I was wondering how could i make the simple commands, like Next song, Play/pause, Stop, Previous song.
I was thinking about MCI but it seems to only work when the files are played inside the application.
Would it work by emulating the media keys on a keyboard?
If yes, how could i do it?
Thanks.
|
|
|
|
|
hello..
I try to run the Xna code from Riemer's tutorial. For some computers, it running perfectly but not for the certain computers. For example, the skydome doesn't show up. Anyone had any idea to solve this problem?
[img]http://img488.imageshack.us/img488/6241/signaturesakirahku9.jpg[/img]
|
|
|
|
|
Perhaps if you ask Riemer, we have no idea what you're talking about.
If it's DirectX related, then one probably reason is that different machines have different graphics cards with different directX capabilities.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hi everybody,
Please need to know how can i make executable fle in JAVA.
Please if anybody know , write me the Steps , i need it so urgent ..
Thanks ,
|
|
|
|
|
Buy a good grade of coffee and make the Java in an automatic drip pot.
Jon
Smith & Wesson: The original point and click interface
|
|
|
|
|
You have posted 6 messages here. The headers are all 'urgent' or 'plz help'. Surely you have the brain capacity to come up with a subject that pertains to your question ?
I haven't checked if all your questions are as completely off topic for their forums as this one is. Either way, I recommend you read the guide on how to ask questions, and for questions as basic as this one, take a class or buy a book.
To build an exe in Java, you write the code and select the 'compile' option from the menu of your compiler.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sahar111 wrote: need to know how can i make executable fle in JAVA.
Four things...
1. don't post in a C# forum
2. don't use "urgent" because no one really cares.
3. get a java compiler to create the byte code .class file. There isn't really an .exe executable generated in Java if that is what you are thinking...
4. read a book or take a class.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi all,
I am planning to develop a website which have a simulator where allows users to design thier nail design online. This will be something drag and drop the design to the fingernail in 3D mode.
I would like to ask can this implement in C# with Managed DirectX? And, how do I implement this using C# wi9th Managed DirectX?
Thanks.
|
|
|
|
|
I could be very wrong here... But I think you may want to use Flash instead of DirectX.
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
I do not want to use Flash because it just align the timeframe and some simple code. I want algorithm involved in my program. Hence, I choose using C# with DirectX. This is used for game development but I do not sure can it apply in my program which my program is similar like the bottom link website.
My program want to be in 3D,fully interactive.
http://www.edheads.org/activities/knee/[^]
Instead of using flash, got any language is better than this?
Thanks.
Katelva
|
|
|
|
|
You may want to try Processing[^], it may be able to embed in web pages although I'm not sure.
Scott P
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
I am trying to load data from a data file. At first I declared a list called list<client> clients and I was able to load this list.
Then I tried to declare a class list as shown below and the program crashed on the add statement. Could someone please explain:
namespace WindowsApplication2
{
public struct client
{
public string matter;
public string name;
}
public class clientList
{
public List<client> data;
}
static class Program
{
[STAThread]
static void Main()
{
client Myclient;
clientList clients = new clientList();
FileStream aFile = new FileStream
("TextFile1.txt", FileMode.Open);
StreamReader sr = new StreamReader(aFile);
//load data into the Myclient list
Myclient.matter = sr.ReadLine();
while(Myclient.matter!=null)
{
Myclient.name = sr.ReadLine();
clients.data.Add(Myclient);
Myclient.matter = sr.ReadLine();
}
//
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 f = new Form1();
Application.Run(f);
}
}
}
|
|
|
|