Introduction to Break Points

The very first thing about debugging that you need to know, is the break point. It actually does exactly what the name implies - it marks a point in your code where the execution will take a break (and no, it won't actually break your code, don't worry). Placing a breakpoints in Visual Studio or one of the Express versions, is as simple as left-clicking in the gutter, which is the grey are to the left of your code. Once you click it, you will get a shiny, red circle as a reward - this circle marks where the debugger will halt when you execute your application. You better have a look for your self, and to see the effect, we will use the following piece of code: 

namespace DebugTest
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 5, b = 8, c = 233;
            int d = a + c - b;
            Console.WriteLine(d);
        }
    }
}

Now, can you predict the result just from looking at the code? Probably, and if not, you could just get out the old calculator and do the math, but that's not really the point. Just imagine the amount of code being much bigger, and let's debug the thing! Place a breakpoint by clicking in the left gutter - your IDE should now look something like this: 

Breakpoint 

Okay, you're ready to start your first debugging session. As soon as you have placed the breakpoint, you can just run your application like you normally would - from the menu, the toolbar or by pressing F5. What happens now is that the application is executed just like normal, but as soon as a line with a breakpoint is reached, the execution is stopped right before that line would be executed. In this case, it means that the variables a, b and c will have a value, but d will only have it's default value (which is 0 for an integer), since it won't be set before the line with the breakpoint has been evaluated. Now, here comes the cool part - try hovering your mouse over the different variables - the IDE will tell you what they contain. As mentioned, the d variable will have it's default value, but let's change that, by moving forward in the execution. In the next chapter, I will show you how to navigate around your code, while it's being executed.

C sharp Tweeter api call




Features

  1. Drag and drop image from any where.
  2. Auto attach  URL of your blog to your tweet image.

API Download : 

Before Creating your C# app you must know to create new app in Twitter Dev. the following link Contains only API Download and its documentation  Click Here 

Source Code 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Tweetinvi;
using Tweetinvi.Core.Interfaces;
using Tweetinvi.Core.Interfaces.Controllers;
using Tweetinvi.Core.Interfaces.DTO;
using Tweetinvi.Core.Interfaces.Factories;
using Tweetinvi.Core.Interfaces.Models;
namespace TwitterApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        protected bool validData;
        string path;
        protected Image image;
        protected Thread getImageThread;
      
        
        string AccessToken="Your_Access_token";
        string TokenSecret = "Your_Token_Secret";
        string ConsumerKey = "Your_Consumer_key";
        string ConsumerSecret ="Your_Consumer_Secret";
        
           
        private void Form1_Load(object sender, EventArgs e)
            
        {
            
           Tweetinvi.TwitterCredentials.SetCredentials(AccessToken,TokenSecret,ConsumerKey,ConsumerSecret);
        }


        private void Form1_DragDrop(object sender, DragEventArgs e)
        {
            if (validData)
            {
                while (getImageThread.IsAlive)
                {
                    Application.DoEvents();
                    Thread.Sleep(0);
                }
                pictureBox1.Image = image;
            
            }
        }
        protected void LoadImage()
        {
            image = new Bitmap(path);

        }



        private void Form1_DragEnter(object sender, DragEventArgs e)
        {
            string filename;
            validData = GetFilename(out filename, e);
            if (validData)
            {
                path = filename;
                getImageThread = new Thread(new ThreadStart(LoadImage));
                getImageThread.Start();
                e.Effect = DragDropEffects.Copy;
            }
            else
                e.Effect = DragDropEffects.None;
        }

        private bool GetFilename(out string filename, DragEventArgs e)
        {
            bool ret = false;
            filename = String.Empty;
            if ((e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy)
            {
                Array data = ((IDataObject)e.Data).GetData("FileDrop") as Array;
                if (data != null)
                {
                    if ((data.Length == 1) && (data.GetValue(0) is String))
                    {
                        filename = ((string[])data)[0];
                        string ext = Path.GetExtension(filename).ToLower();
                        if ((ext == ".jpg") || (ext == ".png") || (ext == ".bmp"))
                        {
                            ret = true;
                        }
                    }
                }
            }
            return ret;
        }

       
        private void TweetBtn_Click(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true && checkBox2.Checked==true)
            {

                string BlogUrl = "Click www.ziabse.blogspot.com For More...";

                byte[] file = File.ReadAllBytes(path);
                var tweet = Tweet.PublishTweetWithMedia(BlogUrl,file);
                var imageURL = tweet.Entities.Medias.First().MediaType;
                label1.Text = "Tweet Posted With Image :)";


            }

            else

                if (textBox1.Text != "")

                { 
                    Tweet.PublishTweet(textBox1.Text);
                    label1.Text = "    Tweet Posted :)";
                }

                else 
                    
                    label1.Text = "Tweet Can't Be Blank :D";
        }
    }
}

Sending SMS Via Windows Form Application Using any Android Smart Phone  Source Code  using System ; using System . C...