home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / vrac / rwini.zip / RWINI.FRM < prev    next >
Text File  |  1994-08-01  |  7KB  |  255 lines

  1. VERSION 2.00
  2. Begin Form frmINI 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Read-Write INI Sample"
  5.    ClientHeight    =   3240
  6.    ClientLeft      =   1155
  7.    ClientTop       =   2190
  8.    ClientWidth     =   7740
  9.    Height          =   3645
  10.    Icon            =   RWINI.FRX:0000
  11.    Left            =   1095
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3240
  14.    ScaleWidth      =   7740
  15.    Top             =   1845
  16.    Width           =   7860
  17.    Begin CommandButton Command12 
  18.       Caption         =   "Exit"
  19.       Height          =   495
  20.       Left            =   3120
  21.       TabIndex        =   15
  22.       Top             =   2520
  23.       Width           =   1215
  24.    End
  25.    Begin TextBox Text4 
  26.       Height          =   285
  27.       Left            =   1800
  28.       TabIndex        =   3
  29.       Top             =   1320
  30.       Width           =   1935
  31.    End
  32.    Begin CommandButton Command11 
  33.       Caption         =   "Read Phone"
  34.       Height          =   255
  35.       Left            =   3960
  36.       TabIndex        =   10
  37.       Top             =   1320
  38.       Width           =   1575
  39.    End
  40.    Begin CommandButton Command10 
  41.       Caption         =   "Write Phone"
  42.       Height          =   255
  43.       Left            =   5640
  44.       TabIndex        =   11
  45.       Top             =   1320
  46.       Width           =   1575
  47.    End
  48.    Begin CommandButton Command9 
  49.       Caption         =   "Clear All"
  50.       Height          =   495
  51.       Left            =   4440
  52.       TabIndex        =   14
  53.       Top             =   1920
  54.       Width           =   1215
  55.    End
  56.    Begin CommandButton Command8 
  57.       Caption         =   "Write All"
  58.       Height          =   495
  59.       Left            =   3120
  60.       TabIndex        =   13
  61.       Top             =   1920
  62.       Width           =   1215
  63.    End
  64.    Begin CommandButton Command7 
  65.       Caption         =   "Read All"
  66.       Height          =   495
  67.       Left            =   1800
  68.       TabIndex        =   12
  69.       Top             =   1920
  70.       Width           =   1215
  71.    End
  72.    Begin CommandButton Command6 
  73.       Caption         =   "Write Company"
  74.       Height          =   255
  75.       Left            =   5640
  76.       TabIndex        =   9
  77.       Top             =   960
  78.       Width           =   1575
  79.    End
  80.    Begin CommandButton Command5 
  81.       Caption         =   "Write Name"
  82.       Height          =   255
  83.       Left            =   5640
  84.       TabIndex        =   7
  85.       Top             =   600
  86.       Width           =   1575
  87.    End
  88.    Begin CommandButton Command4 
  89.       Caption         =   "Write Serial"
  90.       Height          =   255
  91.       Left            =   5640
  92.       TabIndex        =   5
  93.       Top             =   240
  94.       Width           =   1575
  95.    End
  96.    Begin CommandButton Command3 
  97.       Caption         =   "Read Company"
  98.       Height          =   255
  99.       Left            =   3960
  100.       TabIndex        =   8
  101.       Top             =   960
  102.       Width           =   1575
  103.    End
  104.    Begin CommandButton Command2 
  105.       Caption         =   "Read Name"
  106.       Height          =   255
  107.       Left            =   3960
  108.       TabIndex        =   6
  109.       Top             =   600
  110.       Width           =   1575
  111.    End
  112.    Begin TextBox Text3 
  113.       Height          =   285
  114.       Left            =   1800
  115.       TabIndex        =   2
  116.       Top             =   960
  117.       Width           =   1935
  118.    End
  119.    Begin TextBox Text2 
  120.       Height          =   285
  121.       Left            =   1800
  122.       TabIndex        =   1
  123.       Top             =   600
  124.       Width           =   1935
  125.    End
  126.    Begin CommandButton Command1 
  127.       Caption         =   "Read Serial"
  128.       Height          =   255
  129.       Left            =   3960
  130.       TabIndex        =   4
  131.       Top             =   240
  132.       Width           =   1575
  133.    End
  134.    Begin TextBox Text1 
  135.       Height          =   285
  136.       Left            =   1800
  137.       TabIndex        =   0
  138.       Top             =   240
  139.       Width           =   1935
  140.    End
  141.    Begin Label Label4 
  142.       Alignment       =   1  'Right Justify
  143.       BackColor       =   &H00C0C0C0&
  144.       Caption         =   "Phone:"
  145.       Height          =   255
  146.       Left            =   480
  147.       TabIndex        =   19
  148.       Top             =   1320
  149.       Width           =   1215
  150.    End
  151.    Begin Label Label3 
  152.       Alignment       =   1  'Right Justify
  153.       BackColor       =   &H00C0C0C0&
  154.       Caption         =   "Company:"
  155.       Height          =   255
  156.       Left            =   480
  157.       TabIndex        =   18
  158.       Top             =   960
  159.       Width           =   1215
  160.    End
  161.    Begin Label Label2 
  162.       Alignment       =   1  'Right Justify
  163.       BackColor       =   &H00C0C0C0&
  164.       Caption         =   "Name:"
  165.       Height          =   255
  166.       Left            =   1080
  167.       TabIndex        =   17
  168.       Top             =   600
  169.       Width           =   615
  170.    End
  171.    Begin Label Label1 
  172.       Alignment       =   1  'Right Justify
  173.       BackColor       =   &H00C0C0C0&
  174.       Caption         =   "Serial Number:"
  175.       Height          =   255
  176.       Left            =   360
  177.       TabIndex        =   16
  178.       Top             =   240
  179.       Width           =   1335
  180.    End
  181. End
  182. Option Explicit
  183.  
  184.  
  185. Sub Command1_Click ()
  186.     text1.Text = GetFromINI("Serial", "SerialNumber", inipath$)
  187. End Sub
  188.  
  189. Sub Command10_Click ()
  190.     entry$ = text4.Text
  191.     r% = WritePrivateProfileString("UserInfo", "Phone", entry$, inipath$)
  192.     If r% <> 1 Then MsgBox "An error occurred while writing Phone."
  193. End Sub
  194.  
  195. Sub Command11_Click ()
  196.     text4.Text = GetFromINI("UserInfo", "Phone", inipath$)
  197. End Sub
  198.  
  199. Sub Command12_Click ()
  200.     End
  201. End Sub
  202.  
  203. Sub Command2_Click ()
  204.     text2.Text = GetFromINI("UserInfo", "Name", inipath$)
  205. End Sub
  206.  
  207. Sub Command3_Click ()
  208.     text3.Text = GetFromINI("UserInfo", "Company", inipath$)
  209. End Sub
  210.  
  211. Sub Command4_Click ()
  212.     entry$ = text1.Text
  213.     r% = WritePrivateProfileString("Serial", "SerialNumber", entry$, inipath$)
  214.     If r% <> 1 Then MsgBox "An error occurred while writing SerialNumber."
  215. End Sub
  216.  
  217. Sub Command5_Click ()
  218.     entry$ = text2.Text
  219.     r% = WritePrivateProfileString("UserInfo", "Name", entry$, inipath$)
  220.     If r% <> 1 Then MsgBox "An error occurred while writing Name."
  221. End Sub
  222.  
  223. Sub Command6_Click ()
  224.     entry$ = text3.Text
  225.     r% = WritePrivateProfileString("UserInfo", "Company", entry$, inipath$)
  226.     If r% <> 1 Then MsgBox "An error occurred while writing Company."
  227. End Sub
  228.  
  229. Sub Command7_Click ()
  230.     text1.Text = GetFromINI("Serial", "SerialNumber", inipath$)
  231.     text2.Text = GetFromINI("UserInfo", "Name", inipath$)
  232.     text3.Text = GetFromINI("UserInfo", "Company", inipath$)
  233.     text4.Text = GetFromINI("UserInfo", "Phone", inipath$)
  234. End Sub
  235.  
  236. Sub Command8_Click ()
  237.     Command4_Click
  238.     Command5_Click
  239.     Command6_Click
  240.     Command10_Click
  241. End Sub
  242.  
  243. Sub Command9_Click ()
  244.     text1.Text = ""
  245.     text2.Text = ""
  246.     text3.Text = ""
  247.     text4.Text = ""
  248. End Sub
  249.  
  250. Sub Form_Load ()
  251.     inipath$ = app.Path + "\rwini.ini"
  252.     Command7_Click
  253. End Sub
  254.  
  255.