Hi,
I have a program that is listening for messages on a port and writes each message to a separate file. I'm currently using the DateTime Now to write a time stamp into the file name so that each message has a unique name (i.e. doesn't get overwritten by the next)
However some messages are getting overwritten by the next message since the time did not yet have a chance to advance to change the file name time stamp. (machine is very fast and messages are coming in quickly)
For each message the program resets and so I cannot use a counter inside the program. and I cannot change this aspect of the program.
Is there another way other than DateTime, to generate a unique number for each file that does not rely on a counter inside the program itself?
Thanks for any help
I have a program that is listening for messages on a port and writes each message to a separate file. I'm currently using the DateTime Now to write a time stamp into the file name so that each message has a unique name (i.e. doesn't get overwritten by the next)
However some messages are getting overwritten by the next message since the time did not yet have a chance to advance to change the file name time stamp. (machine is very fast and messages are coming in quickly)
For each message the program resets and so I cannot use a counter inside the program. and I cannot change this aspect of the program.
Is there another way other than DateTime, to generate a unique number for each file that does not rely on a counter inside the program itself?
Thanks for any help
Comment