Posts

Showing posts with the label C#
Image upload in C#(windows application) In windows application file upload operation is not much easy just like web application.But we can implement this in windows application using other way.  Needed Controls : Openfiledialog,Button,TextBox Coding part : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace DemoWindowsApplication {     public partial class FileUpload : Form     {         public FileUpload()         {             InitializeComponent();         }         private void button1_Click(object sender, EventArgs e)         {             DialogResult result = openFileDialog1.Show...
Invoke Method From String [using Reflection] For Calling a function/method from a string we can use Reflection in C#. Wikipedia says that "In computer science, reflection is the process by which a computer program can observe and modify its own structure and behavior". This is exactly how Reflection in C# works. Uses of Reflection Reflection has the following uses: It allows view attribute information at runtime. It allows examining various types in an assembly and instantiate these types. It allows late binding to methods and properties It allows creating new types at runtime and then performs some tasks using those types.  A Sample code is given below: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; namespace InvokeMethodFromString {     class Program     {         static void Main( string [] args)    ...