MarcusBell
Member
- Joined
- Feb 1, 2005
- Messages
- 12
- Programming Experience
- Beginner
Hello
Ok I have created a class I think it is right, I am writing the code to calling up from the class to populate design form fields. Below is the code for a "Analyze File" button ( using Openfiledialog) and "Analyze Text" button. on the File button I get this the below message... not sure what it is asking for? Below is thte code for the "Analyze Text" button, I do not think it is right either????
Can someone please help me this is an assignment due for schools tonight and I am panicking...
Messge :
_____________________________________________________
This is the iError Message I get For "Analyze Text button:
Ok I have created a class I think it is right, I am writing the code to calling up from the class to populate design form fields. Below is the code for a "Analyze File" button ( using Openfiledialog) and "Analyze Text" button. on the File button I get this the below message... not sure what it is asking for? Below is thte code for the "Analyze Text" button, I do not think it is right either????
Can someone please help me this is an assignment due for schools tonight and I am panicking...
Messge :
Code For "Analyze File" button:"An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.
VB.NET:
Private Sub btnAnalF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAnalF.Click
Dim ct As New Count.Counting.AnalyzeFile
Dim ofd As New OpenFileDialog
Dim Std As StreamReader
Dim fileToSplit, conCat, fileAndPath As String
Dim sR As System.IO.StreamReader
ofd.Filter = "Text Files (*.txt)|*.txt|" & _
"All Files (*.*)|*.*"
ofd.FilterIndex = 1
ofd.ShowDialog()
Try
fileAndPath = ofd.FileName
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Try
sR = File.OpenText(fileAndPath)
fileToSplit = sR.ReadToEnd()
sR.Close()
ct.SplitCharArray(3) = Convert.ToInt32(txtChar.Text)
Catch
ct.SplitCharArray(3) = 0
txtChar.Text = "0"
End Try
ct.SplitWordArray(3) = Convert.ToInt32(txtWords.Text)
ct.SplitSentArray(3) = Convert.ToInt32(txtSent.Text)
ct.SplitParArray(3) = Convert.ToInt32(txtPara.Text)
This is the iError Message I get For "Analyze Text button:
Code For "Analyze Text button:An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.
VB.NET:
Private Sub btnAnalT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAnalT.Click
Dim tp As New Count.Counting.AnalyzeText
Dim trToManipulate, conCat As String
Try
tp.SplitCharArray(3) = Convert.ToInt32(txtChar.Text)
Catch
tp.SplitCharArray(3) = 0
txtChar.Text = "0"
End Try
tp.SplitWordArray(3) = Convert.ToInt32(txtWords.Text)
tp.SplitSentArray(3) = Convert.ToInt32(txtSent.Text)
tp.SplitParArray(3) = Convert.ToInt32(txtPara.Text)