microsoft表达式编码器4 SP2错误“空路径名不合法." [英] microsoft expression encoder 4 SP2 error "Empty path name is not legal."
问题描述
我已经下载了免费版本,但收到错误消息空路径名不合法".在我的vb代码中.
我不明白该错误消息,如何避免出现此错误?
I have downloaded the free version, but I get the error message "Empty path name is not legal." in my vb code.
I do not understand the error message, how can I avoid mega this error?.
这是我的vb代码:
Public Class Form1
Dim showsettings As Boolean = False
Dim heightanimationtimer As Timer
Dim capturerec As New ScreenCaptureJob
Dim videopath As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\strandboscrrec.xesc"
Dim audiodevices As Collection(Of EncoderDevice) = EncoderDevices.FindDevices(EncoderDeviceType.Audio)
Dim formstartheight As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
formstartheight = Me.Height
capturerec.ScreenCaptureVideoProfile.Quality = 100
capturerec.OutputScreenCaptureFileName = videopath
Rec.BackgroundImage = New Bitmap(Application.StartupPath & "\recicon.png")
Rec.BackgroundImageLayout = ImageLayout.Zoom
StopB.BackgroundImage = New Bitmap(Application.StartupPath & "\stopicon.png")
StopB.BackgroundImageLayout = ImageLayout.Zoom
Save.BackgroundImage = New Bitmap(Application.StartupPath & "\saveicon.png")
Save.BackgroundImageLayout = ImageLayout.Zoom
PlayVideo.BackgroundImage = New Bitmap(Application.StartupPath & "\prvicon.png")
PlayVideo.BackgroundImageLayout = ImageLayout.Zoom
UploadPlayYouTube.BackgroundImage = New Bitmap(Application.StartupPath & "\uyticon.png")
UploadPlayYouTube.BackgroundImageLayout = ImageLayout.Zoom
CheckedListBox1.SetItemChecked(0, True)
CheckedListBox1.SetItemChecked(1, True)
End Sub
Private Sub Rec_Click(sender As Object, e As EventArgs) Handles Rec.Click
capturerec.ResetSettings()
Select Case True
Case FrameRate15.Checked
capturerec.ScreenCaptureVideoProfile.FrameRate = 15
Case FrameRate20.Checked
capturerec.ScreenCaptureVideoProfile.FrameRate = 20
Case FrameRate25.Checked
capturerec.ScreenCaptureVideoProfile.FrameRate = 25
End Select
Dim audiodevices As Collection(Of EncoderDevice) = EncoderDevices.FindDevices(EncoderDeviceType.Audio)
For Each item As String In CheckedListBox1.CheckedItems
Select Case item
Case "Mikrofon"
capturerec.AddAudioDeviceSource(audiodevices(0))
Case "Systemlyd"
capturerec.AddAudioDeviceSource(audiodevices(1))
End Select
Next
If File.Exists(videopath) Then
File.Delete(videopath)
End If
capturerec.Start() ' The error occurs here
Rec.Enabled = False
CheckedListBox1.Enabled = False
FrameRate15.Enabled = False
FrameRate20.Enabled = False
FrameRate25.Enabled = False
Save.Enabled = False
PlayVideo.Enabled = False
UploadPlayYouTube.Enabled = False
End Sub
Private Sub StopB_Click(sender As Object, e As EventArgs) Handles StopB.Click
capturerec.Stop()
Dim converter As New Job
converter.CreateSubfolder = False
Dim videotoconvert As New MediaItem(videopath)
videotoconvert.OutputFormat.AudioProfile = videotoconvert.SourceAudioProfile
videotoconvert.OutputFormat.VideoProfile.FrameRate = videotoconvert.SourceVideoProfile.FrameRate
videotoconvert.OutputFormat.VideoProfile.Bitrate = videotoconvert.SourceVideoProfile.Bitrate
videotoconvert.OutputFormat.VideoProfile.Size = videotoconvert.SourceVideoProfile.Size
videotoconvert.ResizeQuality = ResizeQuality.Bilinear
videotoconvert.OverlayFileName = "C:\Users\Mads Haupt\AppData\Local\strandboscrrec - Kopi.wmv" ' Webcam video
videotoconvert.OverlayLayoutMode = OverlayLayoutMode.Custom
videotoconvert.OverlayRect = New Rectangle(videotoconvert.SourceVideoProfile.Size.Width - 50 - 40, videotoconvert.SourceVideoProfile.Size.Height - 50 - 30, 40, 30)
converter.MediaItems.Add(videotoconvert)
converter.OutputDirectory = Path.GetDirectoryName(videopath)
'AddHandler converter.EncodeProgress
converter.Encode()
'Process.Start(Path.ChangeExtension(videopath, ".wmv"))
End Sub
End Class
这是堆栈跟踪:
Here is Stack Trace:
System.ArgumentException: Empty path name is not legal.
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at Microsoft.Expression.Encoder.ScreenCapture.FileHelper.CheckFilePathForWriting(String path)
at Microsoft.Expression.Encoder.ScreenCapture.Session.CheckOutputPath()
at Microsoft.Expression.Encoder.ScreenCapture.Session.Initialize()
at Microsoft.Expression.Encoder.ScreenCapture.ScreenCaptureJob.InitializeStartRecordingSession()
at Microsoft.Expression.Encoder.ScreenCapture.ScreenCaptureJob.ExecuteCommand(ScreenCaptureCommand command)
at Microsoft.Expression.Encoder.ScreenCapture.ScreenCaptureJob.Start()
at Strandbo_Screen_Recorder.Form1.Rec_Click(Object sender, EventArgs e) i C:\Users\Mads Haupt\OneDrive\Strandbo Screen Recorder\Strandbo Screen Recorder\Form1.vb:line 79
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded assemblies **************
mscorlib
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18444 built by: FX451RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Strandbo Screen Recorder
Assemblyversion: 1.0.0.0
Win32-version: 1.0.0.0
CodeBase: file:///C:/Users/Mads%20Haupt/OneDrive/Strandbo%20Screen%20Recorder/Strandbo%20Screen%20Recorder/bin/Debug/Strandbo%20Screen%20Recorder.exe
----------------------------------------
Microsoft.VisualBasic
Assemblyversion: 10.0.0.0
Win32-version: 11.0.50938.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Microsoft.Expression.Encoder
Assemblyversion: 4.0.0.0
Win32-version: 4.0.4276.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/Microsoft.Expression.Encoder/v4.0_4.0.0.0__31bf3856ad364e35/Microsoft.Expression.Encoder.dll
----------------------------------------
Microsoft.Expression.Encoder.Utilities
Assemblyversion: 4.0.0.0
Win32-version: 4.0.4276.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/Microsoft.Expression.Encoder.Utilities/v4.0_4.0.0.0__31bf3856ad364e35/Microsoft.Expression.Encoder.Utilities.dll
----------------------------------------
Microsoft.Expression.Encoder.Types
Assemblyversion: 4.0.0.0
Win32-version: 4.0.4276.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/Microsoft.Expression.Encoder.Types/v4.0_4.0.0.0__31bf3856ad364e35/Microsoft.Expression.Encoder.Types.dll
----------------------------------------
WindowsBase
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
Microsoft.Expression.Encoder.resources
Assemblyversion: 4.0.0.0
Win32-version: 4.0.4276.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/Microsoft.Expression.Encoder.resources/v4.0_4.0.0.0_en_31bf3856ad364e35/Microsoft.Expression.Encoder.resources.dll
----------------------------------------
mscorlib.resources
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_da_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Windows.Forms.resources
Assemblyversion: 4.0.0.0
Win32-version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_da_b77a5c561934e089/System.Windows.Forms.resources.dll
推荐答案
我已经下载了免费版本,但收到错误消息空路径名不合法".在我的vb代码中.
我不明白该错误消息,如何避免出现此错误?
I have downloaded the free version, but I get the error message "Empty path name is not legal." in my vb code.
I do not understand the error message, how can I avoid mega this error?.
您应该使用监视窗口在发生错误时检查对象属性,并查看哪些为空,但是我怀疑它将是.OutputPath,因为我看不到要在哪个位置设置该值.
You should use the watch window to check the object properties at the time that the error occurs and see which ones are empty, but I suspect it will be .OutputPath, as I can't see where you are setting that value.
这篇关于microsoft表达式编码器4 SP2错误“空路径名不合法."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!