VERSION 4.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 8370 ClientLeft = 7965 ClientTop = 1650 ClientWidth = 6690 Height = 8775 Left = 7905 LinkTopic = "Form1" LockControls = -1 'True ScaleHeight = 8370 ScaleWidth = 6690 Top = 1305 Width = 6810 Begin VB.CommandButton cmdExit Caption = "E&xit" Height = 255 Left = 5160 TabIndex = 10 Top = 7920 Width = 1335 End Begin VB.TextBox Text3 Height = 285 Left = 720 TabIndex = 8 Top = 7920 Width = 4335 End Begin VB.Frame frmCheck Caption = "Probe File" Height = 3135 Left = 120 TabIndex = 5 Top = 4680 Width = 6375 Begin VB.CommandButton Command2 Caption = "Check For &BGP" Height = 255 Left = 120 TabIndex = 7 Top = 2760 Width = 6015 End Begin VB.TextBox txtBackground Height = 2415 Left = 120 MultiLine = -1 'True ScrollBars = 3 'Both TabIndex = 6 Top = 240 Width = 6015 End End Begin VB.Frame frmFillerFile Caption = "Filler File" Height = 4455 Left = 120 TabIndex = 0 Top = 120 Width = 6375 Begin VB.CommandButton cmdMakeAndDel Caption = "Make And &Delete" Height = 255 Left = 1560 TabIndex = 11 Top = 4080 Width = 1455 End Begin VB.TextBox Text1 Height = 3495 Left = 240 MultiLine = -1 'True ScrollBars = 3 'Both TabIndex = 4 Text = "MakeBigFile.frx":0000 Top = 240 Width = 5895 End Begin VB.TextBox Text2 Height = 285 Left = 4680 TabIndex = 2 Text = "1000000000" Top = 4080 Width = 1455 End Begin VB.CommandButton Command1 Caption = "&Make File" Height = 255 Left = 240 TabIndex = 1 Top = 4080 Width = 975 End Begin VB.Label Label1 Caption = "Approx. File Size:" Height = 255 Left = 3360 TabIndex = 3 Top = 4080 Width = 1335 End End Begin VB.Label lbStatus Caption = "Status:" Height = 255 Left = 120 TabIndex = 9 Top = 7920 Width = 735 End End Attribute VB_Name = "Form1" Attribute VB_Creatable = False Attribute VB_Exposed = False Option Explicit 'Free for distribution, use, and modifications in 'free and commercial sotware by preserving this note: 'Copyright (C) 2006 Konstantin Kirillov Public Sub CreateProbeFile() Dim f%, s$ Dim FName$ FName = App.Path & "\Probe_File.txt" f = FreeFile s = "Background File End" Open FName For Binary As f Put f, 1000000, s Close f text3 = "Bg. Test file is created." 'Read background file Dim TextLength&, ws$, wss$ f = FreeFile TextLength = FileLen(FName) If TextLength > 600000 Then TextLength = 29000 s = Space(TextLength) Open FName For Binary As f Get f, , s Close f 'Replace possible char(0) with \z in 'background text Dim i& wss = "" For i = 1 To TextLength ws = Mid(s, i, 1) If ws = Chr(0) Then ws = "\z" wss = wss & ws If (i Mod 1000) = 0 Then text3 = "Filtered " & CStr(i) End If Next txtBackground = wss text3 = "Bg. Test file begin. is displayed." Exit Sub End Sub Private Function MakeFillerFile$() Dim f%, s$, i&, ss$, Lng& Dim cycle&, total&, lens& Dim FName$ FName = App.Path & "\Filler_File.txt" f = FreeFile ss = text1.Text For i = 1 To 100 ss = ss & ss DoEvents text3 = "Made " & _ Len(ss) & " bytes." If Len(ss) > 1000000 Then Exit For Next On Error Resume Next Lng = CLng(text2.Text) If Err.Number > 0 Then Exit Function On Error GoTo 0 lens = Len(ss) If lens = 0 Then Exit Function cycle = 1# * Lng / lens + 1 Open FName For Binary As f 'Len = 30000 For i = 1 To cycle total = total + lens Put f, , ss text3 = "Written=" & total DoEvents Next Close f MakeFillerFile = FName End Function Private Sub cmdExit_Click() End End Sub Private Sub cmdMakeAndDel_Click() Dim FName$ frmFillerFile.Enabled = False FName = MakeFillerFile On Error Resume Next Kill FName text3 = "Probe file created and deleted." frmFillerFile.Enabled = True End Sub Private Sub Command1_Click() frmFillerFile.Enabled = False MakeFillerFile frmFillerFile.Enabled = True End Sub Private Sub Command2_Click() frmCheck.Enabled = False CreateProbeFile frmCheck.Enabled = True End Sub Private Sub Form_Load() text1.Text = text1.Text & vbCrLf & vbCrLf End Sub