473,748 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending a file using netstream and filestream.

What are the parameters in the constructor if you are
going to send a file over a tcp/ip network using netstream
and filestream?

I have learned that you are supposed to do something like
this:

NetStream nstream = new netStream(clien t);
FileStream fstream = new File ("c:\\test.txt" ,
FileMode.open);

In sender-computer:
fstream.Write() ; //Send to netstream.
nstream.Read(); //Read

In receiver;

nstream.Write()
fstream.Read();

I want to be able to connect and download a file without
any changes.

Nov 15 '05 #1
0 1729

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
13457
by: Lars | last post by:
Hi! I´m trying to send a file over a network with tcp/ip so that the client can download it and save it. I going to send the size of the file in a textmessage but I have not implemented that part yet. But am I getting in right? This is the server (not all). Socket client = server.Accept(); NetworkStream netStream = new NetworkStream(client);
2
1870
by: Adam Clauss | last post by:
Alright, I have a webapp in which I need to send a byte (which happens to be the contents of an excel spreadsheet read in from the .xls file). Now, I can't actually redirect the user (Response.Redirect()) to the file, so I want to just send the byte itself. My question is, Response.Write() only takes a char, so how can I send this byte? (And what other headers might I need to set since I'm doing this sorta manually?)
3
6415
by: notregister | last post by:
Hi would i like to send string of PCL codes to a Printer which i have the IP address, how do i send it? i'm currently using TCPclient class, but it could not work, as the printer would just hang... pls help me...
2
1003
by: notregister | last post by:
Hi, i have an array of data, all in bytes. How can i send it to an device which i have its IP address and Port?? How can i make sure the bytes are send in sequence, as in byte(0) will send out, then byte(1) will follow...subsequently...all bytels are send??
5
9252
by: Paul Aspinall | last post by:
Hi I want to send an ASCII character string / stream to an IP address. I basically have 6 barcode printers, and a web interface. Depending on what is entered on the web page, will determine which printer the label is printed on (ie. which IP address the ASCII string / stream is sent to). How can I send an ASCII string / stream to an IP address??
0
1321
by: Lee | last post by:
Hi, I am trying to send and receive a file (it is actually an xml file, however any file may possibly be sent) using;- sending ..... public void send() {
2
4193
by: Bonzol | last post by:
vb.net 2003 Windows application We have a Client/Server system set up by communicating through a TCPClient object. The server loops continuously using a tcplistener device and each time a client object attempts a connection, a new instance of a Client object is created (in the server's clients hashtable). The client object on the server (the client solution itself has same communication setup only with the code in the main form) handles...
0
1147
by: duclm | last post by:
Hi all, II am having problem sending zip file(binary file) using webrequest function from wince5.0 device to a webpage. It works fine for any file with size less than or equal to 1.5kb. Any bigger files, it did not return any error that i can see but then the sent files are just not stored on the server? They are just lost. And i tried so many ways but still hopeless. can you please help me out. Here are my code: FROM WINCE DEVICE: ...
6
2219
by: Jason | last post by:
I would like to build a windows app or service that would read a .txt file and than put the contents of that file in an email and send off the email. WOuld that be very difficult?...how could this be done?
0
8994
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9555
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9250
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8247
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4878
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.