techPowerUp! Forums

Go Back   techPowerUp! Forums > Software > Programming & Webmastering

Reply
 
Thread Tools
Old Jan 21, 2010, 06:20 PM   #1
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

DOS Commands In Visual Basic

How would I go about executing DOS commands in Visual Basic? My plan is to have an input field in VB, and then when the user pushes a button it will input this input into the DOS command and execute it.
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 21, 2010, 06:59 PM   #2
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Ok, update:

I have found that

Code:
  Dim sCommand As String
        sCommand = "DOSCOMMAND HERE"
        Shell("cmd.exe /c" & sCommand)
will execute a dos command, but lets say I want to echo from a text box inside VB? How would I go about that?

Code:
  Dim sCommand As String
        sCommand = "echo SOMETHINGFROMVB"
        Shell("cmd.exe /c" & sCommand)
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 21, 2010, 09:07 PM   #3
Kreij
Hardcore Monkey Moderator
 
Kreij's Avatar
 
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,108 (5.28/day)
Thanks: 591
Thanked 5,488 Times in 2,932 Posts

System Specs

I think that sCommand could be a filename with all the commands you want to execute in it.
Our do you want to be able to talk to the cmd process from individual lines of VB code?
__________________

Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other.


Get more tech news on a wide variety of topics at NextPowerUp
Kreij is offline  
Reply With Quote
Old Jan 21, 2010, 09:10 PM   #4
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

I figured it out just now. Was very simple. Stuff box is a textbox btw.

Code:
Dim stuff As String

        stuff = stuffbox.Text

        Dim sCommand As String
        sCommand = "echo" & " " & stuff
        Shell("cmd.exe /c" & sCommand)
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
The Following User Says Thank You to PVTCaboose1337 For This Useful Post:
Old Jan 21, 2010, 11:57 PM   #5
Kreij
Hardcore Monkey Moderator
 
Kreij's Avatar
 
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,108 (5.28/day)
Thanks: 591
Thanked 5,488 Times in 2,932 Posts

System Specs

Thanks for letting us know how you got it working !
I use this section as a programming reference quite often.
__________________

Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other.


Get more tech news on a wide variety of topics at NextPowerUp
Kreij is offline  
Reply With Quote
Old Jan 22, 2010, 12:07 AM   #6
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,564 (6.29/day)
Thanks: 1,751
Thanked 2,594 Times in 1,959 Posts

System Specs

You should get in the habit of using System.Diagnostics.Process.Start() rather than Shell. Using that method, you can redirect StandardOutput, and StandardError. In your app, create a while loop to write the contents of each of those streams to a window in the application:

Code:
While p.StandardOutput.Peek() <> -1
  txt.Text +=p.StandardOutput.ReadLine()
End While
Repeat for StandardError.
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote
Old Jan 22, 2010, 12:45 AM   #7
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Ok guys, here is where the work went to. A fun program to screw around with on the school network. Nobody knew what I meant when I said "use the command prompt to send messages," so I made my own program so people can talk over the network. Will improve later, want to add some more options, but for a quick time, this is good enough!

I took advantage of this original batch file written in about 30 seconds:

Code:
@echo off
color 1f
:begin
cls
set /p n=User: 
set /p m=Message: 
msg %n% %m%
pause
Goto begin
It only worked with Windows 7 / Vista, so in the VB code I added a condition to change between different versions of Windows. Anyway...

Enjoy!

Edit: For all those against opening strange .exe files they find on tech forums, this is for you:



http://www.virustotal.com/analisis/1...6e1-1264127325
Attached Files
File Type: exe Easy Msg.exe (49.5 KB, 159 views)
__________________
CPU-Z validation sig pics temporarily blocked

Last edited by PVTCaboose1337; Jan 22, 2010 at 01:30 AM.
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 22, 2010, 12:48 AM   #8
A Cheese Danish
1000 Posts
 
A Cheese Danish's Avatar
 
Join Date: Nov 2006
Location: At your local vending machine
Posts: 1,914 (0.81/day)
Thanks: 121
Thanked 419 Times in 368 Posts
Send a message via AIM to A Cheese Danish

System Specs

That's a fun little program you got there.
This reminds me, I need to keep teaching myself how to code more in depth with VB.
__________________
My FS/FT Thread
HEATWARE Xfire Steam ID
Certs: MCTS, MCITP, HP APS
Server: AMD Opteron 170 @2.95GHz | 4GB DDR 3-3-2-7 | 1x Samsung SPT 500GB, 2x WD Black 2TB, 2x 1.5TB Western Digital MyBook
A Cheese Danish is offline  
Reply With Quote
The Following User Says Thank You to A Cheese Danish For This Useful Post:
Old Jan 22, 2010, 12:51 AM   #9
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

It has been about 4 year since I touched VB! I forgot how much fun it was to write little programs like that!

