CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Exception
C#
[Serializable]
public class CustomException : Exception
{
    public CustomException()
        : base() { }
    
    public CustomException(string message)
        : base(message) { }
    
    public CustomException(string format, params object[] args)
by Jose David Parra   July 06, 2011 @ 9:17am
54 Views
no comments
 
C#
class Program
{
   static void Main(string[] args)
   {
 
      try
      {
         var mock = new Mock<IService>();
         const long iterationCount = 1000000;
         Parallel.For(0, iterationCount, i => mock.Object.DoWork());
by Staxmanade   July 27, 2010 @ 9:51am
Tags: Moq, Bug, Exception
328 Views
no comments
 
C#
using System;
using System.Runtime.Serialization;
 
public class ArgumentExceptionTemplate
    : ArgumentException
{
    public ArgumentExceptionTemplate()
    { }
 
    public ArgumentExceptionTemplate(string message)
by Al Gonzalez   April 07, 2010 @ 12:53pm
237 Views
no comments
 
C#
using System;
using System.Runtime.Serialization;
 
public class ExceptionTemplate
    : Exception
{
    public ExceptionTemplate()
    { }
 
    public ExceptionTemplate(string message)
by Al Gonzalez   April 07, 2010 @ 12:48pm
320 Views
no comments
 
C#
// search for the most "deepest" inner exception
string mostInnerException = "";
Exception innerException = ex.InnerException;
if (innerException != null)
    while (innerException.InnerException != null)
        innerException = innerException.InnerException;
if (innerException != null)
    mostInnerException = innerException.ToString();
 
// init log info
by dvdstelt   March 25, 2010 @ 5:42am
288 Views
no comments
 
<%@Page language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link rel="stylesheet" type="text/css" href="../westwind.css" />
    <title>Web Connection Adminstration</title>
    <style type="text/css">
    .containercontent
    {
        padding: 10px;
by Rick Strahl   September 28, 2009 @ 1:32pm
422 Views
no comments
 
C#
ASCIIEncoding enc = new ASCIIEncoding();
byte[] bArray = enc.GetBytes(value);
byte[] tempArray = new byte[bArray.Length - i];
Buffer.BlockCopy(bArray, i + 1, tempArray, 0, bArray.Length - i);
bArray = tempArray;
by kyrisu   September 15, 2009 @ 5:50am
Tags: exception
215 Views
1 comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate