Click here to Skip to main content
15,907,396 members
Home / Discussions / C#
   

C#

 
AnswerRe: Telephone answering mechine service c# Pin
gisa shel riki14-Jan-09 22:08
gisa shel riki14-Jan-09 22:08 
QuestionHow to determine if two C# exe come from the same source Pin
cwster14-Jan-09 8:03
cwster14-Jan-09 8:03 
AnswerRe: How to determine if two C# exe come from the same source Pin
Scott Dorman14-Jan-09 9:00
professionalScott Dorman14-Jan-09 9:00 
GeneralRe: How to determine if two C# exe come from the same source Pin
cwster14-Jan-09 9:39
cwster14-Jan-09 9:39 
GeneralRe: How to determine if two C# exe come from the same source Pin
Scott Dorman14-Jan-09 9:43
professionalScott Dorman14-Jan-09 9:43 
GeneralRe: How to determine if two C# exe come from the same source Pin
cwster14-Jan-09 9:54
cwster14-Jan-09 9:54 
GeneralRe: How to determine if two C# exe come from the same source Pin
Scott Dorman14-Jan-09 9:57
professionalScott Dorman14-Jan-09 9:57 
GeneralRe: How to determine if two C# exe come from the same source Pin
Dave Kreskowiak14-Jan-09 10:35
mveDave Kreskowiak14-Jan-09 10:35 
AnswerRe: How to determine if two C# exe come from the same source [modified] Pin
Luc Pattyn14-Jan-09 9:07
sitebuilderLuc Pattyn14-Jan-09 9:07 
GeneralRe: How to determine if two C# exe come from the same source Pin
cwster14-Jan-09 9:46
cwster14-Jan-09 9:46 
AnswerRe: How to determine if two C# exe come from the same source [modified] Pin
Luc Pattyn14-Jan-09 9:59
sitebuilderLuc Pattyn14-Jan-09 9:59 
AnswerRe: How to determine if two C# exe come from the same source Pin
#realJSOP14-Jan-09 9:46
professional#realJSOP14-Jan-09 9:46 
GeneralRe: How to determine if two C# exe come from the same source Pin
Scott Dorman14-Jan-09 9:56
professionalScott Dorman14-Jan-09 9:56 
GeneralRe: How to determine if two C# exe come from the same source Pin
cwster14-Jan-09 10:00
cwster14-Jan-09 10:00 
GeneralRe: How to determine if two C# exe come from the same source Pin
Scott Dorman14-Jan-09 10:02
professionalScott Dorman14-Jan-09 10:02 
AnswerRe: How to determine if two C# exe come from the same source Pin
User 665814-Jan-09 10:04
User 665814-Jan-09 10:04 
AnswerRe: How to determine if two C# exe come from the same source [modified] Pin
Luc Pattyn14-Jan-09 10:12
sitebuilderLuc Pattyn14-Jan-09 10:12 
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

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.