Click here to Skip to main content
15,893,487 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to determine if two C# exe come from the same source Pin
PIEBALDconsult14-Jan-09 16:57
mvePIEBALDconsult14-Jan-09 16:57 
AnswerRe: How to determine if two C# exe come from the same source Pin
Daniel Grunwald14-Jan-09 12:48
Daniel Grunwald14-Jan-09 12:48 
AnswerRe: How to determine if two C# exe come from the same source Pin
Henry Minute14-Jan-09 13:31
Henry Minute14-Jan-09 13:31 
Questionmultiple icons in exe with alpha Pin
Xmen Real 14-Jan-09 5:59
professional Xmen Real 14-Jan-09 5:59 
QuestionProblem transferring file with FTP using Socket Pin
Member 321680814-Jan-09 5:50
Member 321680814-Jan-09 5:50 
AnswerRe: Problem transferring file with FTP using Socket Pin
Mark Salsbery14-Jan-09 13:35
Mark Salsbery14-Jan-09 13:35 
GeneralRe: Problem transferring file with FTP using Socket Pin
Member 321680815-Jan-09 2:41
Member 321680815-Jan-09 2:41 
AnswerRe: Problem transferring file with FTP using Socket Pin
Bharat Jain29-Jan-09 19:47
Bharat Jain29-Jan-09 19:47 
Hi,
I there any special reason to use socket?? , i am just asking this question because in .net there are better way of transferring data using ftp , one of those method is to use 'FtpWebRequest' class , which is inbuilt in .net (under the namespace System.Net), following is the code you may use to send a file to an FTP server

using System;
using System.IO;
using System.Net;
using System.Text;

namespace Examples.System.Net
{
    public class WebRequestGetExample
    {
        public static void Main ()
        {
            // Get the object used to communicate with the server.
            FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://www.yourFtpLocation.com");
            request.Method = WebRequestMethods.Ftp.UploadFile;

            // This example assumes the FTP site uses anonymous logon.
            request.Credentials = new NetworkCredential ("username","Password");
            
            // Copy the contents of the file to the request stream.
            StreamReader sourceStream = new StreamReader("FileYouWantToUpload.txt");
            byte [] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
            sourceStream.Close();
            request.ContentLength = fileContents.Length;

            Stream requestStream = request.GetRequestStream();
            requestStream.Write(fileContents, 0, fileContents.Length);
            requestStream.Close();

            FtpWebResponse response = (FtpWebResponse)request.GetResponse();
    
            Console.WriteLine("Upload File Complete, status {0}", response.StatusDescription);
    
            response.Close();
            }
        }
    }
}



I hope this helps Smile | :)

-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com

QuestionSend UDP string via proxy [modified] Pin
s.sala14-Jan-09 4:05
s.sala14-Jan-09 4:05 
AnswerRe: Send UDP string via proxy Pin
Bharat Jain14-Jan-09 4:27
Bharat Jain14-Jan-09 4:27 
GeneralRe: Send UDP string via proxy Pin
s.sala14-Jan-09 4:59
s.sala14-Jan-09 4:59 
GeneralRe: Send UDP string via proxy Pin
Bharat Jain29-Jan-09 19:27
Bharat Jain29-Jan-09 19:27 
QuestionGetting column value from binding Pin
kanchoette14-Jan-09 4:00
kanchoette14-Jan-09 4:00 
AnswerRe: Getting column value from binding Pin
moon_stick14-Jan-09 4:15
moon_stick14-Jan-09 4:15 
GeneralRe: Getting column value from binding Pin
kanchoette14-Jan-09 21:30
kanchoette14-Jan-09 21:30 
GeneralRe: Getting column value from binding Pin
moon_stick14-Jan-09 21:57
moon_stick14-Jan-09 21:57 
GeneralRe: Getting column value from binding Pin
kanchoette14-Jan-09 22:09
kanchoette14-Jan-09 22:09 
GeneralRe: Getting column value from binding Pin
moon_stick14-Jan-09 22:45
moon_stick14-Jan-09 22:45 
AnswerRe: Getting column value from binding Pin
moon_stick14-Jan-09 22:51
moon_stick14-Jan-09 22:51 
GeneralRe: Getting column value from binding Pin
kanchoette14-Jan-09 23:39
kanchoette14-Jan-09 23:39 
GeneralRe: Getting column value from binding Pin
moon_stick14-Jan-09 23:49
moon_stick14-Jan-09 23:49 
GeneralRe: Getting column value from binding Pin
kanchoette14-Jan-09 23:55
kanchoette14-Jan-09 23:55 
QuestionHow to contact with file in C#? Pin
thuonghasm14-Jan-09 3:22
thuonghasm14-Jan-09 3:22 
AnswerRe: How to contact with file in C#? Pin
Le centriste14-Jan-09 3:27
Le centriste14-Jan-09 3:27 
AnswerRe: How to contact with file in C#? Pin
musefan14-Jan-09 3:33
musefan14-Jan-09 3:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.