argumentexception

an Interesting Exception While get an Image from Internet

笑着哭i 提交于 2021-02-04 17:57:05
问题 I am developing a program in WPF, getting a picture from the web and used an image control. My image list has 50 pictures (from vimeo's thumbnails). Everything looks fine but number 45. The picture has some problem and when I get to the 45th picture, I get this exception: Value does not fall within the expected range. exception http://img232.imageshack.us/img232/2748/5688301315b2497090468bc.png I used try-catch but I can't catch it. Because it occurs in the Bitmap class. Here are the details:

RichTextBox.RTF setter throwing System.ArgumentException. File format is not valid in Windows version 1803

狂风中的少年 提交于 2020-01-24 20:58:07
问题 The following scenario is simulated to reproduce the crash: Enable Beta: unicode UTF-8 for world wide language support (To enable Start=> Region & Language settings => Related settings -> Additional date, time & regional settings => Region -> Change date, time or number formats => select Administrative tab => Click on Change System Locale. Check Beta: unicode UTF-8 for world wide language support checkbox Restart the system In Windows forms Application => Add a form, RichTextBox, Button and a

Exception message not being displayed correctly on client computers

萝らか妹 提交于 2020-01-07 02:52:05
问题 The project I'm currently working on is a form designer (Silverlight Application) wherein the user can drag a control from the toolbox to the work canvas and then supply its properties in the property pane (like Visual Studio and Expression Blend) We deployed our app in the IIS of our test server for the QC department to test it. There is a certain bug wherein typing in "Auto" in fields where it is not applicable (MinHeight and MinWidth) is not being handled properly. What we did is go on

ArgumentException not caught when using BitmapImage.BeginInit()

天大地大妈咪最大 提交于 2020-01-06 07:06:36
问题 Why when an ArgumentException occurs because image.jpg has an invalid metadata header does the first example catch the exception, and the second example does not? Example 1: try { Uri myUri = new Uri("http://example.com/image.jpg", UriKind.RelativeOrAbsolute); JpegBitmapDecoder decoder2 = new JpegBitmapDecoder(myUri, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); BitmapSource bitmapSource2 = decoder2.Frames[0]; } catch (Exception ex) { MessageBox.Show(ex.Message); }

System.ArgumentException illegal characters in path

≡放荡痞女 提交于 2020-01-03 16:45:23
问题 I am using Path.Combine, and one of the strings contain a Unicode characters. I get {System.ArgumentException} exception; illegal characters in path. According to MSDN filepath/name can have unicode characters. Why do I get this exception? Edit: Here is the code: Path.Combine("C:\PDM\Silver","Amabel Bender QQQ") 回答1: I figured out the problem. The second string contains a "tab" character in it causing the exception. (that didn't showed up when I pasted the string here) Thanks everyone and

System.ArgumentException illegal characters in path

好久不见. 提交于 2020-01-03 16:44:13
问题 I am using Path.Combine, and one of the strings contain a Unicode characters. I get {System.ArgumentException} exception; illegal characters in path. According to MSDN filepath/name can have unicode characters. Why do I get this exception? Edit: Here is the code: Path.Combine("C:\PDM\Silver","Amabel Bender QQQ") 回答1: I figured out the problem. The second string contains a "tab" character in it causing the exception. (that didn't showed up when I pasted the string here) Thanks everyone and

ASP.NET Master Page: Event Validation Error

十年热恋 提交于 2019-12-25 02:29:59
问题 I included a repeater in my master page. The repeater has a button that I set its CommandArgument. However when I click the button I get the following exception: System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the

Attached Property: 'System.TypeInitializationException' when setting default value

安稳与你 提交于 2019-12-24 09:35:41
问题 I want to set a default value of my Attached Property, but when I do I get: A first chance exception of type 'System.ArgumentException' occurred in WindowsBase.dll A first chance exception of type 'System.TypeInitializationException' occurred in Oef_AttDepProp.exe Without the default value, things work fine. This is some sample code I used: public static readonly DependencyProperty IsEigenaarProperty = DependencyProperty.RegisterAttached( "Eigenaar", typeof(clsPersoon), typeof(UIElement), new

System.ArgumentException and System.ComponentModel.Win32Exception when getting process information

五迷三道 提交于 2019-12-24 01:21:29
问题 When i try to write process' information to console i get System.ArgumentException and System.ComponentModel.Win32Exception. What causes this? How can i stop having those? Process processListe = Process.GetProcesses(); for (int i = 0; i < processListe.Count(); i++) { try { string companyName = processListe[i].MainModule.FileVersionInfo.CompanyName; string fileVersion = processListe[i].MainModule.FileVersionInfo.FileVersion; Console.WriteLine(companyName + " " + fileVersion); } catch

C# SerialPort#Open() method throws ArgumentException because of port name?

▼魔方 西西 提交于 2019-12-18 09:45:01
问题 On my local machine, Windows XP Ports (COM & LPT) COM3 RIM Virtual Serial Port v2 (COM4) RIM Virtual Serial Port v2 (COM5) the following code, using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Ports; using System.Threading; namespace OpenSerialPortTest { class Test { static void Main(string[] args) { foreach (String serialPortName in SerialPort.GetPortNames()) { SerialPort serialPort = new SerialPort(serialPortName); try { serialPort.Open();