|
Hiya all.
I instantiated a filesystemwatcher and set it to monitor a directory filtered with a specific file.
Then I made a method which handles the Changed event from the filesystemwatcher.... however when I save/alter the file the watcher monitors - I get the event called twice.
Does anybody know why? Or possible what I need to look for?
|
|
|
|
|
When I first used this class I had this problem - but I don't have the problem anymore.
To resolve my issue I no longer listen to CHange event, but to the Created, Renamed and Deleted events instead.
Depends on what you need to know, but these covered my requirements.
Stuart Wells
Software Engineer
|
|
|
|
|
It's because a changed-event fires more than you probably expect, for example:
- When you create a file
- When you delete a file
- When you rename a file
- ...
|
|
|
|
|
I have a file, in which I need to monitor changes, so I can't use any of the others. The file exits, so it isn't because it gets created that the watcher triggers twice.
Both events are the "Changed" event.
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
I don't know for sure, but maybe you get one event for the content change, and one for the update of the LastWriteTime ?
Luc Pattyn
|
|
|
|
|
Hmm - could be, could be.
|
|
|
|
|
It depends on the file too. If it's a Word document, for example, you're not opening the orignal file. You actually open a copy of it. When you go to save the changes, the file is actually written to the temporary copy (Changed event), then the original file is deleted (Changed event) and the temporary file is renamed (Changed event) to the orignal filename.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
it's an XML document, opened via notepad.
|
|
|
|
|
I have a RichTextBox on a winform, it was placed there by dragging from the datasouces page, so it is bound to the datafield that contains rtf formatted text. However when I scroll through records in the database when I come across a data record that has rtf formatting it shows the RTF code as well as the text in the field As such:
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil MS Sans Serif;}{\f1\fnil\fcharset0 MS Sans Serif;}}
{\colortbl ;\red0\green0\blue255;}
\viewkind4\uc1\pard\lang1033\b\f0\fs16 #4 Ker Long Heeled --Egg Bar--51/2x63/4\f1 --1/2" wedge\par
\cf1 11/02\cf0 --Changed to Natural Balance shoes \f0\par
}
What do I have to do to get the text only from this field to display?
All I really need to do is extract the text from this field
string text = fRONTRichTextBox.Text; Ithought this returned only the text
string rtf = fRONTRichTextBox.Rtf; I thought this returned the text and rtf code formatting
But..Both return the same value:
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil MS Sans Serif;}{\f1\fnil\fcharset0 MS Sans Serif;}}
{\colortbl ;\red0\green0\blue255;}
\viewkind4\uc1\pard\lang1033\b\f0\fs16 #4 Ker Long Heeled --Egg Bar--51/2x63/4\f1 --1/2" wedge\par
\cf1 11/02\cf0 --Changed to Natural Balance shoes \f0\par
}
Thanks Jon Stroh
|
|
|
|
|
After digging deeper some records are processed by the control corectly, some are not. The ones that are have double back slashes in them are processed corectly
{\\rtf1\\ansi\\deff0{
the ones that show text and rtf formatting code have single back slashes
{rtf1\ansi\deff0{
How can I get the control to show both corectly?
string text = fRONTRichTextBox.Text;
string rtf = fRONTRichTextBox.Rtf;
This code works just fine as long as there are double \\ in the rtf code.
Thanks Jon
|
|
|
|
|
Hello,
here is a function's signatures for 2 PowerPoint effects event handlers:
SlideShowNextClick(SlideShowWindow Wn,Effect ef)
The effect onNextClick is ef.
SlideShowNextBuild(SlideShowWindow Wn)
What is a currently executed effect??
At the moment I have next implementation:
1. By handle SlideShowNextClick store next effect name ("xyz").
2. By handle SlideShowNextBuild execute my bussiness logic (for effect "xyz").
The problem occurs if the current slide has more than 1 effect on page and "go back" button will be used. ==> I can't catch "goback"-event, thus I can't be sure that my stored "NextEffect" is a next effect realy.
Is it possible to get number/name of currently executed effect directly in SlideShowNextBuild handler?
Thanks for your help.
|
|
|
|
|
Hiya all.
I'm messing about a little with processes, and I've got a question about the name of a process.
I made a service which when ran could be found again using the process name of the assembly (for instance myproject.service) - is this the common method of processnaming in windows services for .NET or is it possible to provide/define the process name itself?
|
|
|
|
|
Does any one have experience working with a gsm modem.
How to communicate with a server(also connected to a GSM mdem).
Dialing a server modem number.and the server returning data to the modem dialling.(the modems are connected to the computers via a serial connection)
|
|
|
|
|
Hello,
I would like to approximate cursor position to some GraphicsPath. Is it possible to do it? I found a function IsOutlineVisible which should work, but I dont know how...
thank you...
|
|
|
|
|
|
In C++ I used CWinThread to create forms on separate threads. Is there a CWinThread equivalent for .NET?
|
|
|
|
|
System.Threading.Thread
only two letters away from being an asset
|
|
|
|
|
I'm made a RDLC report with .net 2005 and ms-access XP.
I've taken 8.268 x 11.698 inch (A-4) size of report area because it's not a list its a proforma,
and I've set all controls which covers whole page, means one record covers a single page.
I've manually desiged report and given blank area in report for initial margins in left,right,top,bootoms.
Report result is satisfactory and all data displaying properly.
But a little problem with printing. When I Print report
It print 4 pages which takes some data of left portion of first page
and second page takes content from right portion and also in
third and fourth page.
after Keen observation i've seen that the by default print dialog sets the
margin 1" for all sides. when we set page margins 0,0,0,0
in page setup dialog box, report printing is perfect as i want in one page.
Is any method to change page setup (Margin) by code in report viewer so
I can print my page every time correct and does'nt need to change page
setup every time I print.
Ashkumar
|
|
|
|
|
I can usually get up and running with a Forms control pretty quickly, but this one has me baffled. I can only conclude that I don't understand what it's for.
Basically, I need a control to display a list of items, one at a time. I need the ability to scroll through said items and change them on the fly. For example, say the user is using a program and types a new value into the DomainUpDown control. The new value replaces the old value at the currently selected index.
But that isn't how the DomainUpDown control behaves. It doesn't change the selected item to the value that's been entered. I'm not sure why.
Any clues will be appreciated. If there's another control I should use instead, I'd be happy if someone could point me in the right direction.
|
|
|
|
|
I did a finer reading of the documentation[^] for the DomainUpDown control class...
The user can also enter text in the control, unless the ReadOnly property is set to true (the string typed in must match an item in the collection to be accepted).
Well, apparently the DomainUpDown control isn't what I'm looking for.
|
|
|
|
|
I would just use a ListView or ListBox.
|
|
|
|
|
Hi.
I'm writing an application with Compact Framework 2.0 SP 1. I want to apply the [STAThread] attribute to the main method, but there seems to be no such attribute. I get offered the MTAThread attribute, but not STAThread. Of course, the compiler doesn't find either. It just seems to be missing in the referenced assemblies (System.dll). I didn't find anything about this problem on the web, so could anybody help me, please? I'm quite desperate. I already reinstalled the CF 2.0, no success. Nobody else seems to have had this problem, ever. Help!!!
Thanks!
rudiman
-- modified at 18:59 Saturday 2nd December, 2006
|
|
|
|
|
You can't do that. STAThreadAttribute is not supported in Compact Framework.
---
b { font-weight: normal; }
|
|
|
|
|
Hi....
I have devoloped website in asp.net.
I just upload the project using ftp. Its works,
but i dont know how to upload sql database on server.
Can anybody please help me, Pls give me full details.
I used connectionstring in web.config which works for localhost.
but what connection string i should use for uploding on net.
|
|
|
|
|
Don't cross post
only two letters away from being an asset
|
|
|
|