
18-08-2008, 17:44
|
 |
\dev\null
|
|
חבר מתאריך: 08.11.02
הודעות: 11,379
|
|
תודה רבה על העזרה, מצאתי בסופו של דבר קוד שהצליח לעבוד לי יפה
אז אני מרוצה כרגע 
תודה רבה על העזרה
קוד PHP:
Private Sub btn_exe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_exe.Click
If (My.Computer.FileSystem.FileExists(txt_avrdude_pat h.Text)) Then
Dim p As New Process
p.StartInfo.FileName = txt_avrdude_path.Text
p.StartInfo.Arguments = Mid(txt_exe.Text, txt_avrdude_path.TextLength + 1, txt_exe.TextLength)
'MsgBox(Mid(txt_exe.Text, txt_avrdude_path.TextLength + 1, txt_exe.TextLength))
p.StartInfo.UseShellExecute = False
p.StartInfo.CreateNoWindow = True
p.StartInfo.RedirectStandardOutput = True
AddHandler p.OutputDataReceived, AddressOf HelloMum
txt_log.Text = "--------------- Starting execution ---------------" & Environment.NewLine
p.Start()
p.BeginOutputReadLine()
Else
MsgBox("File """ & txt_avrdude_path.Text & """ does not exist !", MsgBoxStyle.Exclamation, "File not found")
End If
End Sub
Sub HelloMum(ByVal sender As Object, ByVal e As DataReceivedEventArgs)
UpdateTextBox(e.Data)
End Sub
Private Delegate Sub UpdateTextBoxDelegate(ByVal Text As String)
Private Sub UpdateTextBox(ByVal Tex As String)
If Me.InvokeRequired Then
Dim del As New UpdateTextBoxDelegate(AddressOf UpdateTextBox)
Dim args As Object() = {Tex}
Me.Invoke(del, args)
Else
txt_log.AppendText(Tex & Environment.NewLine)
End If
End Sub
|