标题: [问题求助] 求帮忙将vb转为vbs [打印本页]
作者: 437153 时间: 2015-5-25 19:21 标题: 求帮忙将vb转为vbs
- Option Explicit
- Private Declare Function cvt_FihoCodec Lib "fihocodec.dll" ( _
- ByVal Source As String, _
- ByVal SourceCodec As Integer, _
- ByVal Target As String, _
- ByVal DestCodec As Integer) As Integer
-
- Private Declare Function cvt_GetConvertProgress Lib "fihocodec.dll" () As Long
- Private Declare Function cvt_StopConvert Lib "fihocodec.dll" () As Long
-
-
- Private Sub Command1_Click()
- On Error Resume Next
- Dim SourceFile As String
- Dim TargetFile As String
- Dim n As Integer
- Dim BeginTime As Date
-
- SourceFile = App.Path + "\test.NTC"
- TargetFile = App.Path + "\Target" + Format(Now, "yyyyMMddHHmmss") + ".Wav"
-
- '' test.ntc => wav
- If Dir(SourceFile) <> "" Then
- BeginTime = Now
- cvt_FihoCodec SourceFile, 3, TargetFile, 0
-
- Do While n < 100 And DateDiff("s", BeginTime, Now) <= 120
- DoEvents
- n = cvt_GetConvertProgress
- Label1 = CStr(n) + "%"
- Loop
-
- cvt_StopConvert
- MsgBox "complete"
- End If
-
- End Sub
复制代码
这个代码调用dll,将NTC转换为wav。是一个图形界面的,我想转为vbs,因为从未接触过,所以只好请大家帮帮忙了!
作者: 437153 时间: 2015-5-25 19:23
或者用批处理也行,顺便还能看看批处理调用dll的代码。
作者: czjt1234 时间: 2015-5-26 09:40
vbs不支持api,要调用第三方组件的
vb可以去掉图形界面啊,也可以直接运行程序,不需要点什么运行
你百度下或去vb吧问下
作者: 437153 时间: 2015-5-26 16:29
回复 3# czjt1234
哦,原来是这样啊。
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |