|
why are you creating random numbers
why dont you take an interger and increment it every time for every time the file name already exists
if you are dealing with larger number of files prefix or suffix ddmmyy to that number
Regards
Amar
It is Good to be Important but!
it is more Important to be Good
[My Question]
|
|
|
|
|
I'd concur with an earlier poster, use a GUID. In my experience the System.Random class isn't all that random, at least so far as generating 1000's of numbers a minute, unless you provide a good variation of seeds.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
I am generating file names could be anywhere from 5 to 1000 in say 5 minutes or less. Just want to have unique names. Do not want to write to disk and increment numbers. Someone suggested that i use GetRandomFileName, but that does not seem to be able to build. Am i missing something?
|
|
|
|
|
Maybe i can datetime stamp the file to the millisecond.
What is the best class to use for that?
|
|
|
|
|
Hi!
My application uses a dll named "GsmCommunication.dll" which needs to be registered before running application. i want to register this dll programmaticlly when application is installed, using regsvr32 or any other command. Some one told me to use
Process.Start("regsvr32", "GsmCommunication.dll");
but it does not work, thats may be because dll is not available in "System32" folder. how can i register dll by giving its current path, i.e. the path in which application is installed..?
Please help me solving my problem...Thanks,
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
You can write a small application that registers the dll you need. The application will run only after installation process. You can get the path of the folder of the application by Application class
|
|
|
|
|
Thnx for reply...can you be more specific about what to write in that small application? i dont have a clue of how to register dll, what classes/functions to use...?
more help please...!
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Use process class to launch regsvr32.exe and specify the path of the dll as an argument to the Process.
|
|
|
|
|
Thnx for reply...
I tried following methods but all gave error:
System.Diagnostics.Process.Start("regsvr32", Application.StartupPath + "\\GsmCommunication.dll");
Error: LoadLibrary("E:\Affan") failed - The specified module could not be found.
System.Diagnostics.Process.Start("regsvr32", Application.StartupPath);
Error: same error as above..
and then after placing GsmCommunication.dll in system32 folder i tried this:
System.Diagnostics.Process.Start("regsvr32", "GsmCommunication.dll");
Error: GsmCommunication.dll was loaded but the DLLRegisterServer entry point was not found. This file can not be registered.
please help!
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Affan Toor wrote: and then after placing GsmCommunication.dll in system32 folder i tried this:
System.Diagnostics.Process.Start("regsvr32", "GsmCommunication.dll");
Error: GsmCommunication.dll was loaded but the DLLRegisterServer entry point was not found. This file can not be registered.
Have you tried registering the dll from command line? Does it work? It seems that your dll can't be registered.
|
|
|
|
|
Hi!
Thanks for reply, i tried registering dll through command line but it gave the same error. may be dll is corrupt...i will try to get its correct version.
Kindly tell me am i using the correct code to register dll and is there any way i can register dll by giving a path other than System32 folder? Because when i try to give a path, wherever a [space] comes in path it considers it as dll name and gives error.
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Affan Toor wrote: Kindly tell me am i using the correct code to register dll and is there any way i can register dll by giving a path other than System32 folder? Because when i try to give a path, wherever a [space] comes in path it considers it as dll name and gives error.
You need to surround the full path with " "
|
|
|
|
|
Giorgi!
Thanks alot, your tip helped me in solving my problem..
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi!
I have the following problem:
My C# application creates a special file-format, called *.tvp.
When I build my Setup Project, an icons is show symbolizing my program. What I want now is:
All *.tvp files shall show this icon after installing my program as this for example works with *.doc files. They also show the winword icon.
Does anybody know about settings to realize this?
Thanks a lot
|
|
|
|
|
|
Hi all,
when i add the ActiveX control(microsoft office document imaging viewer control) into my form, the visual studio 2005 thrown "Failed to import the activex control.please ensure it is properly registered" error...please let me know what i did wrong...
thanks
|
|
|
|
|
Hi I have an untyped dataset with one datatable in it. The datatable is bound to a datagridview. I also have some textboxes that I want to bind to the datatable.
Hello.
When a user enters some values on a row in the datagridview I want these values to show in the corresponding textboxes. It should also be possible to type directly into the textboxes which should then update the corresponding row in the datatable/datagridview.
Datagridview
------------
ID Name Age
Datatable
------------
ID Name Age
textboxID
textboxName
textboxAge
I have tried getting this to work for a while but without luck, any help would really be appreciated
|
|
|
|
|
You can attach each field of the datatable with
nameofdataset.Tables[0].Rows[i].ItemArray[j]
with the indexes i an j changing for the Rows and cells you want to change or read out
|
|
|
|
|
I have been given a project to do where I have to customize the Right-click menu of the Outlook window and have an option that sends the whole email to a Windows Application’s textbox. Plz help!!
Mvelo Walaza
Jnr Developer
Telkom SA
|
|
|
|
|
|
Hi
My program runs f1_paint(object sender, PaintEventArgs e) this draws line a the form. Now I get some values from external source like a file and I want to update the f1_paint(object sender, PaintEventArgs e) how do I do it?
Basically the drawline function is in the f1_paint and I loaded everything in it file the file control etc etc but when an event occurs I store a bunch of values on a buffer and want the drawline in f1_paint(object sender, PaintEventArgs e) to run a-fresh with the new data...how do I do it?
Thanks
Samuel
|
|
|
|
|
Hello,
You could call "f1.Refresh()".
All the best,
Martin
|
|
|
|
|
Hi,
Control.Invalidate() exists so you can signal something has changed that affects
the look of your Control; it sill cause a repaint to occur.
|
|
|
|
|
What have you tried ? The obvious is to repeat this code with a 1 and a 2 in place of the 0.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|