Category: .Net Programming

Code Sample to Upload file to FTP Server

Visit: https://zonixsoft.com check out below code to upload file to FTP Server:   /// <summary> /// Code to upload file to FTP Server /// </summary> /// <param name=”strFilePath”>Complete physical path of the file to be uploaded</param> /// <param name=”strFTPPath”>FTP Path</param> /// <param name=”strUserName”>FTP User account name</param> /// <param name=”strPassword”>FTP User password</param> /// <returns>Boolean value based […]

Code Sample to Upload file to FTP Server

Visit: https://zonixsoft.com check out below code to upload file to FTP Server:   /// <summary> /// Code to upload file to FTP Server /// </summary> /// <param name=”strFilePath”>Complete physical path of the file to be uploaded</param> /// <param name=”strFTPPath”>FTP Path</param> /// <param name=”strUserName”>FTP User account name</param> /// <param name=”strPassword”>FTP User password</param> /// <returns>Boolean value based […]

Icon in the Address bar Textbox in Browsers

Visit: https://zonixsoft.com (Short Cut) Icon in the Address bar Textbox in Browsers You have to insert this line after the <head> tag in your html / ASPX / Master Page. <link rel=”shortcut icon” href=”images/MyComp.ico”> Make sure the image is file type .ico (for icon). Also, after inserting this line, the image may not appear immediately. […]

Convert Date Formats :

  //For ex., Convert MM/dd/YYYY to dd/MM/yyyy string date = “03/27/2008”; //format is MM/dd/yyyy DateTimeFormatInfo dateTimeFormatterProvider = DateTimeFormatInfo.CurrentInfo.Clone() as DateTimeFormatInfo; dateTimeFormatterProvider.ShortDatePattern = “MM/dd/yyyy”; //source date format DateTime dateTime = DateTime.Parse(date, dateTimeFormatterProvider); string formatted = dateTime.ToString(“dd/MM/yyyy”); //write the format in which you want the date tobe converted Response.Write(“<br />” + formatted);

Convert Date Formats :

  //For ex., Convert MM/dd/YYYY to dd/MM/yyyy string date = “03/27/2008”; //format is MM/dd/yyyy DateTimeFormatInfo dateTimeFormatterProvider = DateTimeFormatInfo.CurrentInfo.Clone() as DateTimeFormatInfo; dateTimeFormatterProvider.ShortDatePattern = “MM/dd/yyyy”; //source date format DateTime dateTime = DateTime.Parse(date, dateTimeFormatterProvider); string formatted = dateTime.ToString(“dd/MM/yyyy”); //write the format in which you want the date tobe converted Response.Write(“<br />” + formatted);

Customizing the Map using Google Maps API

Get ready to code! In this section, we’ll be making changes and additions to the map HTML file to customize the map based on your preferences.   1.    Open your myapp.html file. 2.    Add the code to center the map at particular the latitude/longitude .The line that centers the map in the current code is: […]

Maintaining Fck editor value during postbacks

Here is the code to maintain value of FckEditor value during postbacks,   Write in Page_Load event,   Page.ClientScript.RegisterOnSubmitStatement( fckContentPage.GetType(), “fckContentPage”, “FCKeditorAPI.GetInstance(‘” + fckContentPage.ClientID + “‘).UpdateLinkedField();”);   Here fckContentPage is ID of FckEditor

Boxing and UnBoxing

    Boxing and unboxing enable value types to be treated as objects. Boxing a value type packages it inside an instance of the Object reference type. This allows the value type to be stored on the garbage collected heap. Unboxing extracts the value type from the object. In this example, the integer variable i is […]

Boxing and UnBoxing

    Boxing and unboxing enable value types to be treated as objects. Boxing a value type packages it inside an instance of the Object reference type. This allows the value type to be stored on the garbage collected heap. Unboxing extracts the value type from the object. In this example, the integer variable i is […]

SMS service to send Message to a URL

Here is the sample code for same , I used it for implementing SMS service in project that sends message to particular URL which in turn sends SMS to particualr phone number, using System.Net; using System.Xml; XmlDocument xDoc = new XmlDocument(); //xDoc = ; //some xml data Byte[] outputbyte; string sXML = “”; string strResult […]