Click here to Skip to main content
15,896,118 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: vb.net auto start program as windows startup Pin
Richard MacCutchan27-Oct-15 11:37
mveRichard MacCutchan27-Oct-15 11:37 
AnswerRe: vb.net auto start program as windows startup Pin
Dave Kreskowiak28-Oct-15 4:03
mveDave Kreskowiak28-Oct-15 4:03 
QuestionListbox height adjustment Pin
lazy_dude26-Oct-15 23:55
lazy_dude26-Oct-15 23:55 
AnswerRe: Listbox height adjustment Pin
Wombaticus27-Oct-15 0:50
Wombaticus27-Oct-15 0:50 
GeneralRe: Listbox height adjustment Pin
lazy_dude27-Oct-15 1:11
lazy_dude27-Oct-15 1:11 
QuestionVisual Basic Noob, in need of some direction Pin
Member 1207985922-Oct-15 10:15
Member 1207985922-Oct-15 10:15 
QuestionRe: Visual Basic Noob, in need of some direction Pin
phil.o22-Oct-15 12:02
professionalphil.o22-Oct-15 12:02 
AnswerRe: Visual Basic Noob, in need of some direction Pin
Member 1207985922-Oct-15 13:25
Member 1207985922-Oct-15 13:25 
C#
Imports System.IO
Imports System.Threading
Imports System.Windows.Forms.DialogResult


Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        If Not Directory.Exists("ADB") Then
            Directory.CreateDirectory("ADB")
        Else
            If Not File.Exists("ADB\adb.exe") Then
                File.WriteAllBytes("ADB\adb.exe", My.Resources.adb)
            End If
            If Not File.Exists("ADB\AdbWinApi.dll") Then
                File.WriteAllBytes("ADB\AdbWinApi.dll", My.Resources.AdbWinApi)
            End If
            If Not File.Exists("ADB\AdbWinUsbApi.dll") Then
                File.WriteAllBytes("ADB\AdbWinUsbApi.dll", My.Resources.AdbWinUsbApi)
            End If
            If Not File.Exists("ADB\fastboot.exe") Then
                File.WriteAllBytes("ADB\fastboot.exe", My.Resources.fastboot)
            End If
        End If

        If Not Directory.Exists("Addon") Then
            Directory.CreateDirectory("Addon")
        Else
            If Not File.Exists("Addon\Firestarter.apk") Then
                File.WriteAllBytes("Addon\Firestarter.exe", My.Resources.Firestarter)
            End If
        End If
    End Sub






    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"
            My_Process_Info.CreateNoWindow = True
            My_Process_Info.UseShellExecute = False
            My_Process_Info.RedirectStandardOutput = True  '  Redirect (1) Output
            My_Process_Info.RedirectStandardError = True  ' Redirect non (1) Output

            My_Process.EnableRaisingEvents = True
            My_Process.StartInfo = My_Process_Info
            My_Process.Start() ' Run the process NOW

            Dim Process_ErrorOutput As String = My_Process.StandardOutput.ReadToEnd() ' Stores the Error Output (If any)
            Dim Process_StandardOutput As String = My_Process.StandardOutput.ReadToEnd() ' Stores the Standard Output (If any)

            ' Return output by priority
            If Process_ErrorOutput IsNot Nothing Then Return Process_ErrorOutput ' Returns the ErrorOutput (if any)
            If Process_StandardOutput IsNot Nothing Then Return Process_StandardOutput ' Returns the StandardOutput (if any)

        Catch ex As Exception
            Return ex.Message
        End Try

        Return "OK"

    End Function


    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        MsgBox(adb("/c adb devices"))

    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

        Dim sr As New IO.FileStream("", IO.FileMode.Open)
        Dim sw As New IO.FileStream("[copyto]", IO.FileMode.Create)
        Dim len As Long = sr.Length - 1
        Dim buffer(1024) As Byte
        Dim bytesread As Integer

        While sr.Position < len
            bytesread = (sr.Read(buffer, 0, 1024))
            sw.Write(buffer, 0, bytesread)
            ProgressBar1.Value = CInt(sr.Position / len * 100)
            Application.DoEvents()
        End While

        sw.Flush()
        sw.Close()
        sr.Close()



        MsgBox(adb("/c adb install Firestarter.apk"))
    End Sub


