⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 很好的教程原代码!
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "创建临时文件"
      Height          =   495
      Left            =   1800
      TabIndex        =   1
      Top             =   2160
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   1800
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   1320
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "路径及文件名"
      Height          =   495
      Left            =   480
      TabIndex        =   2
      Top             =   1440
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetTempFileName Lib "kernel32" Alias "GetTempFileNameA" _
(ByVal lpszPath As String, _
ByVal lpPrefixString As String, _
ByVal wUnique As Long, _
ByVal lpTempFileName As String _
) As Long


Private Sub Form_Load()
    Text1.Text = ""
End Sub
Private Sub Command1_Click()
    Dim FilePrefix As String
    Dim NewFile As String * 256
    FilePrefix = "TEST"
    NewFile = GetTempName(FilePrefix)
    Text1.Text = NewFile
End Sub
Private Function GetTempName(TmpFilePrefix As String) As String
    Dim TempFileName As String * 256
    Dim X As Long
    Dim DriveName As String
    DriveName = "c:\"
    X = GetTempFileName(DriveName, TmpFilePrefix, 0, TempFileName)
    GetTempName = Left$(TempFileName, InStr(TempFileName, Chr(0)) - 1)
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -