Click here to Skip to main content
15,891,951 members
Home / Discussions / C#
   

C#

 
QuestionBasic 3.0 to .Net 2005 Pin
MoreMakarand30-Apr-07 9:10
MoreMakarand30-Apr-07 9:10 
AnswerRe: Basic 3.0 to .Net 2005 Pin
Dave Kreskowiak30-Apr-07 10:13
mveDave Kreskowiak30-Apr-07 10:13 
GeneralRe: Basic 3.0 to .Net 2005 Pin
MoreMakarand1-May-07 2:59
MoreMakarand1-May-07 2:59 
QuestionLogging Class and Method where exception occurred. Pin
AnneThorne30-Apr-07 9:08
AnneThorne30-Apr-07 9:08 
AnswerRe: Logging Class and Method where exception occurred. [modified*2] Pin
Tarakeshwar Reddy30-Apr-07 10:01
professionalTarakeshwar Reddy30-Apr-07 10:01 
GeneralRe: Logging Class and Method where exception occurred. [modified*2] Pin
PIEBALDconsult3-May-07 9:39
mvePIEBALDconsult3-May-07 9:39 
AnswerRe: Logging Class and Method where exception occurred. Pin
PIEBALDconsult3-May-07 10:17
mvePIEBALDconsult3-May-07 10:17 
GeneralRe: Logging Class and Method where exception occurred. Pin
PIEBALDconsult3-May-07 11:39
mvePIEBALDconsult3-May-07 11:39 
C#
namespace Template
{
    public partial class Template
    {
        private static int
        div
        (
            int lhs
        ,
            int rhs
        )
        {
            return ( lhs / rhs ) ;
        }

        [System.STAThread]
        public static int
        Main
        (
            string[] args
        )
        {
            int result = 0 ;

            try
            {
                int x = int.Parse ( args [ 0 ] ) ;
                int y = int.Parse ( args [ 1 ] ) ;
                int z = div ( x , y ) ;
            }
            catch ( System.Exception err )
            {
                while ( err != null )
                {
                    string sep = " ( " ;
                    System.Reflection.MethodBase meth = 
                        new System.Diagnostics.StackTrace ( err ).GetFrames()[0].GetMethod() ;

                    System.Console.Write ( meth.DeclaringType.FullName + "." + meth.Name ) ;

                    foreach ( System.Reflection.ParameterInfo parm in meth.GetParameters() )
                    {
                        System.Console.Write ( sep ) ; 
                        
                        if ( parm.IsOut )
                        {
                            System.Console.Write ( "out" ) ;
                        }
                        
                        System.Console.Write ( parm.Name + " " + parm.ParameterType.Name ) ;
                        sep = " , " ;
                    }

                    System.Console.WriteLine ( " ) " + err.Message ) ;
                    
                    err = err.InnerException ;
                }
            }

            return ( result ) ;
        }
    }
}


C:\>err
Template.Template.Main ( args String[] ) Index was outside the bounds of the array.

C:\>err  jkfg
System.Number.StringToNumber ( str String , options NumberStyles , number NumberBuffer& , info NumberFormatInfo , parseDecimal Boolean ) Input string was not in a correct format.

C:\>err 1 jkfg
System.Number.StringToNumber ( str String , options NumberStyles , number NumberBuffer& , info NumberFormatInfo , parseDecimal Boolean ) Input string was not in a correct format.

C:\>err 1
Template.Template.Main ( args String[] ) Index was outside the bounds of the array.

C:\>err 1 jkfg
System.Number.StringToNumber ( str String , options NumberStyles , number NumberBuffer& , info NumberFormatInfo , parseDecimal Boolean ) Input string was not in a correct format.

C:\>err 1 5

C:\>err 1 0
Template.Template.div ( lhs Int32 , rhs Int32 ) Attempted to divide by zero.

C:\>err 1 0.0
System.Number.StringToNumber ( str String , options NumberStyles , number NumberBuffer& , info NumberFormatInfo , parseDecimal Boolean ) Input string was not in a correct format.

QuestionTextBox Pin
hardsoft30-Apr-07 9:07
hardsoft30-Apr-07 9:07 
AnswerRe: TextBox Pin
MoustafaS30-Apr-07 9:21
MoustafaS30-Apr-07 9:21 
Questiondll Pin
netJP12L30-Apr-07 8:08
netJP12L30-Apr-07 8:08 
AnswerRe: dll Pin
Christian Graus30-Apr-07 12:04
protectorChristian Graus30-Apr-07 12:04 
QuestionDataGridView Pin
Mohammed Elkholy30-Apr-07 7:34
Mohammed Elkholy30-Apr-07 7:34 
QuestionCreating classes that use the web / app.config for initialization Pin
Tristan Rhodes30-Apr-07 6:24
Tristan Rhodes30-Apr-07 6:24 
AnswerRe: Creating classes that use the web / app.config for initialization Pin
Pete O'Hanlon30-Apr-07 9:07
mvePete O'Hanlon30-Apr-07 9:07 
GeneralRe: Creating classes that use the web / app.config for initialization Pin
Tristan Rhodes1-May-07 3:14
Tristan Rhodes1-May-07 3:14 
Questiontcp/ip socket Pin
Harikrk30-Apr-07 5:48
Harikrk30-Apr-07 5:48 
AnswerRe: tcp/ip socket Pin
pbraun30-Apr-07 12:17
pbraun30-Apr-07 12:17 
QuestionCheckbox in Gridview Pin
Bubbles230-Apr-07 5:41
Bubbles230-Apr-07 5:41 
QuestionHow to communicate VisualStudio2005 with Microsoft Info Path Pin
pashitech30-Apr-07 4:24
pashitech30-Apr-07 4:24 
QuestionScreenshots with DirectX Pin
wimme30-Apr-07 4:09
wimme30-Apr-07 4:09 
Questioncollection Pin
arkiboys30-Apr-07 3:48
arkiboys30-Apr-07 3:48 
AnswerRe: collection Pin
Colin Angus Mackay30-Apr-07 3:58
Colin Angus Mackay30-Apr-07 3:58 
GeneralRe: collection Pin
arkiboys30-Apr-07 4:02
arkiboys30-Apr-07 4:02 
GeneralRe: collection Pin
Colin Angus Mackay30-Apr-07 4:39
Colin Angus Mackay30-Apr-07 4:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.