frmserialregedit.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:3k
源码类别:

医药行业

开发平台:

Visual Basic

  1. Imports System.Security.Cryptography
  2. Imports Microsoft.Win32
  3. Public Class frmserialregedit
  4.     Inherits System.Windows.Forms.Form
  5.     Public regeditvalue As String
  6. #Region " Windows 窗体设计器生成的代码 "
  7.     Public Sub New()
  8.         MyBase.New()
  9.         '该调用是 Windows 窗体设计器所必需的。
  10.         InitializeComponent()
  11.         '在 InitializeComponent() 调用之后添加任何初始化
  12.     End Sub
  13.     '窗体重写 dispose 以清理组件列表。
  14.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  15.         If disposing Then
  16.             If Not (components Is Nothing) Then
  17.                 components.Dispose()
  18.             End If
  19.         End If
  20.         MyBase.Dispose(disposing)
  21.     End Sub
  22.     'Windows 窗体设计器所必需的
  23.     Private components As System.ComponentModel.IContainer
  24.     '注意: 以下过程是 Windows 窗体设计器所必需的
  25.     '可以使用 Windows 窗体设计器修改此过程。
  26.     '不要使用代码编辑器修改它。
  27.     Friend WithEvents btnregedit As System.Windows.Forms.Button
  28.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  29.         Me.btnregedit = New System.Windows.Forms.Button
  30.         Me.SuspendLayout()
  31.         '
  32.         'btnregedit
  33.         '
  34.         Me.btnregedit.Location = New System.Drawing.Point(104, 64)
  35.         Me.btnregedit.Name = "btnregedit"
  36.         Me.btnregedit.Size = New System.Drawing.Size(104, 32)
  37.         Me.btnregedit.TabIndex = 0
  38.         Me.btnregedit.Text = "写入注册表"
  39.         '
  40.         'frmserialregedit
  41.         '
  42.         Me.AutoScaleBaseSize = New System.Drawing.Size(8, 18)
  43.         Me.ClientSize = New System.Drawing.Size(478, 310)
  44.         Me.Controls.Add(Me.btnregedit)
  45.         Me.Name = "frmserialregedit"
  46.         Me.Text = "frmserialregedit"
  47.         Me.ResumeLayout(False)
  48.     End Sub
  49. #End Region
  50.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnregedit.Click
  51.         SetUp()
  52.     End Sub
  53.     Sub SetUp()
  54.         Dim SetUp As RegistryKey
  55.         SetUp = Registry.LocalMachine.CreateSubKey("SOFTWAREJxcDFT StudioRegister")
  56.         SetUp = Registry.LocalMachine.OpenSubKey("SOFTWAREJxcDFT StudioRegister", True)
  57.         SetUp.SetValue("State", "aBcfvdgv")
  58.         SetUp.Close()
  59.     End Sub
  60.     Private Sub readregedit()
  61.         Dim State As RegistryKey
  62.         State = Registry.LocalMachine.OpenSubKey("SOFTWAREJxcDFT StudioRegister")
  63.         Dim StateValue As String
  64.         Try
  65.             StateValue = State.GetValue("State")
  66.         Catch
  67.         End Try
  68.         regeditvalue = StateValue
  69.     End Sub
  70.    
  71. End Class