|
Normally, you'd use the OnStart event of the server to start a new thread. This thread, in your case, would setup a FileSystemWatcher and sit there, waiting for events. The FileSystemWatcher fires a Created event whenever a file or folder is created in the directory it's watching. This is where you'd do you database update.
You wouldn't use a Timer to do this at all.
Try looking at this[^] and this[^].
|
|
|
|
|
Thank you very much. I didn't know about the file watch feature. I will read through the two links and see if I can apply them.
Do you know of any good books or websites that explain how to set up services that aren't file watchers? We are also wanting to set up some services that will synchronize data between a bought system and our in house systems.
Once again thank you very much for taking the time to respond to my questions and pointing me in the right direction.
If you can’t have fun at work, then why go to work?
|
|
|
|
|
I used VS 2008 to develop and deploy a small VB web project. The sample app has two buttons. One button will create a xml file and the other button will create a text file, see code below. Unfortunately, when I press either button on the web page, I get an “HTTP Error 404 - File or directory not found.”.
Any ideas on what the problem might be. The project works as advertised locally. By the way, how does VS (using a WEB project) handle calls to local drives? Let’s say that I am placing a file in the folder located at “C:\customers”. Does that translate to web, meaning the www.root folder?
Dim xmlFileName As String = "SampleWebApplication.xml" 'ensure each session is unique<br />
<br />
Using writer As XmlWriter = XmlWriter.Create(xmlFileName, settings)<br />
writer.WriteStartDocument()<br />
<br />
writer.WriteStartElement("Application")<br />
<br />
writer.WriteStartElement("Accept_Date")<br />
writer.WriteValue(Date.Now())<br />
writer.WriteEndElement()<br />
<br />
writer.WriteEndDocument()<br />
<br />
writer.Flush()
Using sw As StreamWriter = New StreamWriter("TestFile.txt")<br />
sw.WriteLine("This is a test")<br />
sw.WriteLine(DateTime.Now)<br />
sw.Close()
cab3
|
|
|
|
|
Ask this question in the ASP.NET forum.
I will tell you that one of the problems you're having is you're not specifying a full path to the files you're trying to write. Your code assumes the current directory is the directory your web pages are being served from. You can't do that. It's always good practice to build fully qualified path names to files. In order to do that in an ASP.NET app, I think you have to look into the Server.MapPath method.
|
|
|
|
|
Thanks very much. Yes you are right, and that fixed the problem.
cab3
|
|
|
|
|
i have faced problem in crystal report.
|
|
|
|
|
And?? You might want to describe the problem, including any error messages you're getting.
|
|
|
|
|
So have I, many a time
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Well, has the thought occurred to you to be a little more specific about your problem?
prakash_adysoft wrote: i have faced problem in crystal report.
How do you expect anyone to help with a post like that?
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Can anybody tell me how to get the company name which was given at the installation time of O.S.
If you know then tell me in VB.net
Gagan
|
|
|
|
|
I think it's just in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion key, under RegisteredOrganization .
|
|
|
|
|
Thanks for ur help The JZ..
It works..
|
|
|
|
|
I have used much graphics in my project and in result, my program is working very slow.
Graphics are used to draw the title of product and it also creates craphics to work as a background image.
Some graphics are also used to give a pure "Glass" look to program and components used in it(ex-buttons,forms etc.).
Plz help to seed up the execution of program with the same graphics.
Gagan
|
|
|
|
|
There's no one command or thing you can do to speed up the code you've written. You simply have to go through the code and think of different ways of doing what you are. For example, If you're contantly redrawing the same static graphic, draw the image once to a bitmap, then just draw that bitmap image to whatever you need.
|
|
|
|
|
Thanks for ur suggestion Dave Kreskowiak
|
|
|
|
|
Like Dave said, you may want to try to improve your code.
I think the best way to do that is running a profiler on your code.
The profiler runs your code, and then tells you how much time each function/method has taken, and how many times it has been called, so you could work only in the parts of code that are representative.
An example of .net profiler is EQATEC Profiler
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
Is there a way in VS2005 to see all threads created? I want to see if I am creating new threads and not aborting them.
Never Mind I found Debbug --> Windows --> Threads
You have to start debugging first.
Thanks
|
|
|
|
|
|
I am using vb.net 3.5 as frontend
I have two forms, one is MDIMain and other is a modal form
When I open a form from a MDIForm as Showdialog(), there is two forms shows in the taskbar, one is MDI and other is Modal form.
That is the Problem. Because I want to open the modal form always top of the Mdi form. that means when MDI form shows then always show sthe modal form .
How can I solve the Problem?
|
|
|
|
|
pdnet wrote: When I open a form from a MDIForm as Showdialog(), there is two forms shows in the taskbar, one is MDI and other is Modal form.
That is the Problem
set Modal Form properties "ShowInTaskBar" to false
hope this helps
|
|
|
|
|
I have a datagridview with a comboboxcell.When I try to select an item in this column the mouse goes on the last item and I must find a way to make the mouse go on the first item.
For example: the items in my comboboxcell are: "Month","Day","Year".
The mouse goes on "Year" but I want the mouse to go on "Month".
Thanks.
|
|
|
|
|
Hi,
I m using label control on windows media player i wanna make the label
transperant for WMP
How can i do it??
Unless u don't give ur hundred percent whatever u r doing till there is no result of ur work...
|
|
|
|
|
Change the backcolor property of label control to transparent.
label1.backcolor=color.transparent
Hope, this will work..
By- Gagan
|
|
|
|
|
Thanks
But i already have tried it, the label become transperant for the form(Parent) not for the Windows Media Playe r....
I set the label's parent to WMP but nothing happened...
Unless u don't give ur hundred percent whatever u r doing till there is no result of ur work...
|
|
|
|
|
Do the same thing at run-time not at design time.
|
|
|
|