真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網站制作重慶分公司

vb.net制作圖文播放,vb制作網頁

簡單的播放器用vb.net怎么做啊

右擊工具箱/部件/WindowsMediaPlayer

創(chuàng)新互聯(lián)是一家集網站建設,滁州企業(yè)網站建設,滁州品牌網站建設,網站定制,滁州網站建設報價,網絡營銷,網絡優(yōu)化,滁州網站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學習、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網站。

//類模塊Mmedia

Option Explicit

'-----------------------------------------------------

' Name : MMedia.cls

' Author : Peter Wright, For BG2VB4 BG2VB5

'

' Notes : A multimedia class, which when turned

' : into an object lets you load and play

' : multimedia files, such as sound and

' : video.

'-----------------------------------------------------

' -=-=-=- PROPERTIES -=-=-=-

' Filename Determines the name of the current file

' Length The length of the file (Read Only)

' Position The current position through the file

' Status The current status of the object (Read Only)

' Wait True/False...tells VB to wait until play done

' -=-=-=- METHODS -=-=-=-=-

' mmOpen Filename Opens the requested filename

' mmClose Closes the current file

' mmPause Pauses playback of the current file

' mmStop Stops playback ready for closedown

' mmSeek Position Seeks to a position in the file

' mmPlay Plays the open file

'-------------------------------------------------------------

' NOTES

' -----

'

' Open a file, then play it. Pause it in response to a request

' from the user. Stop if you intend to seek to the start and

' play again. Close when you no longer want to play the file

'--------------------------------------------------------------

Private sAlias As String ' Used internally to give an alias name to

' the multimedia resource

Private sFilename As String ' Holds the filename internally

Private nLength As Single ' Holds the length of the filename

' internally

Private nPosition As Single ' Holds the current position internally

Private sStatus As String ' Holds the current status as a string

Private bWait As Boolean ' Determines if VB should wait until play

' is complete before returning.

'------------ API DECLARATIONS -------------

'note that this is all one code line:

Private Declare Function mciSendString Lib "winmm.dll" _

Alias "mciSendStringA" (ByVal lpstrCommand As String, _

ByVal lpstrReturnString As String, ByVal uReturnLength As Long, _

ByVal hwndCallback As Long) As Long

Public Sub mmOpen(ByVal sTheFile As String)

' Declare a variable to hold the value returned by mciSendString

Dim nReturn As Long

' Declare a string variable to hold the file type

Dim sType As String

' Opens the specified multimedia file, and closes any

' other that may be open

If sAlias "" Then

mmClose

End If

' Determine the type of file from the file extension

Select Case UCase$(Right$(sTheFile, 3))

Case "WAV"

sType = "Waveaudio"

Case "AVI"

sType = "AviVideo"

Case "MID"

sType = "Sequencer"

Case Else

' If the file extension is not known then exit the subroutine

Exit Sub

End Select

sAlias = Right$(sTheFile, 3) Minute(Now)

' At this point there is no file open, and we have determined the

' file type. Now would be a good time to open the new file.

' Note: if the name contains a space we have to enclose it in quotes

If InStr(sTheFile, " ") Then sTheFile = Chr(34) sTheFile Chr(34)

nReturn = mciSendString("Open " sTheFile " ALIAS " sAlias _

" TYPE " sType " wait", "", 0, 0)

End Sub

Public Sub mmClose()

' Closes the currently opened multimedia file

' Declare a variable to hold the return value from the mciSendString

' command

Dim nReturn As Long

' If there is no file currently open then exit the subroutine

If sAlias = "" Then Exit Sub

nReturn = mciSendString("Close " sAlias, "", 0, 0)

sAlias = ""

sFilename = ""

End Sub

Public Sub mmPause()

' Pause playback of the file

' Declare a variable to hold the return value from the mciSendString

' command

Dim nReturn As Long

' If there is no file currently open then exit the subroutine

If sAlias = "" Then Exit Sub

nReturn = mciSendString("Pause " sAlias, "", 0, 0)

End Sub

Public Sub mmPlay()

' Plays the currently open file, from the current position

' Declare a variable to hold the return value from the mciSendString

' command

Dim nReturn As Long

' If there is no file currently open, then exit the routine

If sAlias = "" Then Exit Sub

' Now play the file

If bWait Then

nReturn = mciSendString("Play " sAlias " wait", "", 0, 0)

Else

nReturn = mciSendString("Play " sAlias, "", 0, 0)

End If

End Sub

Public Sub mmStop()

' Stop using a file totally, be it playing or whatever

' Declare a variable to hold the return value from mciSendString

Dim nReturn As Long

' If there is no file currently open then exit the subroutine

If sAlias = "" Then Exit Sub

nReturn = mciSendString("Stop " sAlias, "", 0, 0)

End Sub

Public Sub mmSeek(ByVal nPosition As Single)

