tag:blogger.com,1999:blog-4193683792173214666.post9181409682968428975..comments2024-02-26T10:22:46.202+05:30Comments on Advanced Computer Programming : Send File from Server to Client using C# Socket Programming Suman Biswashttp://www.blogger.com/profile/14689783166617654485noreply@blogger.comBlogger105125tag:blogger.com,1999:blog-4193683792173214666.post-86940150148292631562015-06-11T13:31:07.251+05:302015-06-11T13:31:07.251+05:30Hi Suman
I send a 8 KB .txt file in which 79 lines...Hi Suman<br />I send a 8 KB .txt file in which 79 lines from server side. But I received only 1KB in which only 6 lines from client side. Please advice me how to solve it. Thanks for this tutorial which is very useful to me.<br />Reply·Email·View Thread·Permalink·Bookmark | Edit·Deletesanhttps://www.blogger.com/profile/10345877516909741965noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-43180049049513672522014-11-19T15:34:56.594+05:302014-11-19T15:34:56.594+05:30Yes you can use my code for your work.Yes you can use my code for your work.Suman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-69163243771625357282014-11-19T12:06:27.956+05:302014-11-19T12:06:27.956+05:30How can use your code to push a file from the serv...How can use your code to push a file from the server to the client. I'm assuming both are on same networkAnonymoushttps://www.blogger.com/profile/01969538131820537955noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-62556533865146315732014-11-19T12:05:23.557+05:302014-11-19T12:05:23.557+05:30Can I use your code. to put the file without runf ...Can I use your code. to put the file without runf over clint side?<br />That I'm needing is to send the file from the server to the client. ?m assuming that both are on the same network. if yes. on which statmente i can specifify the source from theser and the target for the client.Anonymoushttps://www.blogger.com/profile/01969538131820537955noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-41902935565613022102014-11-19T12:05:10.247+05:302014-11-19T12:05:10.247+05:30Can I use your code. to put the file without runf ...Can I use your code. to put the file without runf over clint side?<br />That I'm needing is to send the file from the server to the client. ?m assuming that both are on the same network. if yes. on which statmente i can specifify the source from theser and the target for the client.Anonymoushttps://www.blogger.com/profile/01969538131820537955noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-23958531174440850172013-05-01T00:46:21.613+05:302013-05-01T00:46:21.613+05:30Hi Fikri,
Thanks for comments. ::1:65... actual th...Hi Fikri,<br />Thanks for comments. ::1:65... actual things are :. ::1 is similar to 127.0.0.1 that is local host and next is port number.<br /><br />Server and client is running in same machine. For your project use same port number in server and client.<br /><br />Thanks<br />SumanSuman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-40553638362723531872013-04-30T05:03:50.466+05:302013-04-30T05:03:50.466+05:30Hi Suman,
its been 2 year since you develope this ...Hi Suman,<br />its been 2 year since you develope this aplication and i have been read it today<br />i tested it, and its says "file sending failed, an address is in compatible with the request protocol was used ::1:5656<br />is there any way to change its ip address?<br />could you give me some example on that<br />i dont know if this message read or not, anyway thanksFikrihttps://www.blogger.com/profile/15267692036425345235noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-48830660731874633532012-11-09T13:59:26.038+05:302012-11-09T13:59:26.038+05:30good blog :) I also write articles about .NET deve...good blog :) I also write articles about .NET developingJohnSmithhttps://www.blogger.com/profile/15480121148597819196noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-52040989922532073482012-10-27T23:39:01.406+05:302012-10-27T23:39:01.406+05:30Hey Suman, I actually wanted to know whether how w...Hey Suman, I actually wanted to know whether how will i be able to analyse the bandwidth usage of each computer using C#.Sidhttps://www.blogger.com/profile/12306837787438763821noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-53204294292436210682012-08-23T17:37:43.098+05:302012-08-23T17:37:43.098+05:30Hi Adi,
This particular code has written for small...Hi Adi,<br />This particular code has written for small file transfer so it can not send large file from Server to Client. <br />This code is similar of “FILE TRANSFER USING C# .NET SOCKET PROGRAMMING” (URL: <br /> http://socketprogramming.blogspot.in/2007/11/file-transfer-using-c-socket.html) but written just for opposite side data transfer. To send large file from Client to Server has mentioned at “LARGE FILE (2 GB) TRANSFER USING C# SOCKET” (URL: <br />http://socketprogramming.blogspot.in/2009/02/transfer-large-file-2gb-using-socket-in.html). This large one has been written based on small file transfer so if you understood these two posts clearly then small file transfer from Server to Client you can modify to send large file and I have left this one for my blog readers as a home work! Read these two and try to understand then you can write require code your self. For better I would recommend read all posts one by one so can understood more clearly.<br /><br />One more thing, if my blog helps you then don’t forget to make some click on side ads ;-).<br /><br />Regards,<br />Suman<br /><br />Suman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-68714487765415382992012-08-23T16:39:50.563+05:302012-08-23T16:39:50.563+05:30Hi Suman,
I tried to use your code into my app, bu...Hi Suman,<br />I tried to use your code into my app, but I stumble upon 2 issues:<br />1. If I use the server to send files greater than 8KB, the client doesn't receive the whole file (I'm using it to send&receive XML files)<br />2. If I need to receive files from a certain client (that uses another code than you've designed), how can I still receive the file? (i mean that you've put name of the file after empty 4 bytes, then the file content)<br /><br />First issue is more important for the moment(so I can use your solution as client-server for now)<br /><br />Than you in advance!<br />AdiAnonymoushttps://www.blogger.com/profile/12256557082441973494noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-46033106147462084822012-06-14T03:23:21.242+05:302012-06-14T03:23:21.242+05:30Hi Brinda
I dont have any ready code for you. If y...Hi Brinda<br />I dont have any ready code for you. If you want can write own code by using my 2GB file transfer code, it will not a difficult task.<br /><br />SumanSuman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-86268344997166793442012-06-14T03:23:05.599+05:302012-06-14T03:23:05.599+05:30Hi Brinda
I dont have any ready code for you. If y...Hi Brinda<br />I dont have any ready code for you. If you want can write own code by using my 2GB file transfer code, it will not a difficult task.<br /><br />SumanSuman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-75253493381791369902012-06-14T03:21:20.481+05:302012-06-14T03:21:20.481+05:30Hi Brinda
I dont have any ready code for you. If y...Hi Brinda<br />I dont have any ready code for you. If you want can write own code by using my 2GB file transfer code, it will not a difficult task.<br /><br />SumanSuman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-1426863714493504992012-06-12T10:18:42.511+05:302012-06-12T10:18:42.511+05:30thanks for ur replied :)
could plz give me examp...thanks for ur replied :) <br /><br />could plz give me example code for that :(Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-18067091335036230292012-06-11T20:00:14.143+05:302012-06-11T20:00:14.143+05:30Hi Brinda,
As it is in LAN so any computer may bec...Hi Brinda,<br />As it is in LAN so any computer may become Client and/or Server. In fact Server is require only for Internet based solution because generally users do not use any static dedicated IP and for that from outside LAN client computer cant access directly. So as a middle person (you may think) need server. With Server situation comes like 2 person's conversation with two different languages by taking help of a middle man (server). It is like 1st person: Spanish, 2nd person: Hindi then 3rd person must know Spanish and Hindi. In real 1st will tell to 3rd and then 3rd will convert and tell to 2nd.<br /><br />But for LAN 1st and 2nd can talk directly, because they know their IPs (like same language).<br /><br />Tech solution:<br />So you need to implement Server and Client code in a single application. It will be two different classes. In your application/computer you need two objects for these two classes. So for two clients there will be total 4 objects and for 3 clients 6 object. These will work exactly like when you test your code in a single computer (then sever and client exists in a single machine). <br />You need to register clients that mean each computer will know IP of other computer and when try to send data can create socket object by using these IP and can send data using this socket object.<br /><br />I believe you can now understood the solution how may apply. To implement this you need to know basic thing about socket programming and I have provided these information in my blog. So for code reference you may go though my blog post one by one. Start from oldest to latest.<br /><br />Thanks for asking questions,<br />SumanSuman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-51365239943826020412012-06-11T17:28:30.485+05:302012-06-11T17:28:30.485+05:30i'm brinda . working as software developer. i ...i'm brinda . working as software developer. i saw in ur project simple file transfer in between 2 computer. i'm developing LAN Communicaitor. i want to transfer files to another one computer over the networking . but i have only one application.that application installed in 2 computer or more than one computer . now i want to send files to anyone computer over the installed that application. in my project no server and no client. that application act as sender and receiver .<br /><br />could plz help me this situation.... i'm in critical situation for my problem...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-33451824976207862812012-04-16T21:10:28.747+05:302012-04-16T21:10:28.747+05:30Rahul has commented as below:
I really like your ...Rahul has commented as below:<br /><br />I really like your blog and would suggest you to buy your own domain and hosting. You are a good blogger and you should take blogging seriously :)<br /><br />Hi Rahul,<br />Thanks for you great reply. I will try to do it in future. As you have posted some links so I am deleting your Reply. Sorry, I do not provide any back link in my blog.<br /><br />Regards<br />SumanSuman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-13152753458536730802012-03-16T16:18:49.506+05:302012-03-16T16:18:49.506+05:30thnx for such a nice code ..cleared my concepts..t...thnx for such a nice code ..cleared my concepts..thnx a lot sumanAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-79922101760447249442012-03-02T08:19:04.441+05:302012-03-02T08:19:04.441+05:30In this code IPAddress is getting atomatically.hel...In this code IPAddress is getting atomatically.help me to enter IPAddress manually while writing code.(i just wana use code in 1 system only)Unknownhttps://www.blogger.com/profile/00451262616909358704noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-16609138232916675332011-12-02T10:02:21.972+05:302011-12-02T10:02:21.972+05:30thank you Biswas i just kept a templet of the code...thank you Biswas i just kept a templet of the code .just go trough this.....<br /><br /> for (; ; )<br /> {<br />fileName = fileName.Replace("\\", "/");<br /> while (fileName.IndexOf("/") > -1)<br /> {<br /> filePath += " ";<br /> }<br /> }<br /><br />i just used for loop....to repeat the same file.....i developed a code in java based on same concept it worked well for me...i don't know why i am getting errors in .netCh.Anushahttps://www.blogger.com/profile/04899267201087105292noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-79825643513480545572011-12-01T12:32:52.475+05:302011-12-01T12:32:52.475+05:30Hi
I dont know how u have written your code about ...Hi<br />I dont know how u have written your code about to send file multiple time. It seems to me client is getting deadlock during sending file multiple time.so it might be reason may be any reason can give this problem <br /><br />SumanSuman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-76265962559176937002011-12-01T11:38:06.219+05:302011-12-01T11:38:06.219+05:30Hi Biswas,i just made some modifications to your c...Hi Biswas,i just made some modifications to your code so that i can tranfer the same file repeatedly to the server....actually it shows no errors during the build project but when i am running the programme the client code gets struck...can you please suggest some modifications.<br /> thank you.Ch.Anushahttps://www.blogger.com/profile/04899267201087105292noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-81770269958268891802011-11-30T02:59:34.726+05:302011-11-30T02:59:34.726+05:30Hi
I believe there has an application with win for...Hi<br />I believe there has an application with win forms and dll of this code from there you can get and idea <br />SumanSuman Biswashttps://www.blogger.com/profile/14689783166617654485noreply@blogger.comtag:blogger.com,1999:blog-4193683792173214666.post-86618923931487453242011-11-29T09:54:10.390+05:302011-11-29T09:54:10.390+05:30hello,
can u pls tel me how to do a client server ...hello,<br />can u pls tel me how to do a client server application using forms in c#?Anonymousnoreply@blogger.com