Results 1 to 5 of 5

Thread: Solve this error message..

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    93

    Solve this error message..

    Anyone knows what does it says?

    An unhandled exception of type 'System.IO.DirectoryNotFoundException' occurred in GAC_System.Windows.Forms_v1_0_3300_0_cneutral_1.dll
    An elephant learning VB..

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    What exactly does your code look like. Just from scanning over the thrown exception indicates a directory that does not exist was trying to get accessed.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    93
    My code...

    VB Code:
    1. Imports System.Object
    2. Imports System.IO
    3.  
    4. Public Class Form1
    5.     Inherits System.Windows.Forms.Form
    6.     Friend WithEvents Button1 As System.Windows.Forms.Button
    7.     Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
    8.  
    9. #Region " Windows Form Designer generated code "
    10.  
    11.     Public Sub New()
    12.         MyBase.New()
    13.  
    14.         'This call is required by the Windows Form Designer.
    15.         InitializeComponent()
    16.  
    17.         'Add any initialization after the InitializeComponent() call
    18.  
    19.     End Sub
    20.  
    21.     'Form overrides dispose to clean up the component list.
    22.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    23.         MyBase.Dispose(disposing)
    24.     End Sub
    25.  
    26.     'NOTE: The following procedure is required by the Windows Form Designer
    27.     'It can be modified using the Windows Form Designer.  
    28.     'Do not modify it using the code editor.
    29.     Friend WithEvents tbmain As System.Windows.Forms.TextBox
    30.     Private Sub InitializeComponent()
    31.         Me.MainMenu1 = New System.Windows.Forms.MainMenu()
    32.         Me.tbmain = New System.Windows.Forms.TextBox()
    33.         Me.Button1 = New System.Windows.Forms.Button()
    34.         '
    35.         'tbmain
    36.         '
    37.         Me.tbmain.Location = New System.Drawing.Point(24, 32)
    38.         Me.tbmain.Multiline = True
    39.         Me.tbmain.Size = New System.Drawing.Size(192, 128)
    40.         Me.tbmain.Text = "TextBox1"
    41.         '
    42.         'Button1
    43.         '
    44.         Me.Button1.Location = New System.Drawing.Point(112, 200)
    45.         Me.Button1.Size = New System.Drawing.Size(104, 40)
    46.         Me.Button1.Text = "Button1"
    47.         '
    48.         'Form1
    49.         '
    50.         Me.ClientSize = New System.Drawing.Size(240, 270)
    51.         Me.Controls.Add(Me.Button1)
    52.         Me.Controls.Add(Me.tbmain)
    53.         Me.Menu = Me.MainMenu1
    54.         Me.Text = "Form1"
    55.  
    56.     End Sub
    57.  
    58.     Public Shared Sub Main()
    59.         Application.Run(New Form1())
    60.         Directory.CreateDirectory("D:\Louis\Misc\listing.txt")
    61.     End Sub
    62.  
    63. #End Region
    64.  
    65.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    66.         Dim sIn As StreamReader
    67.         Dim cLine As String
    68.         Dim bDone As Boolean = False
    69.  
    70.         Dim din As StreamReader = File.OpenText("D:\Louis\misc\listing.txt")
    71.         Try
    72.             While Not bDone
    73.                 cLine = sIn.ReadLine()
    74.                 If cLine Is Nothing Then
    75.                     bDone = True
    76.                 Else
    77.                     tbmain.Text = tbmain.Text & cLine
    78.                 End If
    79.             End While
    80.         Finally
    81.             sIn.Close()
    82.  
    83.         End Try
    84.  
    85.  
    86.     End Sub
    87. End Class
    An elephant learning VB..

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Try this and see what you come up with...

    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim sIn As StreamReader
    3.         Dim cLine As String
    4.         Dim bDone As Boolean = False
    5.  
    6.         Try
    7.            Dim din As StreamReader = File.OpenText("D:\Louis\misc\listing.txt")
    8.         Catch ex As Exception
    9.             MessageBox.Show(ex.toString)
    10.         End Try
    11.  
    12.        
    13.  
    14.         Try
    15.             While Not bDone
    16.                 cLine = sIn.ReadLine()
    17.                 If cLine Is Nothing Then
    18.                     bDone = True
    19.                 Else
    20.                     tbmain.Text = tbmain.Text & cLine
    21.                 End If
    22.             End While
    23.         Finally
    24.             sIn.Close()
    25.  
    26.         End Try
    27.  
    28.  
    29.     End Sub

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    93
    I run this on the PocketPC Emulator but the message box shows " System.IO.DirectoryNotFoundException"

    I think it somehow still can't find a route to my D:/ ?
    An elephant learning VB..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width