|
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 . |
|
Register | FAQ | Donate | Forum Rules | Root any Device | ★iPhone Unlock★ | ★ Direct Codes ★ | Direct Unlock Source |
GSM Programming & Reverse Engineering Here you can post all Kind of GSM Programming and Reverse Engineering tools and Secrets. |
| LinkBack | Thread Tools | Display Modes |
05-21-2022, 16:47 | #1 (permalink) |
No Life Poster Join Date: May 2009 Location: USA/NY
Posts: 1,095
Member: 1025079 Status: Offline Thanks Meter: 311 | How add multiple ADB commands using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Diagnostics; using System.Threading.Tasks; using System.Windows.Forms; namespace Android_Tool { public partial class Form1 : Form { private Process process = new Process(); private ProcessStartInfo info = new ProcessStartInfo(); public Form1() { InitializeComponent(); info.WindowStyle = ProcessWindowStyle.Hidden; info.CreateNoWindow = true; info.UseShellExecute = false; info.RedirectStandardOutput = true; } private void button1_Click(object sender, EventArgs e) { try { // Manufactor Model Name // info.FileName = "adb "; info.Arguments = "shell getprop ro.product.vendor.manufacturer"; process.StartInfo = info; process.Start(); richTextBox1.Text = process.StandardOutput.ReadToEnd(); } catch(Exception ex) { MessageBox.Show(ex.Message); } } } } |
06-01-2022, 18:08 | #2 (permalink) |
Banned Join Date: Oct 2016 Location: South Africa
Posts: 348
Member: 2635974 Status: Offline Thanks Meter: 45 | Hello brother, create funcion/class and call it... in VB you can create function like that: Function adb(ByVal Arguments As String) As String Try Dim My_Process As New Process() Dim My_Process_Info As New ProcessStartInfo() My_Process_Info.FileName = "cmd.exe" ' Process filename My_Process_Info.Arguments = Arguments ' Process arguments My_Process_Info.WorkingDirectory = "C:\Users\<Your User Name>\AppData\Local\Android\android-sdk\platform-tools" 'this directory can be different in your case. My_Process_Info.CreateNoWindow = True My_Process_Info.UseShellExecute = False My_Process_Info.RedirectStandardOutput = True My_Process_Info.RedirectStandardError = True My_Process.EnableRaisingEvents = True My_Process.StartInfo = My_Process_Info My_Process.Start() Dim Process_ErrorOutput As String = My_Process.StandardOutput.ReadToEnd() Dim Process_StandardOutput As String = My_Process.StandardOutput.ReadToEnd() If Process_ErrorOutput IsNot Nothing Then Return Process_ErrorOutput If Process_StandardOutput IsNot Nothing Then Return Process_StandardOutput Catch ex As Exception Return ex.Message End Try Return "OK" End Function And you call it adb("/c adb cmd0") adb("/c adb cmd1") |
Bookmarks |
| |
|