WebException.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // System.Net.WebException.cs
  3. //
  4. // Author:
  5. // Lawrence Pit ([email protected])
  6. //
  7. using System.Runtime.Serialization;
  8. namespace System.Net
  9. {
  10. [Serializable]
  11. public class WebException : InvalidOperationException, ISerializable
  12. {
  13. private WebResponse response;
  14. private WebExceptionStatus status;
  15. // Constructors
  16. public WebException () : base ()
  17. {
  18. }
  19. public WebException (string message) : base (message)
  20. {
  21. }
  22. protected WebException (SerializationInfo serializationInfo,
  23. StreamingContext streamingContext)
  24. : base (serializationInfo, streamingContext)
  25. {
  26. }
  27. public WebException (string message, Exception innerException)
  28. : base (message, innerException)
  29. {
  30. }
  31. public WebException (string message, WebExceptionStatus status)
  32. : base (message)
  33. {
  34. this.status = status;
  35. }
  36. public WebException(string message,
  37. Exception innerException,
  38. WebExceptionStatus status,
  39. WebResponse response)
  40. : base (message, innerException)
  41. {
  42. this.status = status;
  43. this.response = response;
  44. }
  45. // Properties
  46. public WebResponse Response {
  47. get { return this.response; }
  48. }
  49. public WebExceptionStatus Status {
  50. get { return this.status; }
  51. }
  52. // Methods
  53. void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
  54. {
  55. base.GetObjectData (info, context);
  56. }
  57. }
  58. }