Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 18th, 2007, 11:58 PM
Registered User
 
Join Date: Jun 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default filesystemwatcher problem (very urgent)


HI

This is shailendra.I am using vb 2005 to develop a stock market charting product.
The chart needs to be updated every 5 min or when the data of the specific company gets updated.
To update the chart i have applied filesystemwatcher to do the same.

The problem i am facing is ,when i am trying to open a new window the updation of last highlighted window is disturbed.I cant get the actual problem occuring with the last highlighted window coz the oher unhighlighted windows get updated .

The code i have used is
#Region "Tick update"
    'Procedure to watch the fil with the fom's name
    Private Sub watchnupdate()

        ' Create a new FileSystemWatcher and set its properties.
        Dim watcher As New FileSystemWatcher()

        fs = New FileStream("intrapath.ini", FileMode.Open, FileAccess.Read)
        strread = New StreamReader(fs)
        watcher.Path = strread.ReadLine.Trim & "\Intra5min"
        strread.Close()
        fs.Dispose()

        ' Watch for changes in LastAccess and LastWrite times, and
        ' the renaming of files or directories.
        watcher.NotifyFilter = (NotifyFilters.LastAccess Or NotifyFilters.LastWrite)
        ' Only watch text files.
        watcher.Filter = Me.Name & ".txt" 'applied for specific watch

        ' Add event handlers.
        AddHandler watcher.Changed, AddressOf OnChanged

        ' Begin watching.
        watcher.EnableRaisingEvents = True

    End Sub

    ' Define the event handlers.
    Private Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs)
        ' Specify what is done when a file is changed, created, or deleted.

        scrolled = True 'This variable is reset to true to draw all the indicators aplied on the chart.

        drawChart(winChartViewer1) 'to redraw the chart

    End Sub

#End Region

Shailendra
 
Old June 29th, 2007, 03:56 AM
Registered User
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to atilak_2001
Default

Dear Shailendra,

I dont think there is any problem with your above code. The problem might be in your drawChart function. Check it first.

-Ash.

Positiveness is in my blood.. I'm O+.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the FileSystemWatcher Control Eyob_the_pro C# 0 January 4th, 2007 03:08 AM
FileSystemWatcher brawny4 Visual Basic 2005 Basics 3 December 28th, 2006 12:47 PM
FileSystemWatcher? [C#] mahesh_ys@indiatimes.com General .NET 2 May 13th, 2005 03:50 AM
HELP - FileSystemWatcher Problems hugh@kmcnetwork.com Pro VB.NET 2002/2003 0 January 10th, 2005 09:37 PM
FileSystemWatcher Problem hugh@kmcnetwork.com VB.NET 0 December 18th, 2004 11:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.