473,804 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

webbrowser System.IO.FileN otFoundExceptio n

Hi All,

I am using webbrowser control, it is very often to happen:

A first chance exception of type 'System.IO.File NotFoundExcepti on'
occurred in System.Windows. Forms.dll

but sometimes works, all the same code, what's the problem...and how to
resolve it...

Thank you very much.

Best regards,
Boki.

Apr 19 '06 #1
5 3073
Boki,

Is this when you are debugging, running, or whatever.

Can you show us the code where this happens?

Cor

"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** *************@z 34g2000cwc.goog legroups.com...
Hi All,

I am using webbrowser control, it is very often to happen:

A first chance exception of type 'System.IO.File NotFoundExcepti on'
occurred in System.Windows. Forms.dll

but sometimes works, all the same code, what's the problem...and how to
resolve it...

Thank you very much.

Best regards,
Boki.

Apr 19 '06 #2

Cor Ligthert [MVP] 寫道:
Boki,

Is this when you are debugging, running, or whatever.

Can you show us the code where this happens?

Cor

"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** *************@z 34g2000cwc.goog legroups.com...
Hi All,

I am using webbrowser control, it is very often to happen:

A first chance exception of type 'System.IO.File NotFoundExcepti on'
occurred in System.Windows. Forms.dll

but sometimes works, all the same code, what's the problem...and how to
resolve it...

Thank you very much.

Best regards,
Boki.


sure, please reference below
=============
Public Class Form1
Private mouseOffset As Point
Private isMouseDown As Boolean = False

Private Sub Form1_GotFocus( ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.GotFocus
Me.FormBorderSt yle = Windows.Forms.F ormBorderStyle. Fixed3D
End Sub

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
UpdateInfo()

End Sub

Private Sub WebBrowser1_Doc umentCompleted( ByVal sender As Object,
ByVal e As System.Windows. Forms.WebBrowse rDocumentComple tedEventArgs)
Handles WebBrowser1.Doc umentCompleted

WebBrowser2.Nav igate("http://mis.tse.com.tw/Quotes/Best5?Refresh=0 &StkNo=2392" )

Dim pos As Integer
pos = InStr(WebBrowse r1.DocumentText , "C)", CompareMethod.T ext)
Label1.Text = "T:" & Mid(WebBrowser1 .DocumentText, pos + 65, 4)

pos = InStr(WebBrowse r1.DocumentText , "(%)",
CompareMethod.T ext)
Label2.Text = "H:" & Mid(WebBrowser1 .DocumentText, pos + 66, 3)

Label4.Text = Mid$(TimeOfDay( ), 4, 9)

End Sub

Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As
System.EventArg s)
UpdateInfo()

' Label1.Text = "Auto updating..."
End Sub
Private Sub WebBrowser2_Doc umentCompleted( ByVal sender As Object,
ByVal e As System.Windows. Forms.WebBrowse rDocumentComple tedEventArgs)
Handles WebBrowser2.Doc umentCompleted
'-----stock information
Dim pos As Integer
pos = InStr(WebBrowse r2.DocumentText , "MatchPrice ",
CompareMethod.T ext)
Label5.Text = "S: " & Mid(WebBrowser2 .DocumentText, pos + 12,
5)

End Sub

Private Sub UpdateInfo()
WebBrowser1.Nav igate("http://www.cwb.gov.tw/V5/observe/real/real_data_46692 ..htm")
End Sub

