GSM Shop GSM Shop
GSM-Forum  

Welcome to the GSM-Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features.
Only registered members may post questions, contact other members or search our database of over 8 million posts.

Registration is fast, simple and absolutely free so please - Click to REGISTER!

If you have any problems with the registration process or your account login, please contact contact us .

Go Back   GSM-Forum > Other Gsm/Mobile Related Forums > GSM Programming & Reverse Engineering


GSM Programming & Reverse Engineering Here you can post all Kind of GSM Programming and Reverse Engineering tools and Secrets.

Reply
 
LinkBack Thread Tools Display Modes
Old 04-19-2015, 03:48   #1 (permalink)
Freak Poster
 
josedavido's Avatar
 
Join Date: Apr 2005
Location: Inside Vb.Net
Age: 41
Posts: 374
Member: 140822
Status: Offline
Sonork: 100.1594493
Thanks Meter: 1,010
Help with command line Background Process on Vb.Net


Hello friends.

I've just started a very simple project on Vb.Net
It is a software for send commands to Android devices trhough Android Data Bridge (ADB).

The problem is that every time I send a command my software stucksn then I have to run the Task Manager and finish the process manually. After that, my software shows the information gotten from ADB.

This is very annoying.

So, I thing that it could be solved if I sedn and recive information from ADB trough background process.

Aoreciate any help or guide.

This is the code for send and recive:

Quote:
Public Sub Execute_command(ByVal Argumentos As String)
Try
RichTextBox3.Clear()
Dim p As New Process()
With p.StartInfo
.UseShellExecute = False
.WindowStyle = ProcessWindowStyle.Hidden
.RedirectStandardOutput = True
.RedirectStandardError = True
.CreateNoWindow = True
.FileName = AppDomain.CurrentDomain.BaseDirectory & "ADB/adb.exe"
.Arguments = Argumentos
End With

p.Start()
Do While Not p.StandardOutput.EndOfStream
RichTextBox3.Text = RichTextBox3.Text &(p.StandardOutput.ReadLine) & vbNewLine
RichTextBox3.ScrollToCaret()
Loop

Application.DoEvents()

RichTextBox3.Text = RichTextBox3.Text & p.StandardError.ReadToEnd
RichTextBox3.Text = RichTextBox3.Text & vbNewLine
RichTextBox3.ScrollToCaret()

p.Dispose()


Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub


Br,
Josedavido
  Reply With Quote
Old 04-19-2015, 05:25   #2 (permalink)
Freak Poster
 
josedavido's Avatar
 
Join Date: Apr 2005
Location: Inside Vb.Net
Age: 41
Posts: 374
Member: 140822
Status: Offline
Sonork: 100.1594493
Thanks Meter: 1,010
  Reply With Quote
Old 04-22-2015, 01:23   #3 (permalink)
Freak Poster
 
josedavido's Avatar
 
Join Date: Apr 2005
Location: Inside Vb.Net
Age: 41
Posts: 374
Member: 140822
Status: Offline
Sonork: 100.1594493
Thanks Meter: 1,010


The software is already running.
But still have problems with long process, the software still stucks.


Br,
Josedavido
  Reply With Quote
Old 04-23-2015, 08:52   #4 (permalink)
No Life Poster
 
hitesh2000's Avatar
 
Join Date: Oct 2006
Posts: 581
Member: 365730
Status: Offline
Thanks Meter: 84
in vb.net you can use background worker.
  Reply With Quote
Old 04-23-2015, 22:09   #5 (permalink)
Freak Poster
 
josedavido's Avatar
 
Join Date: Apr 2005
Location: Inside Vb.Net
Age: 41
Posts: 374
Member: 140822
Status: Offline
Sonork: 100.1594493
Thanks Meter: 1,010
Quote:
Originally Posted by hitesh2000 View Post
in vb.net you can use background worker.
Yes man, I know this object, but I've never used before for send commands and show answers on RichTextBox.

If you can make an example or give me more guide about it, I'll apreciate that.


Br,
Josedavido
  Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 



All times are GMT +1. The time now is 05:06.



Powered by Searchlight © 2024 Axivo Inc.
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
- GSM Hosting Ltd. - 1999-2023 -
Page generated in 0.14186 seconds with 8 queries

SEO by vBSEO