我已经将(文本:- ctrl-c ctrl-v)从我以前的一个运行没有故障的程序中复制到项目中。非常简单地从文本文件中提取数据。
在我的机器上,安装了 Visual Studio 2010,它就像一个魅力。在别人的机器上,它在启动时因方向错误而崩溃。
EventType : clr20r3 P1 : total_extractor.exe P2 : 1.0.0.1
P3 : 51f64e90 P4 : total_extractor P5 : 1.0.0.1 P6 : 51f64e90
P7 : 4a P8 : 22 P9 : **system.invalidoperationexception**
我在加载模块中的唯一信息如下:
Option Explicit On
Public Class frm_Main
Private Sub btn_Extract_Click(sender As System.Object, e As System.EventArgs) Handles btn_Extract.Click
RunTE()
End Sub
Private Sub frm_Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.cbx_Defaults.Items.Add("String Loads | *.det")
Me.cbx_Defaults.Items.Add("RF | *.det")
Me.cbx_Defaults.Items.Add("OLOADS | *.f06")
Me.cbx_Defaults.Items.Add("Properties | *.f06")
End Sub
Private Sub cbx_Defaults_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cbx_Defaults.SelectedIndexChanged
Dim combostr As String
combostr = cbx_Defaults.Text
If combostr = "RF | *.det" Then
txt_Begin.Text = "TABLE 6.2: ACD table"
txt_End.Text = "TABLE 6.3:"
txt_Skip.Text = "2"
txt_Filter.Text = "*.det"
ElseIf combostr = "String Loads | *.det" Then
txt_Begin.Text = "TABLE 2.1.1:"
txt_End.Text = "TABLE 2.2.1"
txt_Skip.Text = "2"
txt_Filter.Text = "*.det"
ElseIf combostr = "OLOADS | *.f06" Then
txt_Begin.Text = "OLOAD RESULTANT"
txt_End.Text = "TOTALS"
txt_Skip.Text = "2"
txt_Filter.Text = "*.f06"
ElseIf combostr = "Properties | *.f06" Then
txt_Begin.Text = "LOAD FACTOR 1.0"
txt_End.Text = "*** USER"
txt_Skip.Text = "5"
txt_Filter.Text = "*.f06"
End If
End Sub
End Class
代码使用,My.Computer.FileSystem.OpenTextFileReader
仅此而已。我从谷歌得到的信息,通常是关于一些基于数据的选项。这只是操纵文本文档?
任何想法,关于如何捕捉事件?还是我设置的设置?