I'm embarrassed because this is about 4 guys just who have no idea and just winging code together. Only one guy has some and i mean very little experience. Any suggestions help. Trying to figure out how to allow other computer or phone to find the program or have it installed or uploaded to their device if that makes any sense. Thank you so much

modified 23-Oct-15 8:10am.

GeneralRe: Visual Basic Noob, in need of some direction Pin
Wombaticus3-Nov-15 7:22
Wombaticus3-Nov-15 7:22 
QuestionMessage Closed Pin
15-Oct-15 10:35
Gie-wel15-Oct-15 10:35 
AnswerRe: it always say's "Not allowed to change the 'ConnectionString' property. The connection's current state is open." and " Number of query values and destination fields are not the same". please help me Pin
Chris Quinn15-Oct-15 21:13
Chris Quinn15-Oct-15 21:13 
Questionit always say's "Not allowed to change the 'ConnectionString' property. The connection's current state is open." and " Number of query values and destination fields are not the same" what should i do? i need answer as soon as possible please i'm new Pin
Gie-wel15-Oct-15 10:17
Gie-wel15-Oct-15 10:17 
AnswerRe: it always say's "Not allowed to change the 'ConnectionString' property. The connection's current state is open." and " Number of query values and destination fields are not the same" what should i do? i need answer as soon as possible please i'm Pin
Wombaticus15-Oct-15 12:37
Wombaticus15-Oct-15 12:37 
AnswerRe: it always say's "Not allowed to change the 'ConnectionString' property. The connection's current state is open." and " Number of query values and destination fields are not the same" what should i do? i need answer as soon as possible please i'm Pin
Eddy Vluggen16-Oct-15 1:37
professionalEddy Vluggen16-Oct-15 1:37 
AnswerRe: it always say's "Not allowed to change the 'ConnectionString' property. The connection's current state is open." and " Number of query values and destination fields are not the same" what should i do? i need answer as soon as possible please i'm Pin
Richard Deeming16-Oct-15 3:03
mveRichard Deeming16-Oct-15 3:03 
AnswerRe: it always say's "Not allowed to change the 'ConnectionString' property. The connection's current state is open." and " Number of query values and destination fields are not the same" what should i do? i need answer as soon as possible please i'm Pin
عبد الرؤوف شوركي25-Oct-15 11:08
عبد الرؤوف شوركي25-Oct-15 11:08 
QuestionNIC Card Configuration for Multiple Servers in a list Pin
Member 1206068515-Oct-15 4:45
Member 1206068515-Oct-15 4:45 
AnswerRe: NIC Card Configuration for Multiple Servers in a list Pin
Dave Kreskowiak15-Oct-15 5:51
mveDave Kreskowiak15-Oct-15 5:51 
Questionhow to read STL file in vb.net Pin
Abimbola Sammy O'banj15-Oct-15 3:27
Abimbola Sammy O'banj15-Oct-15 3:27 
AnswerRe: how to read STL file in vb.net Pin
Dave Kreskowiak15-Oct-15 3:54
mveDave Kreskowiak15-Oct-15 3:54 
Questionvb.net desktop app on one computer share by several users Pin
dcof13-Oct-15 4:48
dcof13-Oct-15 4:48 
AnswerRe: vb.net desktop app on one computer share by several users Pin
ZurdoDev13-Oct-15 5:38
professionalZurdoDev13-Oct-15 5:38 
GeneralRe: vb.net desktop app on one computer share by several users Pin
dcof13-Oct-15 7:09
dcof13-Oct-15 7:09 
GeneralRe: vb.net desktop app on one computer share by several users Pin
ZurdoDev13-Oct-15 7:53
professionalZurdoDev13-Oct-15 7:53 
GeneralRe: vb.net desktop app on one computer share by several users Pin
dcof13-Oct-15 9:11
dcof13-Oct-15 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.