A Developer Journey who codes for fun

Daily Dose Of Code

  • Home
  • Dot.Net Basics
    • .Net Basics
      • CTS
      • CLS
      • CLR
      • Strong Vs Weak Ref
      • .Net Framework
      • What is Manifest
    • Memory Management
      • Garbage Collection 1
      • Garbage Collection 2
      • Circular Reference
  • C Sharp
    • Abstract Class in C#
    • Interfaces in C#
    • Value type by Val and By Ref
    • Var keyword
    • Null Coalescing Operator
    • Buit-in code snippets
  • OOPS
    • Abstraction and Encapsulation
    • Polymorphism
    • Inheritence
    • Aggregation
  • Threading
    • Delegates
      • Calling Delegate using Invoke, BeginInvoke
      • Multicast Delegate
      • Exception Handling in Multicast Delegate
      • Action
      • Predicate
      • Func
    • Synchronization
    • Thread Pool
    • Exception Handling
    • TPL
  • Design Pattern
    • Creational Patterns
      • Singleton Pattern
      • Factory Pattern
      • Abstract Factory Pattern
      • Prototype Pattern
      • Builder Pattern
    • Structural Patterns
      • Adapter Pattern
      • Bridge Pattern
      • Composite Pattern
      • Proxy Pattern
      • Facade Pattern
      • Decorator Pattern
      • Flyweight Pattern
    • Behavioral Patterns
      • Command Pattern
      • Interpreter Pattern
      • Iterator Pattern
      • Mediator Pattern
      • Memento Pattern
      • Observer Pattern
      • State Pattern
      • Strategy Pattern
      • Visitor Pattern
      • Chain Of Responsibility Pattern
      • Template Pattern
  • Data Structures
    • Generic List in C#
    • 2d array to 1d array
    • 3d arrayto 1d array
    • Linked List
      • Singly Linked List in C#
    • Queue
      • Dummy Data 1
    • Stack
      • Dummy Data 2
    • Tree
      • Dummy Data 3
    • Graph
      • Dummy Data 4
  • WCF
    • WCF Service using VS 2015
  • Scripts
    • Chrome Extensions
      • Create a Chrome Extension
      • Facebook autologout script
      • Gmail autologout script

Differences between Connected and disconnected architecture ?

 Unknown     1:52 AM     1 comment   

Hii friends,Today one of my frend ask about what approach is better connected or disconnected architecture ..So let me explain more about this problem :-As the nature of HTTP protocol,.Net web applications are always disconnected so your problem is about connected or disconnected data models."connected" data is always faster as compare to "disconnected"...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

What do you meant by Containment in C#?

 Unknown     8:04 AM     No comments   

Containment is the replacement of inheritence,no no if inheritance isn’t the right choice,then the answer is containment, also known as aggregation. Rather than saying that an object is an example of another object, an instance of that other object will be contained inside the object. So,instead of having a class look like a string, the class will...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to handle generic errors in WinApp using C# ?

 Unknown     7:39 AM     No comments   

Pass your exception or error through catch block to this method this will catch your error and show the messagebox regarding that error.Method which take error exception as a parameter and handle that error.public static void LogError(Exception ex){string sourceName = "Application Name";int errorCode = "99";string message = "The application encountered...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

What is interface and why we implement interfaces ?

 Unknown     7:02 AM     No comments   

Interface defined by using interface keyword .In visualstudio you can directly add class as a interface its not a class it behaves as a template of the class. Interfaces describe a group of related functionalities that can belong to any class or struct.Interfaces are provided in C# as a replacement of multiple inheritance because C# does not support...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to combine two images into one image in C#?

 Unknown     7:26 AM     No comments   

using System.Drawing;public static System.Drawing.Bitmap Combine(string[] files){ Create a list for images and read images List images = new List(); Bitmap finalImage = null; try { int width = 0; int height = 0; foreach (string image in files) { create a Bitmap from the file and add it to the list. Bitmap bitmap = new...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Location of opening of dialog boxes(window form) in C#

 Unknown     10:26 PM     2 comments   

In my application i used some dialog boxes like about of company some customize message boxes and all that in some dialog boxes I used start position as Center parent but i forget to pass the IWin32Window Owner in show dialog as a parameter regarding that when focus is lost from my application then dialog took desktop as a parent and opens in different...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to set image resolution and paint it in C# ?

 Unknown     5:01 AM     No comments   

using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Drawing.Imaging; public class Form1 : System.Windows.Forms.Form { Constructor. public Form1() { InitializeComponent(); } Initialize all the...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

More Regular Expressions

 Unknown     11:27 PM     No comments   

To validate a URL with a regular expression :-(http://|ftp://)([\w-\.)(\.)([a-zA-Z...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

C# Tutorial (Chapter - 1) Introduction about C# and .Net framework(1 :- .Net Plateform)

 Unknown     3:28 AM     No comments   

I :-.Net Plateform :-The Microsoft® .NET platform provides all of the tools and technologies thatyou need to build distributed Web applications. It exposes a languageindependent,consistent programming model across all tiers of an applicationwhile providing seamless interoperability with, and easy migration from,existing technologies. The .NET platform...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

C# Tutorials

 Unknown     3:19 AM     No comments   

Hello to all, My next thread is about C#,In my next thread i will divide the C# thread into chapters each chapter will contain all the details about C# and .Net framework its a step by step process so go through to all the thread and please post a comment or email me at saurabhjnumca@gmail.com about this thread please give critics about this thread.If...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to create a session manager in .Net ?

 Unknown     7:51 AM     No comments   

To create a SessionManager to save User objects in memory. It would be HashMap of HaspMaps.It can be used as:SessionManager MySessionManager= New SessionManager()Student S1 = New Student ("Saurabh");Student S2 = New Student ("Sandeep");Student S3 = New Student ("Deepak");//To create sessionMySessionManager.createSession(S1);MySessionManager.createSession(S2);//SAVING...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Tech-Giant(Jargons.. for Professionals): How to take Screenshot of panel,control and save it in a JPG format ?

 Unknown     6:58 AM     No comments   

Tech-Giant(Jargons.. for Professionals): How to take Screenshot of panel,control and save it in a JPG format...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to take Screenshot of panel,control and save it in a JPG format ?

 Unknown     6:17 AM     No comments   

You can create a bitmap of screen and then save it give the stream or fileName and then dispose the object of screenshot.Bitmap theScreenShot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);theScreenShot.Save(stream_or_filename, ImageFormat.Jpeg);theScreenShot.Dispose();Another way to...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Order of Event firing in ASP.Net

 Unknown     3:13 AM     1 comment   

Event firing order becomes critically important when you add event handling code to master pages and the content forms based on them. The following events occur when ASP.NET renders a page. I’ve listed these events in the order in which they occur.1 :-Content Page Pre Initializes2 :-Master Page Child Controls Initialize3 :-Content Page Child Controls...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Lambda Expressions in C#

 Unknown     2:49 AM     No comments   

Lambda expressions makes the searching life much easier.Have a look on this example :-public class TestLambdaProgram{ public static void Main( string[] args ) { List names = new List(); names.Add(“Saurabh”); names.Add("Garima"); names.Add(“Vivek”); names.Add(“Sandeep”); string stringResult = names.Find( name =>...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Basics of .Net (What is IL,CLR,CTS,CLS ?)

 Unknown     6:23 AM     3 comments   

1: IL(Intermediate Language) :-(IL)Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code is compiled to IL. This IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler. Microsoft Intermediate...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

What are different types of JIT ?

 Unknown     1:42 AM     No comments   

In .net there are three type of JIT.JIT compiler is a part of the runtime execution environment.Three JIT are following :-Pre-JIT :- Pre-JIT compiles complete source code into native code in a single compilation cycle. This is done at the time of deployment of the application.Econo-JIT :- Econo-JIT compiles only those methods that are called at runtime....
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

What is Manifest in .net ?

 Unknown     1:24 AM     No comments   

An assembly manifest contains all the metadata.It means Assembly metadata is stored in Manifest and it needed to specify the assembly's version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes.Some points are given please go through it :-1:- The assembly...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to view a Assembly of your code (What is ILDASM ?)

 Unknown     1:36 AM     No comments   

When it comes to understanding of internals nothing can beat ILDASM. ILDASM basically converts the whole exe or dll in to IL code. To run ILDASM you have to go to "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin". Note that i had v2.0...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to copy the text from label in window form at run time ?

 Unknown     11:42 PM     No comments   

Designer view:#region DesignerViewCreate a context menu strip :this.copyPathMenuItem = new System.Windows.Forms.ToolStripMenuItem();this.labelContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {this.copyPathMenuItem});this.labelContextMenuStrip.Name = "labelContextMenuStrip";this.labelContextMenuStrip.Size = new System.Drawing.Size(100,...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How can I change the Border color of my control ?

 Unknown     6:40 AM     No comments   

public class MyButton : Button { protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); int borderWidth = 1; Color borderColor = Color.Blue; ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, borderColor, borderWidth, ButtonBorderStyle.Solid, borderColor, borderWidth, ButtonBorderStyle.Solid,...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to change the color of Tab Control in c#

 Unknown     1:49 AM     No comments   

Steps :-1. Set the TabControl's DrawMode to OwnerDraw.2. Handle the DrawItem event.private void ChangeColorOFTabControl(object sender, DrawItemEventArgs e){Font TabFont;Brush BackBrush = new SolidBrush(Color.Green); //Set background colorBrush ForeBrush = new SolidBrush(Color.Yellow);//Set foreground colorif (e.Index == this.tabControl1.SelectedIndex){TabFont...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to set dropdown width according to longest string in C#

 Unknown     11:24 PM     No comments   

If you are using window control then use this method.private void AdjustWidthComboBox_DropDown(object sender, System.EventArgs e){ ComboBox senderComboBox = (ComboBox)sender; int width = senderComboBox.DropDownWidth; Graphics g = senderComboBox.CreateGraphics(); Font font = senderComboBox.Font; int vertScrollBarWidth = (senderComboBox.Items.Count>senderComboBox.MaxDropDownItems)...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to get the file size like windows file property control ?

 Unknown     7:43 AM     No comments   

//Create an object of FileInfo like :- FileInfo fileObject = new FileInfo(selectedFilename);Int64 fileSize = 0;float sizeOfFile = 0fileSize = fileObject.Length;sizeOfFile = fileObject.Length;private const int FILESIZE_IN_KB = 1024;public const int FILESIZE_IN_MB = 1048576;public const int FILESIZE_IN_GB = 1073741824;public const long FILESIZE_IN_TB...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Sort ListView on column click (like windows folder detail view in xp)

 Unknown     6:22 AM     No comments   

Step :1 Firstly Create the object of listviewcolumn sorter class.private ListViewColumnSorter listviewColumnSorter=new ListViewColumnSorter();Step :2 Set ListViewItemSorter property of listViewlistView.ListViewItemSorter = listviewColumnSorter;Handles...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Get AssociatedFileTypes (.txt = TextDocument)

 Unknown     5:07 AM     No comments   

/// /// Get File Type for given file./// /// Pass the path of file/// This method returns Associated file type like :-.pdf = Adobe Acrobat Document.txt = Text Documentprivate string GetAssociatedFileType(string filePath){ private const string STRING_SPACE = " "; string extension = string.Empty; if (!string.IsNullOrEmpty(filePath))...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

File System Watcher in C#(Get notified after any modification)

 Unknown     7:26 AM     No comments   

Drag FileSystemWatcher control in your form from toolbox and add the events for created,deletion and renaming.Ex:-#region Designer viewthis.fileSystemWatcher.EnableRaisingEvents = true;this.fileSystemWatcher.IncludeSubdirectories = true;this.fileSystemWatcher.SynchronizingObject = this;this.fileSystemWatcher.Created += new System.IO.FileSystemEventHandler(this.fileSystemWatcher_Created);this.fileSystemWatcher.Deleted...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

String Functionality of C# (Play with strings)

 Unknown     7:01 AM     No comments   

1:- Convert string to LowerCase public static String Lower(String constantString) { return constantString.ToLower(); }2:-Convert String to UpperCase public static String Upper(String constantString) { return constantString.ToUpper(); }3:- Convert String to proper case public static String PCase(String constantString) { String strProper=constantString.Substring(0,1).ToUpper();...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Create customize OpenFileDialogBox and SaveFileDialogBox using shell

 Unknown     3:31 AM     No comments   

The Open dialog box lets the user specify the drive, directory, and the name of a file or set of files to open.The Save As dialog box lets the user specify the drive, directory, and name of a file to save. Explorer-style Open and Save As dialog...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Get CSIDL Code (System Index of Directories)

 Unknown     3:01 AM     No comments   

const int CSIDL_DESKTOP = 0x0000; // const int CSIDL_INTERNET = 0x0001; // Internet Explorer (icon on desktop)const int CSIDL_PROGRAMS = 0x0002; // Start Menu\Programsconst int CSIDL_CONTROLS = 0x0003; // My Computer\Control Panelconst int CSIDL_PRINTERS...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Get Information about Operating-System(Like its an English operating system or German operating system)

 Unknown     2:50 AM     No comments   

/// /// Get the operating system language./// public static void GetOperatingSystemLanguage(){ ManagementObjectSearcher objectSearcher = new ManagementObjectSearcher("SELECT * FROM " + "Win32_OperatingSystem"); int languageCode = 0; foreach (ManagementObject managementObject in objectSearcher.Get()) { //Create the obect of...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

About The Author

Unknown
View my complete profile

Total Pageviews

Popular Posts

  • Clr - Common Language Runtime
    .Net framework provides a run time environment - CLR. Common language runtime takes the IL code from the compiler( language specific) and p...
  • Auto logout chrome extension for Gmail
    Hello Friends, In the last article we learned to create a sample chrome extension. Here we are going to create auto logout Gmail script as...
  • Predicate delegate in C#
    Hello Everyone, In the article we will talk about Predicate delegate. Predicate is also a delegate which encapsulate a method that takes...
  • .Net Framework overview
    Hello friends : Here i am writing my first article on .Net framework anyways....So the question is What is .Net Framework ? The .Net fram...
  • Nagarro Placement Papers..
    Ques.1 :- Seat Reservation prog for the theatre. Write a function for seat allocation for the movie tickets. Total no of seats available are...
  • Calling the Delegates using Invoke(), BeginInvoke() and DynamicInvoke() ?
    Hello Guys, So in the last article we talked about What is delegate and how can we create a delegate. In this article we will discuss w...
  • What does it mean by disconnected data access architecture of ADO.Net?
    ADO.Net introduces the concept of disconnected data architecture. In traditional data access components, you make a connection to the databa...
  • C code to Check the string has valid identifier or not in.
    #include #include #include char keyword[][10]={"auto","break","case","char","const","...
  • Garbage Collection - Automatic Memory Management Part II
    Welcome friends in the second article of Garbage Collection. Those who have missed the first one can visit here . So in this article i will...
  • Delegates in C Sharp
    A Delegate is a type variable that holds the reference to a method. Delegates are similar to Pointer to functions in C and C++ When we...

Blog Archive

  • ►  2016 (4)
    • ►  September (2)
      • ►  Sep 03 (2)
    • ►  August (1)
      • ►  Aug 28 (1)
    • ►  April (1)
      • ►  Apr 24 (1)
  • ►  2015 (12)
    • ►  September (10)
      • ►  Sep 30 (1)
      • ►  Sep 29 (1)
      • ►  Sep 28 (1)
      • ►  Sep 27 (2)
      • ►  Sep 26 (3)
      • ►  Sep 20 (1)
      • ►  Sep 19 (1)
    • ►  August (1)
      • ►  Aug 16 (1)
    • ►  March (1)
      • ►  Mar 31 (1)
  • ►  2013 (10)
    • ►  June (1)
      • ►  Jun 16 (1)
    • ►  April (1)
      • ►  Apr 21 (1)
    • ►  February (8)
      • ►  Feb 18 (3)
      • ►  Feb 17 (2)
      • ►  Feb 16 (2)
      • ►  Feb 15 (1)
  • ►  2012 (1)
    • ►  May (1)
      • ►  May 27 (1)
  • ►  2010 (22)
    • ►  October (14)
      • ►  Oct 21 (1)
      • ►  Oct 06 (12)
      • ►  Oct 04 (1)
    • ►  April (2)
      • ►  Apr 22 (1)
      • ►  Apr 16 (1)
    • ►  March (1)
      • ►  Mar 30 (1)
    • ►  January (5)
      • ►  Jan 08 (3)
      • ►  Jan 01 (2)
  • ▼  2009 (110)
    • ►  December (8)
      • ►  Dec 18 (2)
      • ►  Dec 05 (1)
      • ►  Dec 04 (5)
    • ►  November (1)
      • ►  Nov 27 (1)
    • ►  October (14)
      • ►  Oct 09 (4)
      • ►  Oct 07 (1)
      • ►  Oct 06 (3)
      • ►  Oct 05 (3)
      • ►  Oct 01 (3)
    • ►  September (17)
      • ►  Sep 30 (1)
      • ►  Sep 29 (1)
      • ►  Sep 28 (1)
      • ►  Sep 25 (1)
      • ►  Sep 24 (1)
      • ►  Sep 17 (2)
      • ►  Sep 15 (3)
      • ►  Sep 11 (2)
      • ►  Sep 09 (3)
      • ►  Sep 08 (2)
    • ▼  August (31)
      • ▼  Aug 31 (1)
        • Differences between Connected and disconnected arc...
      • ►  Aug 27 (3)
        • What do you meant by Containment in C#?
        • How to handle generic errors in WinApp using C# ?
        • What is interface and why we implement interfaces ?
      • ►  Aug 26 (1)
        • How to combine two images into one image in C#?
      • ►  Aug 25 (2)
        • Location of opening of dialog boxes(window form) i...
        • How to set image resolution and paint it in C# ?
      • ►  Aug 24 (1)
        • More Regular Expressions
      • ►  Aug 22 (2)
        • C# Tutorial (Chapter - 1) Introduction about C# an...
        • C# Tutorials
      • ►  Aug 21 (3)
        • How to create a session manager in .Net ?
        • Tech-Giant(Jargons.. for Professionals): How to ta...
        • How to take Screenshot of panel,control and save i...
      • ►  Aug 20 (2)
        • Order of Event firing in ASP.Net
        • Lambda Expressions in C#
      • ►  Aug 19 (3)
        • Basics of .Net (What is IL,CLR,CTS,CLS ?)
        • What are different types of JIT ?
        • What is Manifest in .net ?
      • ►  Aug 18 (1)
        • How to view a Assembly of your code (What is ILDAS...
      • ►  Aug 16 (1)
        • How to copy the text from label in window form at ...
      • ►  Aug 12 (2)
        • How can I change the Border color of my control ?
        • How to change the color of Tab Control in c#
      • ►  Aug 11 (1)
        • How to set dropdown width according to longest str...
      • ►  Aug 10 (3)
        • How to get the file size like windows file propert...
        • Sort ListView on column click (like windows folder...
        • Get AssociatedFileTypes (.txt = TextDocument)
      • ►  Aug 07 (4)
        • File System Watcher in C#(Get notified after any m...
        • String Functionality of C# (Play with strings)
        • Create customize OpenFileDialogBox and SaveFileDia...
        • Get CSIDL Code (System Index of Directories)
      • ►  Aug 06 (1)
        • Get Information about Operating-System(Like its an...
    • ►  July (24)
      • ►  Jul 25 (4)
      • ►  Jul 24 (20)
    • ►  April (15)
      • ►  Apr 10 (3)
      • ►  Apr 07 (9)
      • ►  Apr 06 (3)

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments
copyright @ TechGiant 2015. Powered by Blogger.

Disclaimer

This is my personal blog and i write articles on .Net, WPF, C#, OOPS, Threading and other .Net technologies. This is not related to any of my employer and organizations. This is the result of my personal interest.

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Followers

Copyright © 2025 A Developer Journey who codes for fun | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com