' Seeks to a specific position within the file

' Declare a variable to hold the return value from the mciSendString

' function

Dim nReturn As Long

nReturn = mciSendString("Seek " sAlias " to " nPosition, "", 0, 0)

End Sub

Property Get Filename() As String

' Routine to return a value when the programmer asks the

' object for the value of its Filename property

Filename = sFilename

End Property

Property Let Filename(ByVal sTheFile As String)

' Routine to set the value of the filename property, should the programmer

' wish to do so. This implies that the programmer actually wants to open

' a file as well so control is passed to the mmOpen routine

mmOpen sTheFile

End Property

Property Get Wait() As Boolean

' Routine to return the value of the object's wait property.

Wait = bWait

End Property

Property Let Wait(bWaitValue As Boolean)

' Routine to set the value of the object's wait property

bWait = bWaitValue

End Property

Property Get Length() As Single

' Routine to return the length of the currently opened multimedia file

' Declare a variable to hold the return value from the mciSendString

Dim nReturn As Long, nLength As Integer

' Declare a string to hold the returned length from the mci Status call

Dim sLength As String * 255

' If there is no file open then return 0

If sAlias = "" Then

Length = 0

Exit Property

End If

nReturn = mciSendString("Status " sAlias " length", sLength, 255, 0)

nLength = InStr(sLength, Chr$(0))

Length = Val(Left$(sLength, nLength - 1))

End Property

Property Let Position(ByVal nPosition As Single)

' Sets the Position property effectively by seeking

mmSeek nPosition

End Property

Property Get Position() As Single

' Returns the current position in the file

' Declare a variable to hold the return value from mciSendString

Dim nReturn As Integer, nLength As Integer

' Declare a variable to hold the position returned

' by the mci Status position command

Dim sPosition As String * 255

' If there is no file currently opened then exit the subroutine

If sAlias = "" Then Exit Property

' Get the position and return

nReturn = mciSendString("Status " sAlias " position", sPosition, 255, 0)

nLength = InStr(sPosition, Chr$(0))

Position = Val(Left$(sPosition, nLength - 1))

End Property

Property Get Status() As String

' Returns the playback/record status of the current file

' Declare a variable to hold the return value from mciSendString

Dim nReturn As Integer, nLength As Integer

' Declare a variable to hold the return string from mciSendString

Dim sStatus As String * 255

' If there is no file currently opened, then exit the subroutine

If sAlias = "" Then Exit Property

nReturn = mciSendString("Status " sAlias " mode", sStatus, 255, 0)

nLength = InStr(sStatus, Chr$(0))

Status = Left$(sStatus, nLength - 1)

End Property

//窗體fm

Dim m As New Mmedia

Dim fn

Private Sub Command1_Click()

On Error GoTo r

dlg.ShowOpen

fn = dlg.Filename

m.mmOpen fn

r:

If Err Then MsgBox Err.Description

End Sub

Private Sub Command2_Click()

On Error GoTo rp

m.mmPlay

rp:

If Err Then MsgBox Err.Description

End Sub

Private Sub Command3_Click()

On Error GoTo rap

m.mmPause

rap:

If Err Then MsgBox Err.Description

End Sub

Private Sub Command4_Click()

On Error GoTo racp

m.mmStop

racp:

If Err Then MsgBox Err.Description

End Sub

VB.NET如何調用并播放項目資源內的WAV文件。

代碼是沒有錯的,但是其中關鍵是聲音文件資源定義字串必須使用根命名空間,不能用程序集名稱;還有就是聲音文件必須選屬性為嵌入資源。

My.Computer.Audio.Play(My.Resources.xxxmusic1xxx, AudioPlayMode.Background)

VB.NET怎樣播放視頻

首先要確定播放的視頻格式是什么格式,如果是windows media player支持的格式,直接使用該控件就行了,如果是單個視頻的話,比如命名為myPlayer,則:

myPlayer.url="視頻文件完整路徑"

VB.NET 怎么把資源文件里面的.swf 讀出來并放到 AxShockwaveFlash控件里面播放?要測試過的代碼

首先將swf文件添加進資源,方法:

假設資源文件是workergame.swf(你按照自己的改),將其釋放到臨時文件,供AxShockwaveFlash控件播放,完整代碼:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim size As Long = My.Resources.workergame.Length - 1

Dim buffer(CInt(size)) As Byte

buffer = My.Resources.workergame.ToArray

Dim fn As String = IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.Temp, "workergame.swf")

Dim fs As New IO.FileStream(fn, IO.FileMode.Create)

fs.Write(buffer, 0, buffer.Length)

fs.Close()

AxShockwaveFlash1.Movie = fn

End Sub


本文標題:vb.net制作圖文播放,vb制作網頁
文章來源:http://weahome.cn/article/hspchd.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部