ALSO: For those who care, the full code:

Code:
Public Class Form1

    Private Sub send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles send.Click
        'Define and store user and message into strings
        Dim user As String
        Dim msg As String

        user = userbox.Text
        msg = msgbox.Text

        'Send all suicide mode!
        If checkall.Checked Then
            user = "*"
            userbox.ReadOnly = True

        End If

        'Main Code

        If radionew.Checked Then

            'Windows Vista / 7 Code
            'Calls the user and msg strings and inputs them into the DOS code to execute

            Dim sCommand As String
            sCommand = "msg" & " " & user & " " & msg
            Shell("cmd.exe /c" & sCommand)


        ElseIf radioold.Checked Then

            'Windows 2000 / XP Code
            'Calls the user and msg strings and inputs them into the DOS code to execute

            Dim sCommand As String
            sCommand = "net send" & " " & user & " " & msg
            Shell("cmd.exe /c" & sCommand)

        End If

    End Sub

    Private Sub clear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clear.Click
        'Clears the message box
        msgbox.Text = ""
    End Sub

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

    End Sub
End Class
Simple no?

If anyone is using Windows XP or 2000, please test the code for me! I have only 7 and Vista! Just make sure to check the correct box!

Download is here: http://forums.techpowerup.com/attach...9&d=1264124659
__________________
CPU-Z validation sig pics temporarily blocked

Last edited by PVTCaboose1337; Jan 22, 2010 at 01:37 AM.
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 22, 2010, 02:04 AM   #10
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,564 (6.29/day)
Thanks: 1,751
Thanked 2,594 Times in 1,959 Posts

System Specs

You can use Environment.OSVersion to figure out what version of Windows the application is being run on is.

Code:
If Environment.OSVersion.MajorVersion >= 6
 ' Vista/7/Server 2008
Else
 ' XP/Server 2003/2000/NT

It does not work on Server 2003 most likely because "net send" is a Windows 2000 and older command. "msg" works fine:

Code:
msg Administrator test
I'll check XP but I'm pretty sure it will be the same result.


Edit: XP is the same as Server 2003 (use "msg").


If you change it over to use Process.Start, the command window, and most likely response, will appear in your application (or not at all) rather than separate windows.
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }

Last edited by FordGT90Concept; Jan 22, 2010 at 02:10 AM.
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote
The Following User Says Thank You to FordGT90Concept For This Useful Post:
Old Jan 22, 2010, 02:22 AM   #11
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Quote:
Originally Posted by FordGT90Concept View Post
You can use Environment.OSVersion to figure out what version of Windows the application is being run on is.

Code:
If Environment.OSVersion.MajorVersion >= 6
 ' Vista/7/Server 2008
Else
 ' XP/Server 2003/2000/NT

It does not work on Server 2003 most likely because "net send" is a Windows 2000 and older command. "msg" works fine:

Code:
msg Administrator test
I'll check XP but I'm pretty sure it will be the same result.


Edit: XP is the same as Server 2003 (use "msg").


If you change it over to use Process.Start, the command window, and most likely response, will appear in your application (or not at all) rather than separate windows.
So I need to change it so XP uses the msg command as well? Last time I checked, the net send command also worked on XP.

Also, the auto environment detector, GENIUS! I will use that!

EDIT: Hmm... trying to figure out how to "capture" the return text, is it possible to grab it and have that other window never open?
__________________
CPU-Z validation sig pics temporarily blocked

Last edited by PVTCaboose1337; Jan 22, 2010 at 02:30 AM.
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 22, 2010, 03:00 AM   #12
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,564 (6.29/day)
Thanks: 1,751
Thanked 2,594 Times in 1,959 Posts

System Specs

"net send Administrator test" does not work on Server 2003. It says "the message alias could not be found on the network."


Come to think of it, the response Window will pop up even if you redirect output because the application recieveing the message most likely isn't the computer running the app. You can get rid of console windows though:

Code:
Imports System.Diagnostics

...

Dim psi As New ProcessStartInfo()
With psi
  .Arguments = user & " " & msg
  .CreateNoWindow = True
  .FileName = Environment.GetEnvironmentVariable("SYSTEMROOT") & "\system32\msg.exe"
  .UseShellExecute = False
  .ErrorDialog = False
  .RedirectStandardOutput = True
  .RedirectStandardError = True
  .WorkingDirectory = Environment.GetEnvironmentVariable("SYSTEMROOT") & "\system32"
End With

Dim p As New Process()
With p
  .StartInfo = psi;
  .Start();
  .WaitForExit();
End With
After that last End With is where you would put the While loop to handle the streams. I really see no need to in this case, however.


I don't have Visual Studio installed at this time so the code above is untested (converted to VB from C#).
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote
The Following User Says Thank You to FordGT90Concept For This Useful Post:
Old Jan 22, 2010, 03:26 AM   #13
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