Private Sub Form1_LostFocus (ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.LostFocus
Me.FormBorderSt yle = Windows.Forms.F ormBorderStyle. None
End Sub
Private Sub Form1_MouseUp(B yVal sender As Object, ByVal e As
MouseEventArgs) Handles MyBase.MouseUp
If e.Button = Windows.Forms.M ouseButtons.Rig ht Then
UpdateInfo()
End If
End Sub

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Window.open("ww w.kimo.com.tw")
End Sub
End Class

Apr 19 '06 #3
Boki,

Why do you not set the 2 or more webbrowsers in a Tabpage or a
splitcontainer. No problem as all.

I hope this helps,

Cor
"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** **************@ t31g2000cwb.goo glegroups.com.. .

Cor Ligthert [MVP] ??:
Boki,

Is this when you are debugging, running, or whatever.

Can you show us the code where this happens?

Cor

"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** *************@z 34g2000cwc.goog legroups.com...
Hi All,

I am using webbrowser control, it is very often to happen:

A first chance exception of type 'System.IO.File NotFoundExcepti on'
occurred in System.Windows. Forms.dll

but sometimes works, all the same code, what's the problem...and how to
resolve it...

Thank you very much.

Best regards,
Boki.


sure, please reference below
=============
Public Class Form1
Private mouseOffset As Point
Private isMouseDown As Boolean = False

Private Sub Form1_GotFocus( ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.GotFocus
Me.FormBorderSt yle = Windows.Forms.F ormBorderStyle. Fixed3D
End Sub

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
UpdateInfo()

End Sub

Private Sub WebBrowser1_Doc umentCompleted( ByVal sender As Object,
ByVal e As System.Windows. Forms.WebBrowse rDocumentComple tedEventArgs)
Handles WebBrowser1.Doc umentCompleted

WebBrowser2.Nav igate("http://mis.tse.com.tw/Quotes/Best5?Refresh=0 &StkNo=2392" )

Dim pos As Integer
pos = InStr(WebBrowse r1.DocumentText , "C)", CompareMethod.T ext)
Label1.Text = "T:" & Mid(WebBrowser1 .DocumentText, pos + 65, 4)

pos = InStr(WebBrowse r1.DocumentText , "(%)",
CompareMethod.T ext)
Label2.Text = "H:" & Mid(WebBrowser1 .DocumentText, pos + 66, 3)

Label4.Text = Mid$(TimeOfDay( ), 4, 9)

End Sub

Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As
System.EventArg s)
UpdateInfo()

' Label1.Text = "Auto updating..."
End Sub
Private Sub WebBrowser2_Doc umentCompleted( ByVal sender As Object,
ByVal e As System.Windows. Forms.WebBrowse rDocumentComple tedEventArgs)
Handles WebBrowser2.Doc umentCompleted
'-----stock information
Dim pos As Integer
pos = InStr(WebBrowse r2.DocumentText , "MatchPrice ",
CompareMethod.T ext)
Label5.Text = "S: " & Mid(WebBrowser2 .DocumentText, pos + 12,
5)

End Sub

Private Sub UpdateInfo()
WebBrowser1.Nav igate("http://www.cwb.gov.tw/V5/observe/real/real_data_46692 .htm")
End Sub

Private Sub Form1_LostFocus (ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.LostFocus
Me.FormBorderSt yle = Windows.Forms.F ormBorderStyle. None
End Sub
Private Sub Form1_MouseUp(B yVal sender As Object, ByVal e As
MouseEventArgs) Handles MyBase.MouseUp
If e.Button = Windows.Forms.M ouseButtons.Rig ht Then
UpdateInfo()
End If
End Sub

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Window.open("ww w.kimo.com.tw")
End Sub
End Class
Apr 19 '06 #4

Cor Ligthert [MVP] 寫道:
Boki,

Why do you not set the 2 or more webbrowsers in a Tabpage or a
splitcontainer. No problem as all.

I hope this helps,

Cor
"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** **************@ t31g2000cwb.goo glegroups.com.. .

Cor Ligthert [MVP] ??:
Boki,

Is this when you are debugging, running, or whatever.

Can you show us the code where this happens?

Cor

"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** *************@z 34g2000cwc.goog legroups.com...
Hi All,

I am using webbrowser control, it is very often to happen:

A first chance exception of type 'System.IO.File NotFoundExcepti on'
occurred in System.Windows. Forms.dll

but sometimes works, all the same code, what's the problem...and how to
resolve it...

Thank you very much.

Best regards,
Boki.


sure, please reference below
=============
Public Class Form1
Private mouseOffset As Point
Private isMouseDown As Boolean = False

Private Sub Form1_GotFocus( ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.GotFocus
Me.FormBorderSt yle = Windows.Forms.F ormBorderStyle. Fixed3D
End Sub

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
UpdateInfo()

End Sub

Private Sub WebBrowser1_Doc umentCompleted( ByVal sender As Object,
ByVal e As System.Windows. Forms.WebBrowse rDocumentComple tedEventArgs)
Handles WebBrowser1.Doc umentCompleted

WebBrowser2.Nav igate("http://mis.tse.com.tw/Quotes/Best5?Refresh=0 &StkNo=2392" )

Dim pos As Integer
pos = InStr(WebBrowse r1.DocumentText , "C)", CompareMethod.T ext)
Label1.Text = "T:" & Mid(WebBrowser1 .DocumentText, pos + 65, 4)

pos = InStr(WebBrowse r1.DocumentText , "(%)",
CompareMethod.T ext)
Label2.Text = "H:" & Mid(WebBrowser1 .DocumentText, pos + 66, 3)

Label4.Text = Mid$(TimeOfDay( ), 4, 9)

End Sub

Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As
System.EventArg s)
UpdateInfo()

' Label1.Text = "Auto updating..."
End Sub
Private Sub WebBrowser2_Doc umentCompleted( ByVal sender As Object,
ByVal e As System.Windows. Forms.WebBrowse rDocumentComple tedEventArgs)
Handles WebBrowser2.Doc umentCompleted
'-----stock information
Dim pos As Integer
pos = InStr(WebBrowse r2.DocumentText , "MatchPrice ",
CompareMethod.T ext)
Label5.Text = "S: " & Mid(WebBrowser2 .DocumentText, pos + 12,
5)

End Sub

Private Sub UpdateInfo()
WebBrowser1.Nav igate("http://www.cwb.gov.tw/V5/observe/real/real_data_46692 .htm")
End Sub

Private Sub Form1_LostFocus (ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.LostFocus
Me.FormBorderSt yle = Windows.Forms.F ormBorderStyle. None
End Sub
Private Sub Form1_MouseUp(B yVal sender As Object, ByVal e As
MouseEventArgs) Handles MyBase.MouseUp
If e.Button = Windows.Forms.M ouseButtons.Rig ht Then
UpdateInfo()
End If
End Sub

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Window.open("ww w.kimo.com.tw")
End Sub
End Class

because I don't know how to do that..><.....
could you please advice?

Apr 19 '06 #5
Boki,

Just drag a tabcontrol on your form
Drag in the tabpages the same as you did it now on the form, not so much to
learn.

Problem is that it is more dragging than code. Therefore I cannot even give
you a sample.

Cor

"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** ************@t3 1g2000cwb.googl egroups.com...

Cor Ligthert [MVP] ??:
Boki,

Why do you not set the 2 or more webbrowsers in a Tabpage or a
splitcontainer. No problem as all.

I hope this helps,

Cor
"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** **************@ t31g2000cwb.goo glegroups.com.. .

Cor Ligthert [MVP] ??:
Boki,

Is this when you are debugging, running, or whatever.

Can you show us the code where this happens?

Cor

"Boki" <bo******@ms21. hinet.net> schreef in bericht
news:11******** *************@z 34g2000cwc.goog legroups.com...
Hi All,

I am using webbrowser control, it is very often to happen:

A first chance exception of type 'System.IO.File NotFoundExcepti on'
occurred in System.Windows. Forms.dll

but sometimes works, all the same code, what's the problem...and how
to
resolve it...

Thank you very much.

Best regards,
Boki.


sure, please reference below
=============
Public Class Form1
Private mouseOffset As Point
Private isMouseDown As Boolean = False

Private Sub Form1_GotFocus( ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.GotFocus
Me.FormBorderSt yle = Windows.Forms.F ormBorderStyle. Fixed3D
End Sub

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
UpdateInfo()

End Sub

Private Sub WebBrowser1_Doc umentCompleted( ByVal sender As Object,
ByVal e As System.Windows. Forms.WebBrowse rDocumentComple tedEventArgs)
Handles WebBrowser1.Doc umentCompleted

WebBrowser2.Nav igate("http://mis.tse.com.tw/Quotes/Best5?Refresh=0 &StkNo=2392" )

Dim pos As Integer
pos = InStr(WebBrowse r1.DocumentText , "C)", CompareMethod.T ext)
Label1.Text = "T:" & Mid(WebBrowser1 .DocumentText, pos + 65, 4)

pos = InStr(WebBrowse r1.DocumentText , "(%)",
CompareMethod.T ext)
Label2.Text = "H:" & Mid(WebBrowser1 .DocumentText, pos + 66, 3)

Label4.Text = Mid$(TimeOfDay( ), 4, 9)

End Sub

Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As
System.EventArg s)
UpdateInfo()

' Label1.Text = "Auto updating..."
End Sub
Private Sub WebBrowser2_Doc umentCompleted( ByVal sender As Object,
ByVal e As System.Windows. Forms.WebBrowse rDocumentComple tedEventArgs)
Handles WebBrowser2.Doc umentCompleted
'-----stock information
Dim pos As Integer
pos = InStr(WebBrowse r2.DocumentText , "MatchPrice ",
CompareMethod.T ext)
Label5.Text = "S: " & Mid(WebBrowser2 .DocumentText, pos + 12,
5)

End Sub

Private Sub UpdateInfo()
WebBrowser1.Nav igate("http://www.cwb.gov.tw/V5/observe/real/real_data_46692 .htm")
End Sub

Private Sub Form1_LostFocus (ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.LostFocus
Me.FormBorderSt yle = Windows.Forms.F ormBorderStyle. None
End Sub
Private Sub Form1_MouseUp(B yVal sender As Object, ByVal e As
MouseEventArgs) Handles MyBase.MouseUp
If e.Button = Windows.Forms.M ouseButtons.Rig ht Then
UpdateInfo()
End If
End Sub

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Window.open("ww w.kimo.com.tw")
End Sub
End Class

because I don't know how to do that..><.....
could you please advice?
Apr 19 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6705
by: ulf | last post by:
Hello, After I got a FileNotFoundException in my real life CSharp code, I nailed it down to the following line: System.EnterpriseServices.ResourcePool rp = new System.EnterpriseServices.ResourcePool(null); The exception I get for this line is System.IO.FileNotFoundException: The specified module could not be found.
4
2890
by: Randy | last post by:
Hi, ok, I found a way to connect to a running instance of an (external) Internet Explorer and access - for example - the html source. That works fine! But now I have running application with an embedded IE webBrowser Control. Is there a possibility for my application to access the webBrowser control in the other application, too? Thanks in advance, Randy
1
3309
by: L. Chernov | last post by:
Hello, I am trying to work with .Net 2005 WebBrowser object, and put it on a "Windows control library" (embedded in a user control class) and then I am executing it from an ASP.Net webform(with IE6) with the following object tag: <OBJECT id="ModPkiObj" height="550" width="800" classid="http:ModPkiNew.dll#Mod.Online.Client.ModPkiNew.SignForm" name="ModPkiObj" VIEWASTEXT>
11
2849
by: Anil Gupte | last post by:
....and how do I insert one into my form? I used in VB 6.0 last, but cannot figure out where it is in .Net Thanx, -- Anil Gupte www.keeninc.net www.icinema.com
4
12013
by: Steve Richter | last post by:
I would like to build an HTML stream as a string and have the WebBrowser control render that HTML. Then on PostBack, or whatever it is called, I would like my code to be the one that receives what the WebBrowser control is sending. Effectively, my code would be the web server and the WebBrowser control would be the web client. All the examples I am seeing have the WebBrowser control being directed to a URL from which to get the HTML...
7
18723
by: - Electronic.HR - | last post by:
I have very strange and stupid problem with .NEt's webBrowser control... If I do this: ---------------------------------- private void btnGoogle_click(object sender, EventArgs e) { webBrowser1.Navigate(http://www.google.com);
2
11021
by: =?Utf-8?B?c2FtMDFt?= | last post by:
I have a remoting application that was developed on a Windows XP SP2 machine with VS2005 SP1. I finally got everything deployed using Wix 3.0, and it works great. Problem is, when I install the msi on a W23 server SP2, I get the following error: System.Runtime.Remoting.RemotingException: Remoting configuration failed with the exception 'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation....
11
2219
by: kimiraikkonen | last post by:
Hi there, I needed to use MouseOver event on Webbrowser which is NOT provided by webbrowser control natively(what a disappointment), so i decided to go with another route to simulate this like: //////////////////////////////////////////////// Public Sub DisplayHyperlinks(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs)
3
9445
by: TedTrippin | last post by:
Hi, Background - I've create a windows application in VS and added a WebBrowser component and all works well. I'm now trying to do this programmatically. My application now listens on a socket and when it receives a request it creates a new Form and adds a new WebBrowser. The problem - All works well without the WebBrowser, the form is visible, but when I do "Controls.Add(webBrowser)" I see nothing, not even something in the windows...
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.