'If user pressed cancel, the filename will be empty. This will cause errors, so:
If dlgOpen.FileName <> "" Then
'Open the file
FileOpen(1, dlgOpen.FileName, OpenMode.Input)
'Loop through these instructions until we reach the End Of File
Do Until EOF(1)
'Get the next line from the file
LineOfText = LineInput(1)
'Add this line on to the end of the Alltext variable (with a new line- vbCrLf)
AllText = AllText & LineOfText & vbCrLf
Loop
'Display the file in the textbox
txtFile.Text = AllText
'Extra bonus bit. select the file
txtFile.Select(1, 0)
'Close the file. One of the most important steps, otherwise errors will happen
FileClose(1)
End If
barmyarmy said:Links
VB.NET Express Edition - http://msdn.microsoft.com/vstudio/express/vb/
SharpDevelop - http://www.sharpdevelop.com/OpenSource/SD/Download/
.NET Framework V2 - http://www.microsoft.com/downloads/...cb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en
Windows.Forms.Cursor.Current = Cursors.WaitCursor
Dim strFileName As String
With OpenFileDialog1
.Filter = "Cricket 2005 roster file|*.ros"
.ShowDialog()
strFileName = .FileName
End With
If strFileName = vbNullString Then Exit Sub
FS = New FileStream(strFileName, FileMode.Open, FileAccess.ReadWrite)
BR = New BinaryReader(FS)
BW = New BinaryWriter(FS)
'make sure the combobox is set to index 0 (none)
cboattribute.SelectedIndex = 0
Public Function scaledown(ByVal currentnumber As Integer) As Integer
Dim b As Integer
Select Case currentnumber
Case 0
b = 0
Case 1
b = 0
Case 2
b = 1
Case 3
b = 1
Case 4
b = 2
Case 5
b = 2
Case 6
b = 3
Case 7
b = 4
Case 8
b = 5
Case 9
b = 5
Case 10
b = 6
Case 11
b = 7
Case 12
b = 8
Case 13
b = 8
Case 14
b = 9
Case 15
b = 9
Case 16
b = 10
Case 17
b = 11
Case 18
b = 11
Case 19
b = 12
Case 20
b = 12
Case 21
b = 13
Case 22
b = 13
Case 23
b = 14
Case 24
b = 15
Case 25
b = 16
Case 26
b = 17
Case 27
b = 17
Case 28
b = 18
Case 29
b = 19
Case 30
b = 19
Case 31
b = 20
Case 32
b = 21
Case 33
b = 21
Case 34
b = 22
Case 35
b = 23
Case 36
b = 23
Case 37
b = 24
Case 38
b = 25
Case 39
b = 25
Case 40
b = 26
Case 41
b = 27
Case 42
b = 27
Case 43
b = 28
Case 44
b = 29
Case 45
b = 29
Case 46
b = 30
Case 47
b = 31
Case 48
b = 31
Case 49
b = 32
Case 50
b = 33
Case 51
b = 33
Case 52
b = 34
Case 53
b = 34
Case 54
b = 35
Case 55
b = 36
Case 56
b = 36
Case 57
b = 37
Case 58
b = 37
Case 59
b = 38
Case 60
b = 39
Case 61
b = 39
Case 62
b = 40
Case 63
b = 40
Case 64
b = 41
Case 65
b = 42
Case 66
b = 42
Case 67
b = 43
Case 68
b = 43
Case 69
b = 44
Case 70
b = 45
Case 71
b = 45
Case 72
b = 46
Case 73
b = 46
Case 74
b = 47
Case 75
b = 48
Case 76
b = 48
Case 77
b = 49
Case 78
b = 49
Case 79
b = 50
Case 80
b = 51
Case 81
b = 51
Case 82
b = 52
Case 83
b = 52
Case 84
b = 53
Case 85
b = 53
Case 86
b = 54
Case 87
b = 54
Case 88
b = 55
Case 89
b = 55
Case 90
b = 56
Case 91
b = 56
Case 92
b = 57
Case 93
b = 57
Case 94
b = 58
Case 95
b = 58
Case 96
b = 59
Case 97
b = 59
Case 98
b = 60
Case 99
b = 61
Case 100
b = 62
End Select
Return b
End Function
For x = 0 To 1000
'Catching is calculated by taking the decimal value of the byte
'and scaling it up and is dead easy to code
catching = scaledown(updvalue.Value)
FS.Seek((176932 + x * 368 + 136), SeekOrigin.Begin)
BW.Write(catching)
Next
MsgBox("This is a beta. Use at your own risk and backup first", MsgBoxStyle.Critical)
cmdopen.PerformClick()