Basic helpful snippits

Posts 1–4 of 4 · Page 1 of 1
Basic helpful snippits
Most of these Snippits I have made, some of them I use alot, and others are really helpful. I would be updating this ever so often.

Split Text
Code:
 Dim fullText As String
        Dim parts() As String

        fullText = TextBox1.Text

        parts = Split(fullText, Environment.NewLine)
With this code you have a textbox, that has more then 1 line, lets say
"Hello
There
Bob"
Then what this code will do is it will split each line from the enter, so that
parts(0) = Hello
parts(1) = There
parts(2) = Bob
So that if you want, you can now use something like
Textbox2.text = parts(1), so now Textbox2's text will be Textbox1's line 2.

Text Replacer
Code:
   Dim output As String = TextBox1.Text.Replace(TextBox2.Text, "")
        TextBox1.Text = output
With this code put this in a button, and put 2 textboxes out. Whatever is in Textbox2 will be deleted from Textbox1. This is meant for replacement, but we are simply replacing with "", meaning nothing.

Open Programs
Code:
Shell("notepad.exe")
This code will Open Notepad, anything like this the start position is System32.
A more basic would look like
Code:
Shell("C:\Program Files\Internet Explorer\iexplore.exe")
Open Website URL
Code:
System.Diagnostics.Process.Start("http://website.com")
Email Link
Code:
System.Diagnostics.Process.Start("mailto:" & "Im@Ugleh.com")
More to come, Im just tired atm :P.
Quote Originally Posted by Ugleh View Post
Open Website URL
Code:
System.Diagnostics.Process.Start("http://website.com")
You can do easier [php]process.start("http://website.com")[/php] or Ugleh´s webiste start!
Open Programs
Code:
Shell("notepad.exe")
It didn't work for combatarms.exe
Quote Originally Posted by geebes888 View Post
It didn't work for combatarms.exe
Worked for me

Code:
Shell("C:\Nexon\Combat Arms\Combatarms.exe")
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us