• Home
  • About
  • BestBloggingIdeas
  • DotNetLearningSource
  • FORUM
  • Joblinks
  • Latest News
  • Policy
  • POSTS
  • SimplySqlServer.Com && SimplyAspDotNet.Com
  • Sitemap

Join Ours Forum

Asp.Net,C#,Ajax,Sql server,silverlight,Javascript codes exambles articles,Programming exambles

RSS Feed
  • Bounty Huge Roll [Amazon Frustration-Free Packaging]
  • XML Introduction to XML VHS Video Training, 1 hr., 32 minutes.
  • The Basic Overview of Windows Mobile Development Asp.Net C#
  • Overview of Sql server extended properties Asp.Net C#
  • How to Use Sql Server Extended properties using visual studio Asp.Net C#
  • Adobe Dreamweaver Templates Accelerate Web Development
  • Top Tips for Web Design Projects
  • How to Achieve a Good Web Design Structure
  • To Use Or Not To Use Website Templates
  • Five Tips to a Successful Website
  • Top 10 Articles,


    Silverlight Datagrid Select Update Delete Insert Asp.Net C#

    Differences Similarities Benefits Between Typed Datasets and Untyped Datasets asp.net c#

    Linq to Sql Introduction Entities Ado.Net C# SqlClasses Attributes Linq Mapping

    Linq Programming/How Linq Works?/Linq Implementation In Asp.Net C# Ado.Net

    Performing Developing Using Investigating Asp.Net 2.0 Ajax Application Development Asp.Net C#

    Hosting/Install Wcf Services in a Windows Service Asp.Net C#

    Connecting Silverlight to Wcf Asp.Net C#

    Silverlight Data Grid Data Binding WCF Asp.Net C#

    Invoking/Accessing/Calling WCF Service Without Adding/Creating Proxy/Reference Asp.Net C#

    Performing Doing Creating Insert Update Delete sql data Using Linq Database Asp.Net C#

    Copying Transfering Files From Local Machine to ftp Server Using Asp.Net/C#

    Posted by on March 28, 2010 Leave a comment (4) Go to comments

    Introduction:
    In this article,i am going to explain about how to copying/Transfering files from local machine to netftp server.

    Main:

    Sample Code,

           string netftpUserID1 = "";//netftp UserId
           string netftpPassword1=""//netftp password
           FileInfo fileInf = new FileInfo(C:\Sample.txt);
           string uri = "ftp://" + netftp.netprogramminghelp.com + "/" + fileInf.Name;
           netftpWebRequest reqnetftp;
           // Create netftpWebRequest object from the Uri provided
           reqnetftp = (netftpWebRequest)netftpWebRequest.Create
           (new Uri("netftp://" + netftp.netprogramminghelp.com + "/" + fileInf.Name));
           // Provide the WebPermission Credintials 
           reqnetftp.Credentials = new NetworkCredential(netftpUserID1, netftpPassword1);
           // By default KeepAlive is true, where the control connection
           // is not closed after a command is executed. 
           reqnetftp.KeepAlive = false;
           // Specify the command to be executed. 
           reqnetftp.Method = WebRequestMethods.netftp.UploadFile;
           // Specify the data transfer type. 
           reqnetftp.UseBinary = true;
           // Notify the server about the size of the uploaded file
           reqnetftp.ContentLength = fileInf.Length;
           int buffLength = 500447300;
           byte[] buff = new byte[buffLength];
     
           int contentLen;
           // Opens a file stream (System.IO.FileStream) to read the file
           // to be uploaded 
           FileStream fs = fileInf.OpenRead();
           try
           {
               // Stream to which the file to be upload is written 
               Stream strm = reqnetftp.GetRequestStream();
               // Read from the file stream 2kb at a time
               contentLen = fs.Read(buff, 0, buffLength);
               // Till Stream content endswhile (contentLen != 0) 
               {
     
                   // Write Content from the file stream to the netftp Upload
                   // Stream
     
                   strm.Write(buff, 0, contentLen);
                   contentLen = fs.Read(buff, 0, buffLength);
               }
     
               strm.Close();
               fs.Close();
     
           }
           catch (Exception ex)
           {
     
               throw new Exception(ex.Message);
           }

    Conclusion:
    Hope this helps,
    Happy Coding.

    ASP.NET
    ← How to Create/Add tooltip in Gridview Using Asp.Net/c#/JavaScript
    Looping Through XML Document And Print/Retrieve XML Node values using ASP.NET/C#/XML LINQ →

    Learn Easily Using Video Tutorials


    How to choose the right Java IDE – explained Eclipse NetBeans BlueJ

    Developing/Creating/Performing/Configuring Java Applications Using Eclipse IDE

    Step By Step Guide for Download/Install Configure Eclipse IDE for Java

    Editing data with the GridView control Asp.Net C#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Best way to prepare asp.net Interview - Success Stories

    Download Important Questions and PPT's:

    Sql Server Important Questions Online free download

    Dotnet Important Questions Online free download

    Exploring Linq to Sql Process Flow

    Learn how to perform silverlight programming

    Learn OOPs concepts in better and well manner

    Learn Ajax in better and well manner

    Leave a comment

    4 Comments.

    1. medical assistant April 6, 2010 at 6:08 pm

      Great site. A lot of useful information here. I’m sending it to some friends!

    2. Ty Risse June 14, 2010 at 11:47 am

      Aamazing, just purely amazing performance

    3. Eunice Wootton June 30, 2010 at 5:28 pm

      Hi, I do not usually post feedback on blogs, as I prefer to learn only. But I find the article that you have written earlier has very insightful data, and I find it very informational. Anyway, I am questioning whether or not you might be open for hyperlink trade, as I hope that we are able to agree on a mutual link change agreement. Hope to hear a optimistic reply from you, and have a fantastic day!

    4. Nellie Mulholland August 3, 2010 at 3:43 pm

      I randomly browse blogs on the internet, and I discover your article to be very informational. I’ve already bookmark it on my browser, so that I can view your blog publish once more later. Additionally, I am questioning whether or not your blog is open for link exchange, as I actually wish to trade hyperlinks with you. I do not normally do this, but I hope that we can have a mutual hyperlink exchange. Let me know and have an important day!

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    *

    *


    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Enter your email address:

    Delivered by FeedBurner

    • Recent Posts

      • Bounty Huge Roll [Amazon Frustration-Free Packaging]
      • XML Introduction to XML VHS Video Training, 1 hr., 32 minutes.
      • The Basic Overview of Windows Mobile Development Asp.Net C#
      • Overview of Sql server extended properties Asp.Net C#
      • How to Use Sql Server Extended properties using visual studio Asp.Net C#
    • Search by Tags!

      Application AspNet Basic between Black Bluetooth Build Business Collection Consultants Design Development Downloading effective Excel Experts Generics Implement Installing Interview Logic Management Microsoft Minutes Object Outlook Professional Programmer Programming Project Projects Questions Ready Select Server Services Silverlight Source Strings Studio Through using Visual Website Wordpress
    • Archives

      • August 2011
      • June 2011
      • May 2011
      • April 2011
      • March 2011
      • February 2011
      • December 2010
      • November 2010
      • October 2010
      • September 2010
      • August 2010
      • July 2010
      • June 2010
      • May 2010
      • April 2010
      • March 2010
      • February 2010
      • January 2010
      • December 2009
      • November 2009
      • October 2009
      • September 2009

    Copyright © 2012 NetProgrammingHelp.com

    Δ Top