Link to home
Start Free TrialLog in
Avatar of Starr Duskk
Starr DuskkFlag for United States of America

asked on

Streamwriter error handling

I am using streamwriter to write to a file. It faiils to create a file but doesn't generate an exception.

How do I find an error?

try
  Dim objStreamWriter As StreamWriter
            objStreamWriter = File.CreateText(UniquefileName)
            objStreamWriter.Write(strOutput)
            'Close the stream
            objStreamWriter.Close()


        Catch ex As Exception
            SendError(ex.Message)
        End Try
ASKER CERTIFIED SOLUTION
Avatar of Amandeep Singh Bhullar
Amandeep Singh Bhullar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Starr Duskk

ASKER

how does flush help me find the error?
what does that do?
 
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial