PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/Visual Studio 2008/CSWebBrowserWithProxy/INTERNET_PER_CONN_OPTION.cs

#
C# | 78 lines | 40 code | 6 blank | 32 comment | 0 complexity | fb7d0a74147c9b74e3a2fb5c810f712c MD5 | raw file
  1. /****************************** Module Header ******************************\
  2. Module Name: INTERNET_PER_CONN_OPTION.cs
  3. Project: CSWebBrowserWithProxy
  4. Copyright (c) Microsoft Corporation.
  5. This file defines the struct INTERNET_PER_CONN_OPTION and constants used by it.
  6. The struct INTERNET_PER_CONN_OPTION contains the value of an option that to be
  7. set to internet settings.
  8. Visit http://msdn.microsoft.com/en-us/library/aa385145(VS.85).aspx to get the
  9. detailed description.
  10. This source is subject to the Microsoft Public License.
  11. See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
  12. All other rights reserved.
  13. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
  14. EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  15. WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
  16. \***************************************************************************/
  17. using System.Runtime.InteropServices;
  18. namespace CSWebBrowserWithProxy
  19. {
  20. /// <summary>
  21. /// Constants used in INTERNET_PER_CONN_OPTION_OptionUnion struct.
  22. /// </summary>
  23. public enum INTERNET_PER_CONN_OptionEnum
  24. {
  25. INTERNET_PER_CONN_FLAGS = 1,
  26. INTERNET_PER_CONN_PROXY_SERVER = 2,
  27. INTERNET_PER_CONN_PROXY_BYPASS = 3,
  28. INTERNET_PER_CONN_AUTOCONFIG_URL = 4,
  29. INTERNET_PER_CONN_AUTODISCOVERY_FLAGS = 5,
  30. INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL = 6,
  31. INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS = 7,
  32. INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME = 8,
  33. INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL = 9,
  34. INTERNET_PER_CONN_FLAGS_UI = 10
  35. }
  36. /// <summary>
  37. /// Constants used in INTERNET_PER_CONN_OPTON struct.
  38. /// </summary>
  39. public enum INTERNET_OPTION_PER_CONN_FLAGS
  40. {
  41. PROXY_TYPE_DIRECT = 0x00000001, // direct to net
  42. PROXY_TYPE_PROXY = 0x00000002, // via named proxy
  43. PROXY_TYPE_AUTO_PROXY_URL = 0x00000004, // autoproxy URL
  44. PROXY_TYPE_AUTO_DETECT = 0x00000008 // use autoproxy detection
  45. }
  46. /// <summary>
  47. /// Used in INTERNET_PER_CONN_OPTION.
  48. /// When create a instance of OptionUnion, only one filed will be used.
  49. /// The StructLayout and FieldOffset attributes could help to decrease the struct size.
  50. /// </summary>
  51. [StructLayout(LayoutKind.Explicit)]
  52. public struct INTERNET_PER_CONN_OPTION_OptionUnion
  53. {
  54. // A value in INTERNET_OPTION_PER_CONN_FLAGS.
  55. [FieldOffset(0)]
  56. public int dwValue;
  57. [FieldOffset(0)]
  58. public System.IntPtr pszValue;
  59. [FieldOffset(0)]
  60. public System.Runtime.InteropServices.ComTypes.FILETIME ftValue;
  61. }
  62. [StructLayout(LayoutKind.Sequential)]
  63. public struct INTERNET_PER_CONN_OPTION
  64. {
  65. // A value in INTERNET_PER_CONN_OptionEnum.
  66. public int dwOption;
  67. public INTERNET_PER_CONN_OPTION_OptionUnion Value;
  68. }
  69. }