08年上半年软考程序员考试下午试题

发布时间:2012-07-19 共12页

     Cmb_type.AddItem "可执行文件 (*.exe)" 
     Cmb_type.ListIndex = 0 
     File1.Pattern = "*.*":  Txt_filename.Text = "" 
      Txt_file.Text = "" 
End Sub 
Private Sub Dir1_Change() 
     File1.Path =   (1)   
End Sub 
Private Sub Drive1_Change() 
   Dir1.Path = Drive1.Drive 
End Sub 

Private Sub Cmb_type_click () 
    Select Case Cmb_type.  (2)   
        Case 0 
            File1.Pattern = "*.*" 
        Case 1 
            File1.Pattern = "*.txt" 
        Case 2 
            File1.Pattern = "*.exe" 
    End Select 
End Sub 
Private Sub Cmd_save_Click () 
   usrFile = GetFileName()        ‘函数GetFileName获得要保存的文件名 
   Open usrFile For Output As #1  ‘定义 usrFile为1号输出文件 
   Print #1, Txt_file.Text        ‘输出到 1号文件 
   Close #1 
End Sub 
Private Sub File1_DblClick () 
   If right(File1.FileName, 3) <>    (3)   Then 
          MsgBox "请选择文本文件 !" 
          Exit Sub 
   End If 
   usrFile = GetFileName()   ‘函数GetFileName获得要打开的文件名 
   Open usrFile For Input As #1 ‘定义 usrFile为1号输入文件 
   Txt_file.Text = "" 
   Do While   (4)   EOF (1) 
      Line Input #1, fContext  ‘从1号文件读入一行 
      Txt_file.Text = Txt_file.Text +   (5)   + vbCrLf 
   Loop 
   Close #1 
End Sub 
  ‘其他代码略 

2008年上半年  程序员 下午试卷 第 10 页 (共 12 页) 

百分百考试网 考试宝典

立即免费试用