vbcrlf,vbnewline,vbcr לא עובדים....
יש לי vb6 על XP ואני מנסה ליישם את הקוד הבא: הרעיון הוא שאני רוצה לשלוף מקובץ הטקסט את השורות הרלוונטיות לי למשל יש לי בקובץ את השורות הבאות: """"""""""""""""""""""""""""""""""""""""""תחילת טקסט"""""""""""""""""" Trying to read the drive IDs using physical access with admin rights Primary Controller - Master drive Drive Model Number________________: WDC WD800BB-75JHC0 Drive Serial Number_______________: WD-WMAM9T735526 Drive Controller Revision Number__: 06.01C06 Controller Buffer Size on Drive___: 2097152 bytes Drive Type________________________: Fixed Drive Size________________________: 80000000000 bytes Primary Controller - Slave drive Drive Model Number________________: M-Systems IDE 4000 V1.13 Drive Serial Number_______________: 999999999 Drive Controller Revision Number__: 060726 Controller Buffer Size on Drive___: 512 bytes Drive Type________________________: Fixed Drive Size________________________: 523837440 bytes """""""""""""""""""""""""""""""""""""""""סוףהטקסט"""""""""""""""""""""""""""""""""""""" ואני רוצה לשלוף רק את השורות הבאות: Drive Model Number________________: M-Systems IDE 4000 V1.13 Drive Serial Number_______________: 999999999 Drive Controller Revision Number__: 060726 Controller Buffer Size on Drive___: 512 bytes Drive Type________________________: Fixed Drive Size________________________: 523837440 bytes """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" זאת התוכנית הלא גמורה שלי: Private Sub Form_Load() 'Shell ("cmd /k c:\diskid32.exe >> c:\diskid32.txt") Call SplitDataSourceToFile End Sub Public Function SplitDataSourceToFile() Dim FullPathToTxtFile As String Dim startRow As Integer Dim RowNumber As Integer Dim LnTmp1 As String Dim WriteLineNumber As Integer Dim WriteLineNumberFlag As Boolean 'Dim strSplitBatchFile() As String Dim strSupplierBatchFile() As String Dim srtBatchfile As String Dim strTmp As String Dim lineCounter As Integer Dim EOL As String EOL = Chr(13) + Chr(10) Dim strfilename strfilename = "c:\diskid32_4000.txt" 'Reading All File to string FullPathToTxtFile = strfilename Open strfilename For Input As #2 srtBatchfile = Input(LOF(2), #2) Close #2 strSplitBatchFile = Split(srtBatchfile, "Secondary Controller - Master drive") For lineCounter = LBound(strSplitBatchFile) + 1 To UBound(strSplitBatchFile) Text1.Text = Text1.Text & strSplitBatchFile(i) & vbCrLf Next lineCounter End Function
יש לי vb6 על XP ואני מנסה ליישם את הקוד הבא: הרעיון הוא שאני רוצה לשלוף מקובץ הטקסט את השורות הרלוונטיות לי למשל יש לי בקובץ את השורות הבאות: """"""""""""""""""""""""""""""""""""""""""תחילת טקסט"""""""""""""""""" Trying to read the drive IDs using physical access with admin rights Primary Controller - Master drive Drive Model Number________________: WDC WD800BB-75JHC0 Drive Serial Number_______________: WD-WMAM9T735526 Drive Controller Revision Number__: 06.01C06 Controller Buffer Size on Drive___: 2097152 bytes Drive Type________________________: Fixed Drive Size________________________: 80000000000 bytes Primary Controller - Slave drive Drive Model Number________________: M-Systems IDE 4000 V1.13 Drive Serial Number_______________: 999999999 Drive Controller Revision Number__: 060726 Controller Buffer Size on Drive___: 512 bytes Drive Type________________________: Fixed Drive Size________________________: 523837440 bytes """""""""""""""""""""""""""""""""""""""""סוףהטקסט"""""""""""""""""""""""""""""""""""""" ואני רוצה לשלוף רק את השורות הבאות: Drive Model Number________________: M-Systems IDE 4000 V1.13 Drive Serial Number_______________: 999999999 Drive Controller Revision Number__: 060726 Controller Buffer Size on Drive___: 512 bytes Drive Type________________________: Fixed Drive Size________________________: 523837440 bytes """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" זאת התוכנית הלא גמורה שלי: Private Sub Form_Load() 'Shell ("cmd /k c:\diskid32.exe >> c:\diskid32.txt") Call SplitDataSourceToFile End Sub Public Function SplitDataSourceToFile() Dim FullPathToTxtFile As String Dim startRow As Integer Dim RowNumber As Integer Dim LnTmp1 As String Dim WriteLineNumber As Integer Dim WriteLineNumberFlag As Boolean 'Dim strSplitBatchFile() As String Dim strSupplierBatchFile() As String Dim srtBatchfile As String Dim strTmp As String Dim lineCounter As Integer Dim EOL As String EOL = Chr(13) + Chr(10) Dim strfilename strfilename = "c:\diskid32_4000.txt" 'Reading All File to string FullPathToTxtFile = strfilename Open strfilename For Input As #2 srtBatchfile = Input(LOF(2), #2) Close #2 strSplitBatchFile = Split(srtBatchfile, "Secondary Controller - Master drive") For lineCounter = LBound(strSplitBatchFile) + 1 To UBound(strSplitBatchFile) Text1.Text = Text1.Text & strSplitBatchFile(i) & vbCrLf Next lineCounter End Function