Click here to Skip to main content
15,921,793 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionworking with Visual Basic and Oracle Stored Procedures Pin
Member 121101703-Nov-15 3:54
Member 121101703-Nov-15 3:54 
AnswerRe: working with Visual Basic and Oracle Stored Procedures Pin
Richard Deeming3-Nov-15 4:22
mveRichard Deeming3-Nov-15 4:22 
GeneralRe: working with Visual Basic and Oracle Stored Procedures Pin
Member 121101703-Nov-15 5:05
Member 121101703-Nov-15 5:05 
AnswerRe: working with Visual Basic and Oracle Stored Procedures Pin
GuyThiebaut4-Nov-15 2:33
professionalGuyThiebaut4-Nov-15 2:33 
GeneralRe: working with Visual Basic and Oracle Stored Procedures Pin
Member 121101704-Nov-15 20:47
Member 121101704-Nov-15 20:47 
QuestionIs this the perfect code to retrieve data from table to combobox? Pin
VSLearner201330-Oct-15 0:20
VSLearner201330-Oct-15 0:20 
AnswerRe: Is this the perfect code to retrieve data from table to combobox? Pin
Dave Kreskowiak30-Oct-15 3:17
mveDave Kreskowiak30-Oct-15 3:17 
QuestionSQL Query Builder Pin
Member 1209456128-Oct-15 4:10
Member 1209456128-Oct-15 4:10 
AnswerRe: SQL Query Builder Pin
Dave Kreskowiak28-Oct-15 4:16
mveDave Kreskowiak28-Oct-15 4:16 
GeneralRe: SQL Query Builder Pin
Tim Carmichael28-Oct-15 6:55
Tim Carmichael28-Oct-15 6:55 
AnswerRe: SQL Query Builder Pin
GuyThiebaut29-Oct-15 22:52
professionalGuyThiebaut29-Oct-15 22:52 
Questionvb.net 2010 pass two values to rowfilter in a dataset Pin
dcof27-Oct-15 17:26
dcof27-Oct-15 17:26 
AnswerRe: vb.net 2010 pass two values to rowfilter in a dataset Pin
Dave Kreskowiak28-Oct-15 4:15
mveDave Kreskowiak28-Oct-15 4:15 
GeneralRe: vb.net 2010 pass two values to rowfilter in a dataset Pin
dcof28-Oct-15 9:20
dcof28-Oct-15 9:20 
Questionvb.net auto start program as windows startup Pin
Member 1109359627-Oct-15 10:34
Member 1109359627-Oct-15 10:34 
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 

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.