Click here to Skip to main content
15,902,736 members
Home / Discussions / C#
   

C#

 
GeneralRe: Refreshing datagrid Pin
Rafone7-Feb-09 5:00
Rafone7-Feb-09 5:00 
GeneralRe: Refreshing datagrid Pin
Muammar©7-Feb-09 18:56
Muammar©7-Feb-09 18:56 
Questionbest choice ? Pin
Xmen Real 7-Feb-09 2:50
professional Xmen Real 7-Feb-09 2:50 
AnswerRe: best choice ? [modified] Pin
DaveyM697-Feb-09 3:25
professionalDaveyM697-Feb-09 3:25 
AnswerRe: best choice ? Pin
Luc Pattyn7-Feb-09 3:48
sitebuilderLuc Pattyn7-Feb-09 3:48 
Questionfile upload error Pin
George_George7-Feb-09 2:43
George_George7-Feb-09 2:43 
AnswerRe: file upload error Pin
Nicholas Butler7-Feb-09 3:34
sitebuilderNicholas Butler7-Feb-09 3:34 
GeneralRe: file upload error Pin
George_George7-Feb-09 22:19
George_George7-Feb-09 22:19 
Thanks Nick,

I have tried adding http:// is not working. I have posted my stack error and my code again. Hope it matches. Smile | :)

Any ideas what is wrong?

    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("\nPlease enter the URI to post data to : ");
            String uriString = Console.ReadLine();

            WebClient myWebClient = new WebClient();

            Console.WriteLine("\nPlease enter the fully qualified path of the file to be uploaded to the URI");
            string fileName = Console.ReadLine();
            Console.WriteLine("Uploading {0} to {1} ...", fileName, uriString);

            DateTime begin = DateTime.Now;

            byte[] responseArray = null;
            try
            {
                responseArray = myWebClient.UploadFile(uriString, fileName);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.ToString());
            }

            DateTime end = DateTime.Now;

            Console.WriteLine("Elapsed time is: {0}", (end - begin).TotalMilliseconds);
        }
    }

Unable to connect to the remote server
System.Net.WebException: Unable to connect to the remote server ---> System.Net.
Sockets.SocketException: No connection could be made because the target machine
actively refused it 10.10.12.162:1031
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddre
ss socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Sock
et s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state,
IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.WebClient.UploadFile(Uri address, String method, String fileNam
e)
   at FileUploadClient.Program.Main(String[] args) in C:\software\UploadFile\Net
work_Monitor_Demo\FileUploadClient\Program.cs:line 27
Elapsed time is: 4579


regards,
George
GeneralRe: file upload error Pin
Nicholas Butler7-Feb-09 23:36
sitebuilderNicholas Butler7-Feb-09 23:36 
GeneralRe: file upload error Pin
George_George8-Feb-09 0:18
George_George8-Feb-09 0:18 
GeneralRe: file upload error Pin
Nicholas Butler8-Feb-09 2:21
sitebuilderNicholas Butler8-Feb-09 2:21 
AnswerRe: file upload error Pin
Hamid_RT15-Feb-09 21:44
Hamid_RT15-Feb-09 21:44 
Questionweb service and desktop client connectivity issue Pin
sailesh_gupta7-Feb-09 1:57
sailesh_gupta7-Feb-09 1:57 
QuestionHow to convert tiff file to text file using tesseract.ocr in C#(Asp.net)" Pin
ChandrakanthGaddam7-Feb-09 1:32
ChandrakanthGaddam7-Feb-09 1:32 
QuestionCombobox selected item issue Pin
laziale7-Feb-09 0:40
laziale7-Feb-09 0:40 
AnswerRe: Combobox selected item issue Pin
sailesh_gupta7-Feb-09 2:03
sailesh_gupta7-Feb-09 2:03 
AnswerRe: Combobox selected item issue Pin
Xmen Real 7-Feb-09 2:29
professional Xmen Real 7-Feb-09 2:29 
AnswerRe: Combobox selected item issue Pin
Dragonfly_Lee7-Feb-09 3:22
Dragonfly_Lee7-Feb-09 3:22 
QuestionBlocking internet to client systems using C# and winforms Pin
varaprasad.shetty7-Feb-09 0:34
varaprasad.shetty7-Feb-09 0:34 
AnswerRe: Blocking internet to client systems using C# and winforms Pin
NaserJaved23-Dec-09 1:31
NaserJaved23-Dec-09 1:31 
QuestionImports Problem in Crystal Report Pin
jigneshDPatel6-Feb-09 23:28
jigneshDPatel6-Feb-09 23:28 
Questioncombobox in dotnet with c# coding for windows application Pin
aratireddy6-Feb-09 22:05
aratireddy6-Feb-09 22:05 
AnswerRe: combobox in dotnet with c# coding for windows application Pin
DaveyM696-Feb-09 22:30
professionalDaveyM696-Feb-09 22:30 
Questionhow to convert a bytearray to varchar using c# Pin
Reetu Singh6-Feb-09 21:45
Reetu Singh6-Feb-09 21:45 
AnswerRe: how to convert a bytearray to varchar using c# Pin
Xmen Real 7-Feb-09 2:36
professional Xmen Real 7-Feb-09 2:36 

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.