Click here to Skip to main content
15,917,859 members
Home / Discussions / C#
   

C#

 
QuestionMp3 Spliting Pin
Learn Searcher31-Jan-09 21:18
Learn Searcher31-Jan-09 21:18 
AnswerRe: Mp3 Spliting Pin
Christian Graus31-Jan-09 22:05
protectorChristian Graus31-Jan-09 22:05 
AnswerRe: Mp3 Spliting Pin
Dragonfly_Lee1-Feb-09 20:17
Dragonfly_Lee1-Feb-09 20:17 
Questionwhen a method is called i want to get first index value from an arraylist and when the same methid is called nxt time i want to get the second index value from the same arraylist...how? Pin
merryjoy00031-Jan-09 20:30
merryjoy00031-Jan-09 20:30 
AnswerRe: when a method is called i want to get first index value from an arraylist and when the same methid is called nxt time i want to get the second index value from the same arraylist...how? Pin
Kashif Sabir31-Jan-09 21:13
Kashif Sabir31-Jan-09 21:13 
AnswerRe: when a method is called i want to get first index value from an arraylist and when the same methid is called nxt time i want to get the second index value from the same arraylist...how? Pin
Dragonfly_Lee31-Jan-09 21:18
Dragonfly_Lee31-Jan-09 21:18 
Questiontablelayoutpanel in c#.net in windows application Pin
dilipmca0431-Jan-09 20:05
dilipmca0431-Jan-09 20:05 
AnswerRe: tablelayoutpanel in c#.net in windows application Pin
dan!sh 31-Jan-09 21:53
professional dan!sh 31-Jan-09 21:53 
AnswerRe: tablelayoutpanel in c#.net in windows application Pin
Alan N31-Jan-09 21:57
Alan N31-Jan-09 21:57 
QuestionHow to call a string value from a method within another class? Pin
Aghosh Babu31-Jan-09 19:29
Aghosh Babu31-Jan-09 19:29 
AnswerRe: How to call a string value from a method within another class? Pin
Karmendra Suthar31-Jan-09 19:50
Karmendra Suthar31-Jan-09 19:50 
GeneralRe: How to call a string value from a method within another class? Pin
Aghosh Babu31-Jan-09 20:15
Aghosh Babu31-Jan-09 20:15 
GeneralRe: How to call a string value from a method within another class? Pin
Karmendra Suthar1-Feb-09 1:00
Karmendra Suthar1-Feb-09 1:00 
AnswerRe: How to call a string value from a method within another class? Pin
Dragonfly_Lee31-Jan-09 20:11
Dragonfly_Lee31-Jan-09 20:11 
QuestionProtect password file Pin
Karmendra Suthar31-Jan-09 19:27
Karmendra Suthar31-Jan-09 19:27 
AnswerRe: Protect password file Pin
Dragonfly_Lee31-Jan-09 20:02
Dragonfly_Lee31-Jan-09 20:02 
GeneralRe: Protect password file Pin
Karmendra Suthar1-Feb-09 0:53
Karmendra Suthar1-Feb-09 0:53 
GeneralRe: Protect password file Pin
Dave Kreskowiak1-Feb-09 1:45
mveDave Kreskowiak1-Feb-09 1:45 
GeneralRe: Protect password file Pin
Dragonfly_Lee1-Feb-09 4:05
Dragonfly_Lee1-Feb-09 4:05 
Questionfile upload error Pin
George_George31-Jan-09 19:22
George_George31-Jan-09 19:22 
Hello everyone,

Here is my code at both client side and server side. My code is simple, just upload a file to an ASP.Net web site.

My client code throws exception when it works on Vista (x64, Enterprise, SP1), but works fine on Windows Server 2003.

Any ideas?

10.10.12.162 is my server address.

Client:

       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);
        }

Server:

    public partial class FileUploadHandler : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            foreach (string f in Request.Files.AllKeys)
            {
                HttpPostedFile file = Request.Files[f];
                file.SaveAs("D:\\UploadFile\\UploadedFiles\\" + file.FileName);
            }
        }
    }

Exception from client side:

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 D:\UploadFile\FileUploadClient\Program.cs:line 30


regards,
George
AnswerRe: file upload error Pin
Anthony Mushrow1-Feb-09 2:17
professionalAnthony Mushrow1-Feb-09 2:17 
GeneralRe: file upload error Pin
George_George1-Feb-09 13:59
George_George1-Feb-09 13:59 
Questioncan we add for loop into an arraylist?how? Pin
merryjoy00031-Jan-09 19:19
merryjoy00031-Jan-09 19:19 
AnswerRe: can we add for loop into an arraylist?how? Pin
Dragonfly_Lee31-Jan-09 20:13
Dragonfly_Lee31-Jan-09 20:13 
AnswerRe: can we add for loop into an arraylist?how? Pin
Alan Balkany2-Feb-09 4:00
Alan Balkany2-Feb-09 4:00 

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.