using System;using System.Collections;using System.Collections.Generic;using System.Net;using System.IO;using System.Text;using System.Drawing;using System.Text.RegularExpressions; namespace ConsoleApplication1{ class Program { static string GetHtml(string url) { string html = string.Empty; HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; request.Timeout=20*1000; HttpWebResponse response = request.GetResponse() as HttpWebResponse; Stream s = response.GetResponseStream(); StreamReader sr = new StreamReader(s,Encoding.Default); html = sr.ReadToEnd(); return html; } static void Main(string[] args) { try { Operation(); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.ReadKey(); } private static void Operation() { try { int numberA = Convert.ToInt32(Console.ReadLine()); int numberB = Convert.ToInt32(Console.ReadLine()); int result = numberA / numberB; Console.WriteLine("结果:" + result); } catch (Exception ex) { throw;//注意如果写上throw说明将捕获到的异常再次抛给调用函数,如果不写,则说明异常已经默认处理 } } } }