利用RS232做通訊 可以執行自動功能 謝謝大家使用

源代码在线查看: merge.frm

软件大小: 484 K
上传用户: A15117704533
关键词: 232 RS
下载地址: 免注册下载 普通下载 VIP

相关代码

				VERSION 5.00
				Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
				Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
				Begin VB.Form Merge 
				   Caption         =   "Merge"
				   ClientHeight    =   5460
				   ClientLeft      =   2160
				   ClientTop       =   2445
				   ClientWidth     =   8280
				   LinkTopic       =   "Form1"
				   ScaleHeight     =   5460
				   ScaleWidth      =   8280
				   Begin RichTextLib.RichTextBox RichTemp 
				      Height          =   615
				      Left            =   3240
				      TabIndex        =   3
				      Top             =   5640
				      Visible         =   0   'False
				      Width           =   4455
				      _ExtentX        =   7858
				      _ExtentY        =   1085
				      _Version        =   393217
				      Enabled         =   -1  'True
				      TextRTF         =   $"Merge.frx":0000
				   End
				   Begin MSComDlg.CommonDialog SaveMerge 
				      Left            =   960
				      Top             =   6000
				      _ExtentX        =   847
				      _ExtentY        =   847
				      _Version        =   393216
				   End
				   Begin VB.CommandButton MergeSelect 
				      Caption         =   "Merge Selected Files"
				      Height          =   495
				      Left            =   6960
				      TabIndex        =   2
				      Top             =   960
				      Width           =   1215
				   End
				   Begin VB.ListBox List1 
				      Height          =   4920
				      Left            =   360
				      TabIndex        =   1
				      Top             =   360
				      Width           =   6495
				   End
				   Begin VB.CommandButton ChoScript 
				      Caption         =   "Choose Script Files"
				      Height          =   495
				      Left            =   6960
				      TabIndex        =   0
				      Top             =   360
				      Width           =   1215
				   End
				   Begin MSComDlg.CommonDialog ChooseScript 
				      Left            =   120
				      Top             =   6000
				      _ExtentX        =   847
				      _ExtentY        =   847
				      _Version        =   393216
				   End
				End
				Attribute VB_Name = "Merge"
				Attribute VB_GlobalNameSpace = False
				Attribute VB_Creatable = False
				Attribute VB_PredeclaredId = True
				Attribute VB_Exposed = False
				Private Sub ChoScript_Click()
				 
				 Dim vFiles As Variant
				 Dim MergePath(100) As String
				 
				 
				 
				 On Error GoTo ErrHandler1
				    ChDrive Mid("C:\Autotest\", 1, 1)
				    
				     
				    
				    With ChooseScript                    'Open windows dlgCommonDialog
				        .InitDir = "C:\Autotest\"
				        .DialogTitle = "Option Product Test File."
				        .Filter = "Text Files (*.DLF)|*.dlf"
				        .Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNHideReadOnly
				         .MaxFileSize = 6000
				        .CancelError = False
				        .filename = ""
				        .Action = 1
				       
				        
				        
				        
				      
				    vFiles = Split(.filename, Chr(0))
				
				    End With
				    
				    
				    ''MsgBox (vFiles)
				    
				    i = 0
				    
				    For Each e In vFiles
				        MergePath(i) = e
				        i = i + 1
				    Next
				
				    ''MsgBox (MergePath(0))
				    
				    
				    For j = 1 To i - 1
				    
				        List1.AddItem MergePath(0) & "\" & MergePath(j)
				    
				    Next j
				    
				  
				  
				  
				    
				ErrHandler1:
				
				    ''MsgBox ("Error")
				    
				
				
				End Sub
				
				
				
				Private Sub Command2_Click()
				
				
				
				
				
				End Sub
				
				Private Sub MergeSelect_Click()
				
				        
				        Dim StrTemp As String
				        Dim AllStrTemp As String
				        
				              
				        StrTemp = ""
				        AllStrTemp = ""
				        
				        Dim fs(100) As New FileSystemObject
				        Dim ts(100) As TextStream
				        
				        ''MsgBox (List1.ListCount)
				        
				        
				        
				        
				        
				        For i = 0 To List1.ListCount - 1
				        
				        
				            Set ts(i) = fs(i).OpenTextFile(List1.List(i))
				            If Not ts(i).AtEndOfStream Then
				                RichTemp.Text = ts(i).ReadAll
				        
				            End If
				        
				            ts(i).Close
				        
				        
				          
				            Clipboard.Clear
				            Clipboard.SetText RichTemp.Text
				
				            AllStrTemp = AllStrTemp & Clipboard.GetText & vbCrLf & vbCrLf
				        
				        
				        Next i
				        
				        
				        
				      
				       
				
				        
				    
				        
				    
				
				        On Error GoTo Err
				        With SaveMerge
				        CancelError = True
				      '  .Filter = "厨			

相关资源