|
|||||
|
Velkommen IntroASP.NET og XML IntroduktionXML CSS XSL(T) DTD og Schemas DOM og SAX Værktøjer XML i datagrid XML - skrivning af XML XML og transformationer XML - udtræk af elementer Dataset og datagrid objektet Indlæsning af dataPaging Sortering Ret post Slet post Opret ny post Hyperlinks i datagrid Billeder i datagrid Vælg post i datagrid Cache Et eksempel med det hele Datagrid, database og datasetDataset - extra CloneMerge Relationer Class Hvordan gør manAndeby klassen i vb Andeby klassen i c-sharp Webservices IndledningEtablering af en web-service Kald af web-services Sikkerhed ModellerBrug af forms modellen Opret cookie selv File upload Optimering Hvad kan man gøreMere om caching Fejlsøgning TracingFejlhaandtering De andre fejl Et lille CMS Basis infoVis side Ret side Styr sider Pæn URL Et demo system Kalender kontrollen Et lille kodeeksempel |
ASP.NET II / Fejlsøgning / Fejlhaandtering
Fejlhåndtering - try-catchVi har set Try-catch blokkene, men lad os lige slå syntaksen fast. Try ' code block til run [Catch [exception [As type]] [When expression] ' code to run if the exception generated matches ' the exception and expression defined above [Exit try] ] Catch [exception [As type]] [When expression] ' code to run if the exception generated matches ' the exception and expression defined above [Exit try] [Finally ' code that alway runs, whether or not an exception ' was caught, unless Exit Try is calles ] try Og så lige et lille eksempel: Public Function GetFileContents(file As String) As String Dim contents As String Try Dim sr As New StreamReader(file) contents = sr.ReadToEnd() sr.Close Catch exArg As ArgumentException ' argument not supplied Catch exFNF As FileNotFoundException ' file was not found - handle error Finally End Try |
||||