www.pudn.com > textmanager.rar > ModDingYi.bas, change:2005-04-12,size:1487b


Attribute VB_Name = "ModDingYi" 
Option Explicit 
 
 '整个服务器应用的操作员Code和Pass 
 Global UserCode As String 
 Global UserPass As String 
   '整个应用程序期间的数据库连接 
 Global DB As Connection 
 '生成试卷时每个题目的分数 
 Global Score As String 
 '保存现在处理的科目ID和年级ID 
 Global UseKeMuID As Long 
 Global UseNianJiID As Long 
 '设置处理的窗口,主要用于选择处理的科目和年级 
 Global UseForm As String 
  
'读写INI文件的API函数 
 Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long 
 
Global InIpath As String 'ini文件路径 
'执行外部程序 
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long 
 
 
'创建默认的ini文件 '写ini文件 
Sub CreateInI(ByVal ServerName As String, ByVal LoginName As String, ByVal Pass As String, ByVal DbName As String) 
  Dim TStr As String 
  TStr = "[Server]" + vbCrLf 
  TStr = TStr + "ServerName=" + ServerName + vbCrLf 
  TStr = TStr + "LoginName=" + LoginName + vbCrLf 
  TStr = TStr + "PassWord=" + Pass + vbCrLf 
  TStr = TStr + "Database=" + DbName + vbCrLf 
 Open InIpath For Output As #1 
   Print #1, TStr 
 Close 1 
End Sub