hellsing112's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
16 (0.02 per day)
Joined:
08-May 12
Profile Views:
621
Last Active:
User is offline Dec 21 2012 03:23 AM
Currently:
Offline

Previous Fields

Country:
NL
OS Preference:
Windows
Favorite Browser:
Internet Explorer
Favorite Processor:
AMD
Favorite Gaming Platform:
PC
Your Car:
Subaru
Dream Kudos:
0
Icon   hellsing112 has not set their status

Posts I've Made

  1. In Topic: Problem CMD

    Posted 14 May 2012

    View Posthellsing112, on 13 May 2012 - 11:36 PM, said:

    Hello people,

    I have a question, also i first want to thank pradeep for linking me to his blog for some information.

    Well I wanted to make an server starter so that my windows form will start up and behaves like a command prompt (CMD), well that works! Thanks to Pradeep, but if i want to start an batch file it wont start, or if it does, i can't add the code?

    Someone any idea?

    Greatfull tnxs if you reply!

    Greetzz
    Hellsing112


    Whoeps missed typed :P but this is what i ment: "or if it does, I can't add the code?"

    Greetzz
    Hellsing112
  2. In Topic: Listbox Replacing Item

    Posted 11 May 2012

    View Postm_wylie85, on 11 May 2012 - 05:37 AM, said:

    That is because your delete the slected index then making a new index you need to replace the slected index

    somthing like this (Not tested)

    ListBox1.SelectedItem = textbox_Edit.text 
    


    Do not remove the selected index but update/edit the slected index

    Sorry the above is wrong the below works

      Dim int As Integer = ListBox1.SelectedIndex
    
            ListBox1.Items.RemoveAt(int)
    
            ListBox1.Items.Insert(int, TextBox1.Text)
    


    Thanks M_wylie85

     
     Dim int As Integer = ListBox1.SelectedIndex
            ListBox1.Items.RemoveAt(int)
            ListBox1.Items.Insert(int, TextBox1.Text)
    
    

    Workes fine
  3. In Topic: CMD Status Displayed in Textbox

    Posted 10 May 2012

    View Postpradeep1210, on 10 May 2012 - 01:14 AM, said:

    View Posthellsing112, on 09 May 2012 - 11:40 PM, said:

    View Postpradeep1210, on 09 May 2012 - 12:50 PM, said:



    hello Pradeep & Dimitry,

    Accually what Pradeep linked me to worked :^: !
    So if you wanna know the code just use this:


    Actually that's my blog and I'm the author of that article. :)

    Glad that it helped, and you could resolve the problem that you faced with it yourself!

    If you face any further problems, or you don't understand any part of it, feel free to comment there or post it here in this thread.

    Regards,
    Pradeep


    Pradeep Nice article!
    but like i said before i'm still a beginner in Visual basic, but i'm getting to understand little by little.

    Also if i face a problem im trying to solve it by my self but it doesn't work always and then some other people come in with sollutions (like i posted the question on the forum here ;)for every question i have a reason ;) )

    If i need any thing to know i'll post it ;)

    Greetzzz
    Hellsing112
  4. In Topic: CMD Status Displayed in Textbox

    Posted 10 May 2012

    View PostDimitriV, on 10 May 2012 - 12:09 AM, said:

    Dunno about the error so the best thing I can suggest is to 'catch' the error:
    'if thingy.InvokeRequired Then
    Try
     Dim myDelegate As New AppendOutputTextDelegate(AddressOf AppendOutputText)
            Me.Invoke(myDelegate, text)
    Catch ex As Exception
    End Try
    
    

    I understand this isn't the best solution because we are only catching the error not preventing it.


    Yep it solved the error :D :^: Thanks DimitriV
  5. In Topic: CMD Status Displayed in Textbox

    Posted 10 May 2012

    View Posthellsing112, on 09 May 2012 - 11:40 PM, said:

    View Postpradeep1210, on 09 May 2012 - 12:50 PM, said:



    hello Pradeep & Dimitry,

    Accually what Pradeep linked me to worked :^: !
    So if you wanna know the code just use this:

    What you need:

    Textbox1
    Name = OutputTextBox
    Multiline = True
    ReadOnly = True
    Scrollbars = Both

    Textbox2
    Name = InputTextBox
    TabIndex = 0

    Button1
    Name = ExecuteButton
    Text = Execute

        Private WithEvents MyProcess As Process
        Private Delegate Sub AppendOutputTextDelegate(ByVal text As String)
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Me.AcceptButton = Executebutton
            MyProcess = New Process
            With MyProcess.StartInfo
                .FileName = "CMD.EXE"
                .UseShellExecute = False
                .CreateNoWindow = True
                .RedirectStandardInput = True
                .RedirectStandardOutput = True
                .RedirectStandardError = True
            End With
            MyProcess.Start()
            MyProcess.BeginErrorReadLine()
            MyProcess.BeginOutputReadLine()
            AppendOutputText("Process Started at: " & MyProcess.StartTime.ToString)
        End Sub
        Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
            MyProcess.StandardInput.WriteLine("EXIT") 'send an EXIT command to the Command Prompt
            MyProcess.StandardInput.Flush()
            MyProcess.Close()
        End Sub
        Private Sub MyProcess_ErrorDataReceived(ByVal sender As Object, ByVal e As System.Diagnostics.DataReceivedEventArgs) Handles MyProcess.ErrorDataReceived
            AppendOutputText(vbCrLf & "Error: " & e.Data)
        End Sub
        Private Sub MyProcess_OutputDataReceived(ByVal sender As Object, ByVal e As System.Diagnostics.DataReceivedEventArgs) Handles MyProcess.OutputDataReceived
            AppendOutputText(vbCrLf & e.Data)
        End Sub
        Private Sub ExecuteButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Executebutton.Click
            MyProcess.StandardInput.WriteLine(InputTextbox.Text)
            MyProcess.StandardInput.Flush()
            InputTextbox.Text = ""
        End Sub
        Private Sub AppendOutputText(ByVal text As String)
            If OutputTextbox.InvokeRequired Then
                Dim myDelegate As New AppendOutputTextDelegate(AddressOf AppendOutputText)
                Me.Invoke(myDelegate, text)
            Else
                OutputTextbox.AppendText(text)
            End If
        End Sub
    
    


    Thank you Very much for helping me out but still there is an error:
    Posted Image

    Any sollution would be nice!
    Also i need to mention that i get the Error if i close the form.

    Greetzz
    Hellsing112



    Never mind Fixed it :D, my form that i made was not form1 so that was the issue :P

    Greetzz
    Hellsing112

My Information

Member Title:
New D.I.C Head
Age:
22 years old
Birthday:
March 1, 1992
Gender:
Programming Languages:
Visual Basic
Html

Contact Information

E-mail:
Click here to e-mail me

Friends

Comments

hellsing112 has no profile comments yet. Why not say hello?