Author |
Message |
Charle #1 / 12
|
 Simultaneous access to file (VB.NET)
Hello I'm struggling with this problem. Perhaps someone has the answer. What I am trying to do: I want the user to be able to select multiple files and open them with my script. Problem: it opens as many sessions of the same script as there are files. A solution I found is by storing the files paths to be opened in a queue in a text file on the C drive. The first program opened signals the others through this file that he is in charge, the others add their file to the queue, and the first program picks them up when he's done with the first file (and each time thereafter). Problem: I get simultaneous attempts to open the same file, which fails the process. I partially solved that by introducing a random timer that makes each process wait up to 1sec, so that it reduces the probability. But I still get "collisions". Is there a simpler way to getting multiple instances of the same script to talk to each other simultaneously, or to make the script a single instance and to collect the paths of the other files opened from the program while it is running? thanks in advance Charles
|
Thu, 21 Apr 2011 18:48:31 GMT |
|
 |
Bill McCarth #2 / 12
|
 Simultaneous access to file (VB.NET)
Hi Charles, For VB.NET questions, best to ask in the dotnet groups such as : microsoft.public.dotnet.languages.vb As to your question it is relatively easy to set your app to a single instance in VB.NET 2005 or later if you are using Windows.Forms. Open up the application project properties, "My Project" and check the "Make single instance application". Then click on the "View Application Events" button and fro the code editor drop downs select MyApplication Events on the left hand side and on the right select StartUpNextInstance. If you have any follow questions or aren't clear on this, please post to the dotnet group: microsoft.public.dotnet.languages.vb
Quote: > Hello > I'm struggling with this problem. Perhaps someone has the answer. What > I am trying to do: I want the user to be able to select multiple files > and open them with my script. Problem: it opens as many sessions of > the same script as there are files. > A solution I found is by storing the files paths to be opened in a > queue in a text file on the C drive. The first program opened signals > the others through this file that he is in charge, the others add > their file to the queue, and the first program picks them up when he's > done with the first file (and each time thereafter). > Problem: I get simultaneous attempts to open the same file, which > fails the process. I partially solved that by introducing a random > timer that makes each process wait up to 1sec, so that it reduces the > probability. But I still get "collisions". > Is there a simpler way to getting multiple instances of the same > script to talk to each other simultaneously, or to make the script a > single instance and to collect the paths of the other files opened > from the program while it is running? > thanks in advance > Charles
|
Thu, 21 Apr 2011 19:11:19 GMT |
|
 |
Charle #3 / 12
|
 Simultaneous access to file (VB.NET)
Great. Thanks!
|
Thu, 21 Apr 2011 19:28:17 GMT |
|
 |
Mike William #4 / 12
|
 Simultaneous access to file (VB.NET)
Quote: > As to your question it is relatively easy to set your app to > a single instance in VB.NET 2005 or later . . .
There you go again,{*filter*}head! Stop answering vb.net questions here where they are off topic! Idiot!
|
Thu, 21 Apr 2011 23:14:06 GMT |
|
 |
