|
I used a stupid hack.
I made a table of last access.
If it's less than 1s ago, I do nothing...
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Hi,
FileSystemWatcher is not perfect; it typically fires multiple times when something happens to a file, often because one user action causes several technical operations on the directory entry: a file gets created/opened, data gets written, when the file gets flushed or closed some metadata gets updated, etc.
AFAIK there is nothing you can do against that, if you only want one event, you have to take whatever number of events coming at you and filter them yourself.
And the most useful feature is missing, it would fire an event (just one!) when one is done acting on a file, the way it operates right now is it fires from the beginning of an action, so one never is sure the file isn't in some intermediate state.
BTW: FileSystemWatcher also may drop some events, e.g. when there is much activitity going on in your watched folder.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Good to know!
Anyway I am watching human edited config file, so I should be ok!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
HI Experts
I m inserting image in DB.I have made connection object and passed con. string in it....when my control comes to Executnonquery it gives me error as ->
ExecuteNonQuery: Connection property has not been initialized.
I m not getting the solution to it....
|
|
|
|
|
send the code plzzzzzzz
|
|
|
|
|
The Code Is
this.sqlConnection1.Open();
if (sqlCommand1.Parameters.Count == 0)
{
this.sqlCommand1.CommandText = "INSERT INTO tblImgData(ID," +
" Name,Picture) values(@ID,@Name,@Picture)";
this.sqlCommand1.Parameters.Add("@ID",
System.Data.SqlDbType.Int, 4);
this.sqlCommand1.Parameters.Add("@Name",
System.Data.SqlDbType.VarChar, 50);
this.sqlCommand1.Parameters.Add("@Picture",
System.Data.SqlDbType.Image);
}
this.sqlCommand1.Parameters["@ID"].Value = this.editID.Text;
this.sqlCommand1.Parameters["@Name"].Value = this.editName.Text;
this.sqlCommand1.Parameters["@Picture"].Value = this.m_barrImg;
int iresult = this.sqlCommand1.ExecuteNonQuery();
MessageBox.Show(Convert.ToString(iresult));
|
|
|
|
|
Have you set the Connection property of sqlCommand1 ?
this.sqlCommand1.Connection = this.sqlConnection1;
I won’t not use no double negatives.
|
|
|
|
|
Thanks Philip
It Worked...
|
|
|
|
|
Hi all!
i want to fire an event to my application when ever i open or switch to other application.
for example: when i open word document, then the event should fire in my C# application. and when i change word document to another document then i need to get event.
need: i want to clear the clipbord data when the focus goes other than the internet explorer.
pls urgent... can anyone has any idea.
thanks in advance.
|
|
|
|
|
Here is two api GetForegroundWindow and GetWindowText for getting the title of forground window.
GetForegroundWIndow returns integer value. and pass it to GetWindowText.
Best Regard
If you can think then I Can.
|
|
|
|
|
Thanks for the reply.
i have already those two funcation. and i want to use that function while i past.
so my primary need is how to identify the past event.if i get the focus on the past event then i will use GetForegroundWindow and GetWindowText then i will decide whether to past or clear the clipboard.
do u have any idea on that !
thank you
Regards
.....Jack
|
|
|
|
|
you can use it by using hook.
Obvious you are changing application by Mouse or Keyboard.
By using hook u can check it in Keydown or mouse event.
Best Regard
If you can think then I Can.
|
|
|
|
|
Thanks !
if i dont get any other way then i will follow you.
and i too thought of that. but i was expecting some other ways.
Thanks for your idea.hope i will follow that.
thanks
Regards
.....Jack
|
|
|
|
|
ok,Good Luck
If you can think then I Can.
|
|
|
|
|
Hello all
I'm a beginer and I need some help documents.Is there a one that could help me more!!?
Please help me to find one or more.
Thank you.
Regards
Behesht
|
|
|
|
|
I saw the beginners article but I think I need more simpler docs
I don't know any thing about c#!!
and I'm new in dotnet too!(I'm so brave or maybe mad )
no problem I love to know C# and dotnet!!!!
Could you please help me!?
Thank you.
----
Regards
Behesht
|
|
|
|
|
You should use Books or Google.
And use these work practically.
If you can think then I Can.
|
|
|
|
|
A really good book I found was "C# for Dummies". Easily can get hold of via the web or at a book store.
|
|
|
|
|
Helo Every 1,
I want to receive files via MODEM and files are being transferred by XMODEM. I am using C# and want to receive files from different MODEMS.
What is the way to receive and send files by XMODEM using c#? I can do it by Hyper Terminal but I want to do it in my code.
Any Suggestion will be very helpful..
Thanks in advance..
Regards,
-SIFAR.
|
|
|
|
|
|
I have been hunting for over a week to understand xml. I have no Idea why the concept of how to use it alludes me. Sorry in advance. This is a real noob question.
I have built an application that manages the installation and updates several of our packaged products. The problem is All the settings are stored in sql tables.
I just need to understand is:
1)How to create a XML file that stores the connection string
2)How to refer to that XML file to use the connection string in the application.
3)If the file gets deleted, how to have the application recreate a template with a default connection string.
My Application is C#
Any information directly or indirectly would greatly be appreciated. This project needs done by the end of the week. And this is the only part I can not figure out.
mgeorge@peerassistllc.com
modified on Tuesday, June 23, 2009 11:05 PM
|
|
|
|
|
JollyMansArt wrote: 1)How to create a XML file that stores the connection string
2)How to refer to that XML file to use the connection string in the application.
You can use application configuration file (app.config ) for that. It is in XML format. There is a appSettings[^] element where connection strings can be stored. ConfigurationManager.AppSettings gives you access to this element.
|
|
|
|
|
I tried that but I can not seem to get the value to return properly... Here is what I do..
I go to the application project manager,
right click on project
Say properties
Go to the settings tab and put
Name: SQLConnectionString
Type: string
Scope: Application
Value: "Data Source=PA-DEVPLATFORM1\SQL2005;Initial Catalog=AppLoader;Persist Security Info=True;User ID=Mike;Password=zephyr"
This SQLConnection String I am wanting in a external XML file editable to the end user so I do not have to recompile the application for every sql server change.
Here is the code I am using to call it. It does not work.
SqlConnection conn = new SqlConnection(Properties.Settings.Default.SQLConnectionString);
I can not seem to get
ConfigurationSettings.AppSettings
to be identified as a valid command...
I got close by adding
public static NameValueCollection AppSettings { get; }
but the applications says it needs a set added to it.
PLEASE any help on this?
----------------------------------------------------------
So far I have figured out to get the setting I think I need to do this?
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["SQLConnectionString"].ToString());
But it still comes back saying the string is null... Why?
modified on Wednesday, June 24, 2009 1:54 AM
|
|
|
|
|
Got it....
string testanswer = PeerAssistLoader.Properties.Settings.Default.SQLConnectionString.ToString(); //["SQLConnectionString"].ToString();
MessageBox.Show(testanswer);
I had the value in the settings with quotes around the connection string. Since I was viewing that field as a string value. Now I know better...
modified on Wednesday, June 24, 2009 2:16 AM
|
|
|
|
|
JollyMansArt wrote: I am wanting in a external XML file editable to the end user
If you want it editable by the end user, I would create my own using XMLDocument - there is a big risk of the user damaging other application settings by mistake if he is encouraged to edit the app.config file directly.
See Here[^] for an example.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|