New version... Really minor changes, removed an unneeded line of code, updated the icon, picture, etc. Added 90% transparency, and most of all, fixed the XP error. Next up is to make a "test" button that sends the local user a test message to make sure everything is correctly configured.

Edit: Please give suggestions for features if you think this small app needs improvement.
Attached Files
File Type: exe Easy Msg.exe (49.5 KB, 79 views)
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 22, 2010, 03:29 AM   #14
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,564 (6.29/day)
Thanks: 1,751
Thanked 2,594 Times in 1,959 Posts

System Specs

By the way, all the version numbers are on here:
http://en.wikipedia.org/wiki/History...ct_progression

I don't know if Windows 2000 has msg.exe or not. Doing some Googling, it appears that Windows 2000 has msg.exe but some distros of Windows Vista does not (Home Basic and Home Premium).

In any case, you should add a check for the file before attempting to execute it:
Code:
If System.IO.File.Exists(Environment.GetEnvironmenVariable("SYSTEMROOT") & "\system32\msg.exe")) Then
  ' run it
Else
  MessageBox.Show("msg.exe" could not be found") ' or attempt net send but I still don't see how to run it
End If

Edit:
Another suggestion is to catch the KeyPress event for Message and invoke the Send button. Something like:
Code:
Private Sub txtMessage_KeyPress(sender As Object, e As KeyPressEventArgs)
  If e.KeyChar = Convert.ToChar(13) Then
    send_Click(Me, New EventArgs())
    e.Handled = True
  End If
End Sub
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }

Last edited by FordGT90Concept; Jan 22, 2010 at 03:41 AM.
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote
Old Jan 22, 2010, 03:38 AM   #15
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Quote:
Originally Posted by FordGT90Concept View Post
By the way, all the version numbers are on here:
http://en.wikipedia.org/wiki/History...ct_progression

I don't know if Windows 2000 has msg.exe or not. Doing some Googling, it appears that Windows 2000 has msg.exe but some distros of Windows Vista does not (Home Basic and Home Premium).

In any case, you should add a check for the file before attempting to execute it:
Code:
If System.IO.File.Exists(Environment.GetEnvironmentalVariable("SYSTEMROOT") & "\system32\msg.exe"))
  ' run it
Else
  MessageBox.Show("msg.exe" could not be found") ' or attempt net send but I still don't see how to run it
End If

Edit:
Another suggestion is to catch the KeyPress event for Message and invoke the Send button. Something like:
Code:
Private Sub txtMessage_KeyPress(sender As Object, e As KeyPressEventArgs)
  If e.KeyChar = Convert.ToChar(13) Then
    send_Click(Me, New EventArgs())
    e.Handled = True
  End If
End Sub
I am having issues with

Code:
Environment.GetEnvironmentalVariable
Seems not to work...
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 22, 2010, 03:39 AM   #16
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,564 (6.29/day)
Thanks: 1,751
Thanked 2,594 Times in 1,959 Posts

System Specs

Environment.GetEnvironmentVariable()


It works on Server 2003 but I had Windows 7/Vista checked.
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote
Old Jan 22, 2010, 03:42 AM   #17
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 22, 2010, 03:43 AM   #18
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,564 (6.29/day)
Thanks: 1,751
Thanked 2,594 Times in 1,959 Posts

System Specs

It is Environment, not Environmental (my brain fart, I got right a post or two before that ). I fixed the code you quoted of mine.
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote
The Following User Says Thank You to FordGT90Concept For This Useful Post:
Old Jan 22, 2010, 03:50 AM   #19
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Great! You forgot the "then" as well... Works now, also, I need someone to test it with the new code in it who DOES NOT HAVE MSG.exe!!! Also, for the test button... I was planning on having it send a message back to the user... I tried saying the user was "127.0.0.1" but no luck! Any ideas?

Edit: Ok we kinda are dumb ... what happens if the user is using Windows 2000 which does not have MSG.exe, but still uses the net send command? I will fix... those radio buttons are lifesavers!

Edit2: Problem solved:

Attached Files
File Type: exe Easy Msg.exe (49.5 KB, 57 views)
__________________
CPU-Z validation sig pics temporarily blocked

Last edited by PVTCaboose1337; Jan 22, 2010 at 04:07 AM.
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 22, 2010, 04:54 AM   #20
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,564 (6.29/day)
Thanks: 1,751
Thanked 2,594 Times in 1,959 Posts

System Specs

You shouldn't need the radio buttons...
Code:
If Environment.OSVersion.Platform <> PlatformID.Win32NT Then
  ' Windows 9x or other, not suported
Else
  If System.IO.File.Exists(Environment.GetEnvironmentalVariable("SYSTEMROOT") & "\system32\msg.exe") Then
    ' Use msg
  Else
    If System.IO.File.Exists(Environment.GetEnvironmentalVariable("SYSTEMROOT") & "\system32\net.exe") And Environment.OSVersion.MajorVersion < 6 Then
      ' Use net send
    Else
      ' Not supported
    End If
  End If
End If
You should really make the path to msg and the path to net readonly variables:
Code:
Private ReadOnly PATH_MSG As String = Environment.GetEnvironmentalVariable("SYSTEMROOT") & "\system32\msg.exe") 
Private ReadOnly PATH_NET As String = Environment.GetEnvironmentalVariable("SYSTEMROOT") & "\system32\net.exe")
Instead of typing that whole lot, you'd only have to type PATH_MSG or PATH_NET.


