View Full Version : Who can help me modifying this code?
pierre
04-27-2004, 06:59 AM
Hi all:
I use Windows Media Player to open 128k.wma file. I put it on AutoPlay\\Audio\\12\\wma folder, but after publishing, open the wma file that it can't open specify file. I think it path incorrect. Where can I put? Who can help me? Thanks.
File.Run("AutoPlay\\Docs\\wmplayer.exe", "128k.wma", "AutoPlay\\Audio\\12\\wma", SW_SHOWNORMAL, false);
pjhiggins
04-27-2004, 07:37 AM
Try it like this.
(Don't have AMS around right now to check this but I think it's right.)
File.Run("AutoPlay\\Docs\\wmplayer.exe", "AutoPlay\\Audio\\12\\wma\\128k.wma", "", SW_SHOWNORMAL, false);
Hi all:
I use Windows Media Player to open 128k.wma file. I put it on AutoPlay\\Audio\\12\\wma folder, but after publishing, open the wma file that it can't open specify file. I think it path incorrect. Where can I put? Who can help me? Thanks.
File.Run("AutoPlay\\Docs\\wmplayer.exe", "128k.wma", "AutoPlay\\Audio\\12\\wma", SW_SHOWNORMAL, false);
Unless you are searching for wmplayer.exe and getting the full path, I'd use File.Open instead of File.Run.
When using File.Open, it will use the application that is associated with.
Hi all:
I use Windows Media Player to open 128k.wma file. I put it on AutoPlay\\Audio\\12\\wma folder, but after publishing, open the wma file that it can't open specify file. I think it path incorrect. Where can I put? Who can help me? Thanks.
File.Run("AutoPlay\\Docs\\wmplayer.exe", "128k.wma", "AutoPlay\\Audio\\12\\wma", SW_SHOWNORMAL, false);
pierre
04-27-2004, 09:04 AM
Hi Worm:
I wish I use Windows Media Player to open the file only.
For pjhiggins:
I had tried your method, but I can't reach my request. It can't open the file by Windows Media Player. Can you tell me why?
pjhiggins
04-27-2004, 01:48 PM
wmplayer.exe isn't in the AutoPlay folder structure. You'll have to use the correct path to it. On my PC that is C:\Program Files\Windows Media Player\wmplayer.exe.
Try something like this...
Song = _SourceFolder.."\\AutoPlay\\Audio\\test.wma";
File.Run("C:\\Program Files\\Windows Media Player\\wmplayer.exe", "/play /close "..Song, "", SW_SHOWNORMAL, false);
I ran into a problem where the path was getting stuck at the space in Documents and Settings. It works great if the .wma file is moved to someplace simple like C:\.
Unfortunately, my latest project went live beta today so I am really busy and can't spend the time to figure out the path issue. I bet one of the others here can figure it out pretty quick though.
Also, here's a link to Media Player command lines...
http://support.microsoft.com/default.aspx?scid=kb;en-us;241422&Product=wmp
Corey
04-27-2004, 02:30 PM
my latest project went live beta today
Yay PJ, whoop, whoop, whoop! :yes
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
pierre
04-28-2004, 01:57 AM
Hi pjhiggins:
I still can't try successed. If I put the test.wma into \\AutoPlay\\Auto or C:\\ , both can't open by Windows Media Player. Can you tell me detail reason? Thanks.
Song = _SourceFolder.."\\AutoPlay\\Audio\\test.wma";
File.Run("C:\\Program Files\\Windows Media Player\\wmplayer.exe", "/play /close "..Song, "", SW_SHOWNORMAL, false);
pierre
04-28-2004, 05:22 AM
Hi all:
Who can explain below codes meaning? Sorry, I am a novice program designer.
Song = _SourceFolder.."\\AutoPlay\\Audio\\test.wma";
File.Run("C:\\Program Files\\Windows Media Player\\wmplayer.exe", "/play /close "..Song, "", SW_SHOWNORMAL, false);
Q1: What meaning upon codes?
Q2: \\AutoPlay\\Audio\\test.wma....Where is it path?
Q3: ..Song ---->What mean is it?
Thank you for advance.
pjhiggins
04-28-2004, 09:20 AM
Ok, here's a fully working version. It may not be the best way to do it but it does it just the same :)
Quotes = '"'
Song = Quotes.._SourceFolder.."\\AutoPlay\\Audio\\12\\wma\\128k.wma"..Quotes
File.Run("C:\\Program Files\\Windows Media Player\\wmplayer.exe", "/play /close "..Song, "", SW_SHOWNORMAL, false);
Quotes supplies a regular quote ( " ). This is needed to wrap the filename path so that the long filename paths work.
Song is the path, including the quotes variable, to the .wma file you want to play.
Attached is a sample project with the above, all working nicely.
pierre
04-29-2004, 01:47 AM
Hi pjhiggins:
You are terrific. I had tried your methods that it can reach my demand. Thank you very much. :p
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.