|
The files will be handled in the same order as the IO operations.
Note you won't get any events for files that were already in the folder before the FileSystemWatcher is started (d_file)
|
|
|
|
|
so this means, when a file enters the directory, then the trigger is started.
if file a_file and b_file enter at (almost) the same time, is a_file handled first or the one which is first in?
to guarantee the correct handling of the files i have to take care, a_file is there before b_file etc. is this correct?
because changing contence before creating a file won't work or updating data which is not there because the last command should have put the data in there
thanks for your info.
stephan.
|
|
|
|
|
stephan_007 wrote: if file a_file and b_file enter at (almost) the same time, is a_file handled first or the one which is first in?
It handles the first one in first.
If the order is important then wait until you get a full set in before starting processing - until you have them all you can't do anything anyway, as far as I can tell from your posting.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I have 6 comboboxes that are exactly the same. Just that the answers vary. Now I have an xml file that goes to a dataset. I tried to set the same table as the datasource in the xml file to all 6 cb's, but to bind the selecedValue property to 6 different variables. Basically what happened is that all the values of all 6 boxes ended up being the same. I ixed it by making 6 different entries in the same xml file that were identical except for the name. I personally think this is a waste and would like to now if there is any other way to do this.
|
|
|
|
|
Hi,
Use the clone property of the datatable to create seperate instance in memory.
Sample Code
ComboBox1.DataSource = Dataset.DataTable;
ComboBox2.DataSource = Dataset.DataTable.Clone();
ComboBox3.DataSource = Dataset.DataTable.Clone();
ComboBox4.DataSource = Dataset.DataTable.Clone();
ComboBox5.DataSource = Dataset.DataTable.Clone();
ComboBox6.DataSource = Dataset.DataTable.Clone();
Remember the Datatable is a type of Reference Variable.
Regards,
|
|
|
|
|
it doesn't work. with out the clone it works though.
This is the code
cbBp1Position.DataSource = xmlDataSet.Tables[27];
cbBP2Position.DataSource = xmlDataSet.Tables[27].Clone();
|
|
|
|
|
Hi,
I am working on a windows service that monitor a path and does some upload based on the FileWatcher class. As per microsoft, it say that "More than one user Service may run within the same process". Therefore, i created two services (component classes) in my windows service project and added an instance of each to the service to run as shown below:
static void Main()
{
ServiceUtility initUtl = new ServiceUtility(Constants System.ServiceProcess.ServiceBase[] ServicesToRun;
ServicesToRun = new System.ServiceProcess.ServiceBase[] { new exchangeRateFileWatcher(), new KYCFileWatcher() };System.ServiceProcess.ServiceBase.Run(ServicesToRun); }
However, i read that the second service will run only if the first one fails. Can you please tell me whether it is possible (and how) to run the two services within the same process (i.e exe)?
Thank you for your kind help
Carpe diem,
Krg
|
|
|
|
|
datastruct wrote: i read that the second service will run only if the first one fails
That's nonsense. I have service processes running up to eight Services.
|
|
|
|
|
|
Thanks for your kind help Vikas I'll see into it now itself
Carpe diem,
Krg
|
|
|
|
|
While leaving unsaved form, the system should alert the user that the data is not saved and user should get option to save the form before moving out of the form.It is a windows application in .NET framework coded in C#.
|
|
|
|
|
Setting a flag on OnSaveButtonClick event and by handling FormClosing Event I think you can check this one.
class mainForm
{
....
private bool isSaved = false;
...
private void OnSaveButtonClick(object sender, EventArgs e)
{
SaveFile();
isSaved = true;
}
private void On_FormClosing(object sender, EventArgs e)
{
if(!isSaved)
{
MessageBox.Show("Data is not saved!");
e.Cancel = true;
this.Focus();
}
}
...
}
Hope this helps. Good Luck.
|
|
|
|
|
how to remove access database password using c# code.please help me.explain it. thank you.
|
|
|
|
|
lankaudaranga wrote: how to remove access database password using c# code
Without knowing it? Uhm...You're a bad guy!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
lankaudaranga wrote: how to remove access database password using c# code
You can't, and stop asking the same damn question over and over.
"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,
I have created a windows service which monitors the activities of files on the server. This windows service is using a filesystemwatcher.
Every time there is an activity, i.e. when a file is moved or created, etc., then the system sends an email.
All works fine.
Question:
Imagine something will have to get installed on the server and the user forgot to turn off this windows service. Then as a result, a lot of emails will get sent.
This is what I am trying to avoid (Sending un-necessary emails).
Ideally, the user will turn this windows service off but what if he doesn't? certainly we do not what the system to send so many emails as the result of something being installed which can cause alot of files movements and creations, etc...
Thanks
|
|
|
|
|
Well, if you were stupid enough to set the folder to C:\ and then allow it to watch subfolders for "*.*" as well, you deserve what you get.
How about this... write the service to be more selective about what it's watching for. I know, this might be a huge mental leap for you, but sometimes, programming requires, ummm...., programming.
"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
|
|
|
|
|
John Simmons / outlaw programmer wrote: but sometimes, programming requires, ummm...., programming.
and I thought I was the only one that had that opinion. It seems many people think programming now only requires Lambda.
led mike
|
|
|
|
|
Maybe a timer is useful here?
|
|
|
|
|
What would you do if someone decided to copy 500 files from somewhere? You need to reconsider your requirements and design.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
That will not happen as this system will be used for files which are not supposed to be changed.
Thanks
|
|
|
|
|
arkiboys wrote: That will not happen as this system will be used for files which are not supposed to be changed.
I think what you mean is
That should not happen as this system will be used for files which are not supposed to be changed.
Anyway, back to your original problem. AFAIK an install is the same as copying files (at least to a file watcher), so how about seeing how many changes there are in say 30 seconds and send a single email out listing them? Not a perfect solution but maybe a viable work around?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Yes, I will try that.
Thank you
|
|
|
|
|
Hi everyone,
I am doing project on parsing a html content or content in a web page,to display any error in web page(i e to find out grammatical mistakes e.g meaning of word or syntax mistake etc)
which has been designed using html.
please help me out if there is any code or logic...it may be in c#,Java,JavaScript etc
|
|
|
|
|
Look at this article[^].
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|