非常非常非常新的用户需要帮助。 [英] Very, very, very new user needs help.

查看:59
本文介绍了非常非常非常新的用户需要帮助。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows XP,我已经发现如何在我的电脑启动时用我自己的wav

声音代替Microsoft默认声音,但现在我想要b $ b想要更进一步。我创建了7个不同的波形文件


(C:\Start sound \\\1.wav分别为C:\Start sound \ day7.wav)


并希望根据星期几打开另一个 -

" day1.wav"周一开放,day2.wav在周二等等。


我已下载Visual Basic Express版但我需要创建一个例程

我没有专业知识要做的事情。

我非常友好地给出了VB6 ng中的以下例程,但是因为它不会在Express Edition中工作,所以他们建议我尝试一下dotnet group为

正确的代码。我把它包括在下面,因为它可能很容易被一个熟悉的人修改但是它可能需要完全重新组合。


如果这是

错误的话,任何善良的人都可以帮助或指出我正确的方向。

非常感谢。

选项明确

私有声明函数sndPlaySound Lib" winmm.dll"别名_

" sndPlaySoundA" (ByVal FileName As String,_

ByVal Flags As Long)As Long

Dim myDate As String


Private Sub Form_Load( )


myDate =格式(现在,dddd)

Debug.Print myDate

选择Case myDate

案例星期一

调用sndPlaySound(" C:\ start sound \\\ 1.wav",1)

案例星期二 ;

致电sndPlaySound(" C:\start sound \\\ 2.wav",1)

案例星期三

调用sndPlaySound(C:\ start sound \\\ 3.33,1)

案例星期四

调用sndPlaySound(" C:\启动声音\ day4.wav",1)

案例星期五

调用sndPlaySound(" C:\start sound\day5.wav", 1)

案例星期六

拨打sndPlaySound(C:\ start sound \\\6.6.avav,1)

案例星期天

Ca. ll sndPlaySound(" C:\ start sound \ day7.wav",1)

结束选择

结束子

-

问候,Jack Sadie
ja ***** *******@yahooREMOVE.co.uk

I am using Windows XP and I have found out how to substitute my own wav
sound for the Microsoft default sound when my computer starts, but now I
want to go a step further. I have created 7 different wave files

(C:\Start sound\day1.wav to C:\Start sound\day7.wav respectively)

and want to have a different one open according to the day of the week - the
"day1.wav" opening on Mondays and the "day2.wav" on Tuesdays and so on.

I have downloaded Visual Basic Express edition but I need to have a routine
created which I don''t have the expertise to do.
I was very kindly given the following routine in a VB6 ng but because it
won''t work in the Express Edition, they advised me to try a dotnet group for
the correct code. I have included it below because it just might be easily
amended by someone who is familiar but it may need to be completely
re-composed.

Can any kind person assist or point me in the right direction if this is the
wrong ng.
Thanks so much.
Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal FileName As String, _
ByVal Flags As Long) As Long
Dim myDate As String

Private Sub Form_Load()

myDate = Format(Now, "dddd")
Debug.Print myDate
Select Case myDate
Case "Monday"
Call sndPlaySound("C:\start sound\day1.wav", 1)
Case "Tuesday"
Call sndPlaySound("C:\start sound\day2.wav", 1)
Case "Wednesday"
Call sndPlaySound("C:\start sound\day3.wav", 1)
Case "Thursday"
Call sndPlaySound("C:\start sound\day4.wav", 1)
Case "Friday"
Call sndPlaySound("C:\start sound\day5.wav", 1)
Case "Saturday"
Call sndPlaySound("C:\start sound\day6.wav", 1)
Case "Sunday"
Call sndPlaySound("C:\start sound\day7.wav", 1)
End Select
End Sub
--
Regards, Jack Sadie
ja************@yahooREMOVE.co.uk

推荐答案

杰克,


在VB 2005中有更多方法可以播放wav文件。


你可以使用DirectX

你可以使用My.Computer。 Audio.Play(fileName)
http:// msdn2.microsoft.com/en-us/library/cf1shcah.aspx

您可以按照VB6示例中的方式进行操作,因为在VB6中

a long是32位你必须改变long inInt32。


还有另外一种方法,我必须搜索它,它不是直接在我的脑海里,但是因为我认为你会使用那个

Audio.Play(因为你应该尽量避免使用Win32 API和DirectX是很难的方式),我不这样做。


我希望这会有所帮助,


Cor
Jack,

In VB 2005 there are more methods to play a wav file.

You can use DirectX
You can use My.Computer.Audio.Play(fileName)
http://msdn2.microsoft.com/en-us/library/cf1shcah.aspx

You can do it in the way as you see in that VB6 sample, because that in VB6
a long is 32bits you have to change that "long in "Int32".

And there is even another method, I have to search for it, it comes not
direct in my mind, however because that I assume that you will use that
Audio.Play (because you should try to avoid using Win32 API''s and DirectX is
the hard way to go), I don''t do that.

I hope this helps,

Cor


" Jack Sadie" < JA ******* @ btinternet.com> schrieb
"Jack Sadie" <ja*******@btinternet.com> schrieb
我使用的是Windows XP,当我的计算机启动时,我已经发现如何用我自己的
wav声音代替Microsoft默认声音,
但现在我想去更进一步。我创建了7个不同的wave


(C:\Start sound\day1.wav分别为C:\Start sound\day7.wav)
<并且希望根据
周的那天打开另一个 - day1.wav。周一开放,day2.wav在星期二等等。

我已经下载了Visual Basic Express版本,但我需要创建一个我没有专业知识的例行程序。
我非常友好地在VB6 ng中给出了以下例程但是因为它不能在Express Edition中工作,他们建议我尝试使用dotnet组来获取正确的代码。我把它包括在下面
因为它可能很容易被熟悉的人修改
但它可能需要完全重新组合。