Edit: I updated both code areas in this post...
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }

Last edited by FordGT90Concept; Jan 22, 2010 at 05:06 AM.
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote
Old Jan 25, 2010, 12:25 AM   #21
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Quote:
Originally Posted by FordGT90Concept View Post
You shouldn't need the radio buttons...
Code:
If Environment.OSVersion.Platform <> PlatformID.Win32NT Then
  ' Windows 9x or other, not suported
Else
  If System.IO.File.Exists(Environment.GetEnvironmentalVariable("SYSTEMROOT") & "\system32\msg.exe") Then
    ' Use msg
  Else
    If System.IO.File.Exists(Environment.GetEnvironmentalVariable("SYSTEMROOT") & "\system32\net.exe") And Environment.OSVersion.MajorVersion < 6 Then
      ' Use net send
    Else
      ' Not supported
    End If
  End If
End If
You should really make the path to msg and the path to net readonly variables:
Code:
Private ReadOnly PATH_MSG As String = Environment.GetEnvironmentalVariable("SYSTEMROOT") & "\system32\msg.exe") 
Private ReadOnly PATH_NET As String = Environment.GetEnvironmentalVariable("SYSTEMROOT") & "\system32\net.exe")
Instead of typing that whole lot, you'd only have to type PATH_MSG or PATH_NET.


Edit: I updated both code areas in this post...
Ok great! I fixed most of the code to automate choosing the Windows version.
Attached Files
File Type: exe Easy Msgr.exe (54.5 KB, 80 views)
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 25, 2010, 01:14 AM   #22
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Having trouble calling a media file from resources. How would I accomplish this?

Code:
AxWindowsMediaPlayer1.URL = "My.Resources.music.mid"
The above code does not work.
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 25, 2010, 03:01 AM   #23
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,564 (6.29/day)
Thanks: 1,751
Thanked 2,594 Times in 1,959 Posts

System Specs

MIDI is going to be trouble. Can you convert it to a .wav? In wave format, you can use System.Media.SoundPlayer.
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote
Old Jan 25, 2010, 02:50 PM   #24
PVTCaboose1337
Graphical Hacker
 
PVTCaboose1337's Avatar
 
Join Date: Feb 2006
Location: San Antonio, Texas
Posts: 7,478 (2.81/day)
Thanks: 798
Thanked 1,174 Times in 834 Posts

System Specs

Quote:
Originally Posted by FordGT90Concept View Post
MIDI is going to be trouble. Can you convert it to a .wav? In wave format, you can use System.Media.SoundPlayer.
I actually got it to play, but the music / midi file has to be in the same folder. Simply need to know how to call from resources.

Code:
AxWindowsMediaPlayer1.URL = "music.mid"
__________________
CPU-Z validation sig pics temporarily blocked
PVTCaboose1337 is offline  
Reply With Quote
Old Jan 25, 2010, 03:00 PM   #25
FordGT90Concept
"I go fast!1!11!1!"
 
FordGT90Concept's Avatar
 
Join Date: Oct 2008
Location: IA, USA
Posts: 10,564 (6.29/day)
Thanks: 1,751
Thanked 2,594 Times in 1,959 Posts

System Specs

Oh, embeded in your executable? Usually it is:

AssemblyName.Properties.Reserouces.name_of_resourc e
__________________
Golden Rule of Programming: Never assume.

try { SteamDownload(); }
catch (Steamception ex) { RageQuit(); }
FordGT90Concept is offline  
Crunching for Team TPU
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Visual Basic 3 Decompiler Munki Programming & Webmastering 1 Jun 4, 2009 04:32 AM
Visual Basic Tutorials Wozzer Programming & Webmastering 9 Nov 30, 2008 10:06 AM
Visual Basic Type Mismatch Dark_Webster Programming & Webmastering 17 Jul 20, 2008 07:48 PM
Visual Basic HELP dcf-joe Programming & Webmastering 6 Mar 5, 2008 01:36 PM
DOS File Transfer Commands: djmonson General Software 22 Jun 18, 2007 01:19 PM


All times are GMT. The time now is 02:07 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
no new posts