Michel Posseth [MCP #5 / 12
|
 Simultaneous access to file (VB.NET)
Mike ,,, Did you notice that this question was also posted in microsoft.public.DOTNET.languages.vb Take some bromo seltzer , before the acid burns through your stomach ,, relax man :-| regards Michel Posseth I hope that you have noticed that this question was cross posted to
Quote:
>> As to your question it is relatively easy to set your app to >> a single instance in VB.NET 2005 or later . . . > There you go again,{*filter*}head! Stop answering vb.net questions here where > they are off topic! > Idiot!
|
Fri, 22 Apr 2011 03:37:11 GMT |
|
 |
Mike William #6 / 12
|
 Simultaneous access to file (VB.NET)
Quote: > Mike ,,, Did you notice that this question was also > posted in microsoft.public.DOTNET.languages.vb > Take some bromo seltzer . . .
No it wasn't! The question was posted ONLY in microsoft.public.vb.general.discussion. Check your facts, idiot! I personally added the dotnet group TO MY RESPONSE ONLY on the grounds that if the Bill McCarthy (Most Valuable Puppet) fool insists on infesting the Classic VB newsgroup spreading his dotnet propoganda as he has been doing for months, despite repeated requests by dozens of people asking him to stop, then I might as well annoy somebody on his own favourite dotnet group. It certainly seems to have annoyed you, so it appears I was successful :-) Take the seltzer yourself, boy. Oh, and get your facts straight next time! Mike
|
Fri, 22 Apr 2011 05:13:33 GMT |
|
 |
Charle #7 / 12
|
 Simultaneous access to file (VB.NET)
Some people seem to be prompt at blaming someone for being helpful...
|
Fri, 22 Apr 2011 05:29:31 GMT |
|
 |
Hennin #8 / 12
|
 Simultaneous access to file (VB.NET)
Quote: > Some people seem to be prompt at blaming someone for being helpful...
No, not at all. There are a lot of helpful people in this group, answering VB-Classic Q's. The only annoying thing is when replies are given in the wrong group, other users of the language are not benefitting from the reply. There is a looooong war going on in this group about answering .net Q's in the correct group. You just happened to be in the wrong place at the wrong time. /Henning
|
Fri, 22 Apr 2011 06:37:42 GMT |
|
 |
Bill McCarth #9 / 12
|
 Simultaneous access to file (VB.NET)
<sigh> Seems that because I won't reply to Williams anymore he's trying his darnest to get some attention. Oh well, we've seen his silly spam attacks in here before around the time he pretended to be his wife (what was up with that ??). Better stock up on the popcorn ;)
Quote: > Mike ,,, > Did you notice that this question was also posted in > microsoft.public.DOTNET.languages.vb > Take some bromo seltzer , before the acid burns through your stomach ,, > relax man :-| > regards > Michel Posseth > I hope that you have noticed that this question was cross posted to
>>> As to your question it is relatively easy to set your app to >>> a single instance in VB.NET 2005 or later . . . >> There you go again,{*filter*}head! Stop answering vb.net questions here where >> they are off topic! >> Idiot!
|
Fri, 22 Apr 2011 11:37:56 GMT |
|
 |
Cor Ligthert[MVP #10 / 12
|
 Simultaneous access to file (VB.NET)
Michel, The trouble in the vb.general.discussion newsgroup is that there are a lot of helpfull persons. However, there are as well some persons who have made their pupose of life to call everybody an idiot. Just don't pay attention to them, as most in the newsgroup vb.general.discussion does. You will most probably see after this message exactly what I mean. Just to inform you, Cor
Quote: > Mike ,,, > Did you notice that this question was also posted in > microsoft.public.DOTNET.languages.vb > Take some bromo seltzer , before the acid burns through your stomach ,, > relax man :-| > regards > Michel Posseth > I hope that you have noticed that this question was cross posted to
>>> As to your question it is relatively easy to set your app to >>> a single instance in VB.NET 2005 or later . . . >> There you go again,{*filter*}head! Stop answering vb.net questions here where >> they are off topic! >> Idiot!
|
Fri, 22 Apr 2011 15:35:58 GMT |
|
 |
Michel Posseth [MCP #11 / 12
|
 Simultaneous access to file (VB.NET)
Okay i was a bit to soon with my conclusion , only your answer was posted in both groups excuse me , However calling me now also an idiot says more about you as it does about me . I see you were testing our group response on 1-11-11:33 and were correctly answered by PVDG42 Maybe you should be more active and answer also the off topic questions sooner to prevent this regards Michel
Quote:
>> Mike ,,, Did you notice that this question was also >> posted in microsoft.public.DOTNET.languages.vb >> Take some bromo seltzer . . . > No it wasn't! The question was posted ONLY in > microsoft.public.vb.general.discussion. Check your facts, idiot! I > personally added the dotnet group TO MY RESPONSE ONLY on the grounds that > if the Bill McCarthy (Most Valuable Puppet) fool insists on infesting the > Classic VB newsgroup spreading his dotnet propoganda as he has been doing > for months, despite repeated requests by dozens of people asking him to > stop, then I might as well annoy somebody on his own favourite dotnet > group. It certainly seems to have annoyed you, so it appears I was > successful :-) > Take the seltzer yourself, boy. Oh, and get your facts straight next time! > Mike
|
Fri, 22 Apr 2011 14:27:59 GMT |
|
 |
Mike William #12 / 12
|
 Simultaneous access to file (VB.NET)
Quote: > Okay i was a bit to soon with my conclusion . . . However calling > me now also an idiot says more about you as it does about me .
Yes it does. It says that I do not take kindly to people like yourself who tell me that I need to take bromo seltzer, especially when it was your own mistake that led you to that erroneous conclusion. Mike
|
Fri, 22 Apr 2011 23:30:11 GMT |
|
|