任何善良的人都可以帮助或如果
这是错误的指示我指向正确的方向。
非常感谢。

选项明确
私有声明功能sndPlaySound Lib" winmm.dll" Alias _
" sndPlaySoundA" (ByVal FileName As String,_
ByVal Flags As Long)As long



私有声明函数sndPlaySound Lib" winmm.dll"别名_

" sndPlaySoundA" (ByVal FileName As String,_

ByVal Flags As Integer)As Boolean


Dim myDate As String

Private Sub Form_Load( )

myDate =格式(现在,dddd)
Debug.Print myDate
选择案例myDate
案例星期一
调用sndPlaySound (C:\start sound\day1.wav,1)
案例星期二
调用sndPlaySound(" C:\start sound\day2.wav",1 )
案例星期三
致电sndPlaySound(C:\start sound\day3.wav,1)
案例星期四
致电sndPlaySound( C:\start sound\day4.wav,1)
案例星期五
调用sndPlaySound(" C:\start sound\day5.wav",1)
案例周六
致电sndPlaySound(C:\start sound\day6.wav,1)
案例周日
Cal l sndPlaySound(" C:\ start sound; \\ day7.wav",1)
结束选择
End Sub
I am using Windows XP and I have found out how to substitute my own
wav sound for the Microsoft default sound when my computer starts,
but now I want to go a step further. I have created 7 different wave
files

(C:\Start sound\day1.wav to C:\Start sound\day7.wav respectively)

and want to have a different one open according to the day of the
week - the "day1.wav" opening on Mondays and the "day2.wav" on
Tuesdays and so on.

I have downloaded Visual Basic Express edition but I need to have a
routine created which I don''t have the expertise to do.
I was very kindly given the following routine in a VB6 ng but
because it won''t work in the Express Edition, they advised me to try
a dotnet group for the correct code. I have included it below
because it just might be easily amended by someone who is familiar
but it may need to be completely re-composed.

Can any kind person assist or point me in the right direction if
this is the wrong ng.
Thanks so much.
Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal FileName As String, _
ByVal Flags As Long) As Long

Private Declare Function sndPlaySound Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal FileName As String, _
ByVal Flags As Integer) As Boolean

Dim myDate As String

Private Sub Form_Load()

myDate = Format(Now, "dddd")
Debug.Print myDate
Select Case myDate
Case "Monday"
Call sndPlaySound("C:\start sound\day1.wav", 1)
Case "Tuesday"
Call sndPlaySound("C:\start sound\day2.wav", 1)
Case "Wednesday"
Call sndPlaySound("C:\start sound\day3.wav", 1)
Case "Thursday"
Call sndPlaySound("C:\start sound\day4.wav", 1)
Case "Friday"
Call sndPlaySound("C:\start sound\day5.wav", 1)
Case "Saturday"
Call sndPlaySound("C:\start sound\day6.wav", 1)
Case "Sunday"
Call sndPlaySound("C:\start sound\day7.wav", 1)
End Select
End Sub




Private Sub Form_Load()

dim day as integer

dim filename as string


day = Weekday(Now,FirstDayOfWeek.System)

filename =" C:\start sound\day" &安培;一天& " .wav"

sndPlaySound(文件名,1)


结束子

Armin



Private Sub Form_Load()
dim day as integer
dim filename as string

day = Weekday(Now, FirstDayOfWeek.System)
filename = "C:\start sound\day" & day & ".wav"
sndPlaySound(filename, 1)

End Sub
Armin


" Jack Sadie" < JA ******* @ btinternet.com> schrieb:
"Jack Sadie" <ja*******@btinternet.com> schrieb:
我正在使用Windows XP,当我的电脑启动时,我已经发现如何用我自己的wav
声音代替Microsoft默认声音,但现在我想要更进一步。我创建了7个不同的波形文件

(C:\Start sound\day1.wav分别为C:\Start sound\day7.wav)
I am using Windows XP and I have found out how to substitute my own wav
sound for the Microsoft default sound when my computer starts, but now I
want to go a step further. I have created 7 different wave files

(C:\Start sound\day1.wav to C:\Start sound\day7.wav respectively)




未经测试(需要.NET 2.0(VS 2005)):


\\\

Imports System.Media

....

Dim FileName As String

现在选择Case.DayOfWeek

Case DayOfWeek.Monday

FileName =" Monday.wav"

Case DayOfWeek.Tuesday

FileName =" Tuesday.wav"

Case DayOfWeek.Wednesday

...

Case DayOfWeek.Thursday

...

Case DayOfWeek.Saturday

...

Case DayOfWeek.Sunday

...

结束选择

Dim Player As New SoundPlayer(_

Path.Combine(My.Application.Info.DirectoryPath,FileName)_



Player .Play()

///


-

MS Herfried K. Wagner

MVP< URL:http:// dotnet.mvps.org/>

V B< URL:http://classicvb.org/petition/>



Untested (requires .NET 2.0 (VS 2005)):

\\\
Imports System.Media
....
Dim FileName As String
Select Case Now.DayOfWeek
Case DayOfWeek.Monday
FileName = "Monday.wav"
Case DayOfWeek.Tuesday
FileName = "Tuesday.wav"
Case DayOfWeek.Wednesday
...
Case DayOfWeek.Thursday
...
Case DayOfWeek.Saturday
...
Case DayOfWeek.Sunday
...
End Select
Dim Player As New SoundPlayer( _
Path.Combine(My.Application.Info.DirectoryPath, FileName) _
)
Player.Play()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


这篇关于非常非常非常新的用户需要帮助。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