版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

106 строки
3.3 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Linq;
  6. using System.Reflection;
  7. using System.Threading.Tasks;
  8. using System.Windows.Forms;
  9. namespace ProductionControl
  10. {
  11. partial class AboutBox1 : Form
  12. {
  13. public AboutBox1()
  14. {
  15. InitializeComponent();
  16. this.Text = "关于";// String.Format("关于 {0}", AssemblyTitle);
  17. this.labelProductName.Text = "自动化视觉检测系统";//AssemblyProduct;
  18. this.labelVersion.Text = String.Format("版本 {0}", AssemblyVersion);
  19. this.labelCopyright.Text = AssemblyCopyright;
  20. this.labelCompanyName.Text = AssemblyCompany;
  21. this.textBoxDescription.Text = AssemblyDescription;
  22. }
  23. #region 程序集特性访问器
  24. public string AssemblyTitle
  25. {
  26. get
  27. {
  28. object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
  29. if (attributes.Length > 0)
  30. {
  31. AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
  32. if (titleAttribute.Title != "")
  33. {
  34. return titleAttribute.Title;
  35. }
  36. }
  37. return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
  38. }
  39. }
  40. public string AssemblyVersion
  41. {
  42. get
  43. {
  44. return Assembly.GetExecutingAssembly().GetName().Version.ToString();
  45. }
  46. }
  47. public string AssemblyDescription
  48. {
  49. get
  50. {
  51. object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
  52. if (attributes.Length == 0)
  53. {
  54. return "";
  55. }
  56. return ((AssemblyDescriptionAttribute)attributes[0]).Description;
  57. }
  58. }
  59. public string AssemblyProduct
  60. {
  61. get
  62. {
  63. object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
  64. if (attributes.Length == 0)
  65. {
  66. return "";
  67. }
  68. return ((AssemblyProductAttribute)attributes[0]).Product;
  69. }
  70. }
  71. public string AssemblyCopyright
  72. {
  73. get
  74. {
  75. object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
  76. if (attributes.Length == 0)
  77. {
  78. return "";
  79. }
  80. return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
  81. }
  82. }
  83. public string AssemblyCompany
  84. {
  85. get
  86. {
  87. object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
  88. if (attributes.Length == 0)
  89. {
  90. return "";
  91. }
  92. return ((AssemblyCompanyAttribute)attributes[0]).Company;
  93. }
  94. }
  95. #endregion
  96. }
  97. }