Click here to Skip to main content
15,911,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What are different method to load any image from file Pin
Stlan23-May-05 21:36
Stlan23-May-05 21:36 
GeneralRe: What are different method to load any image from file Pin
amrutajoshi24-May-05 0:06
amrutajoshi24-May-05 0:06 
GeneralRe: What are different method to load any image from file Pin
ThatsAlok24-May-05 0:10
ThatsAlok24-May-05 0:10 
GeneralRe: What are different method to load any image from file Pin
amrutajoshi24-May-05 2:12
amrutajoshi24-May-05 2:12 
GeneralRe: What are different method to load any image from file Pin
ThatsAlok24-May-05 2:17
ThatsAlok24-May-05 2:17 
AnswerRe: What are different method to load any image from file Pin
Stlan23-May-05 21:20
Stlan23-May-05 21:20 
GeneralMSHTML OnSubmit Customised Function Pin
Member 161855823-May-05 21:02
Member 161855823-May-05 21:02 
GeneralEncoding Technique Pin
Rashaida23-May-05 19:56
sussRashaida23-May-05 19:56 
How can i transfer same format?
i send file on network but on client side not recieved same format.
i used Myobj class

[Serializable]
public class MyObject
{
public int size;
public byte[] buffer=null;
public string str="hello string";

public MyObject()
{

}
Server send data on network as


public void senddata(string fname)
{


MyObject obj=new MyObject();
//Create a file stream from an existing file.
FileInfo fi=new FileInfo(fname);
FileStream fs=fi.OpenRead();
//Read 100 bytes into an array from the specified file.
// int nBytes;
byte[] ByteArray=new byte[(int)fs.Length];
obj.size=(int)fs.Length;
obj.buffer=ByteArray;
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(st.BaseStream, obj);
st.BaseStream.Flush();

}


& on client side receieved data as


public void receivedata()
{
MyObject obj=new MyObject();
IFormatter formatter = new BinaryFormatter();
obj =(MyObject)formatter.Deserialize(at.BaseStream);
Encoding ascii = Encoding.ASCII;
Encoding unicode = Encoding.Unicode;



byte[] ByteArray=new byte[obj.size];
byte[] asciiBytes = Encoding.Convert(ascii, unicode, obj.buffer);

// at.BaseStream.Read(ByteArray, 0, 11);
FileStream fs1=File.Create("c:\\clock1.avi");
fs1.Write(obj.buffer,0,obj.size);
fs1.Close();
ptr(obj.size.ToString());
ptr(obj.str);


}

kindly tell default encoding technique or any other solution
from which we receieve same format on server & client side

Rashaida


Rashaida
Generaloperator new Pin
vikramlinux23-May-05 19:50
vikramlinux23-May-05 19:50 
GeneralRe: operator new Pin
itkid23-May-05 20:14
itkid23-May-05 20:14 
GeneralRe: operator new Pin
vikramlinux23-May-05 20:19
vikramlinux23-May-05 20:19 
GeneralRe: operator new Pin
Bob Stanneveld23-May-05 20:27
Bob Stanneveld23-May-05 20:27 
GeneralRe: operator new Pin
Bob Stanneveld23-May-05 20:24
Bob Stanneveld23-May-05 20:24 
GeneralRe: operator new Pin
toxcct23-May-05 20:38
toxcct23-May-05 20:38 
Questionsend data(streams) on network? Pin
shumyla198323-May-05 19:18
shumyla198323-May-05 19:18 
AnswerRe: send data(streams) on network? Pin
Geert van Horrik23-May-05 20:17
Geert van Horrik23-May-05 20:17 
GeneralProtecting Source Code Pin
JSadleir23-May-05 18:55
JSadleir23-May-05 18:55 
GeneraltoolBars buttons Pin
neliocc23-May-05 18:04
neliocc23-May-05 18:04 
GeneralRe: toolBars buttons Pin
ThatsAlok23-May-05 18:26
ThatsAlok23-May-05 18:26 
GeneralRe: toolBars buttons Pin
neliocc23-May-05 18:32
neliocc23-May-05 18:32 
GeneralRe: toolBars buttons Pin
khan++23-May-05 18:46
khan++23-May-05 18:46 
GeneralRe: toolBars buttons Pin
neliocc23-May-05 18:53
neliocc23-May-05 18:53 
GeneralRe: toolBars buttons Pin
PJ Arends23-May-05 19:18
professionalPJ Arends23-May-05 19:18 
GeneralRe: toolBars buttons Pin
ThatsAlok23-May-05 19:19
ThatsAlok23-May-05 19:19 
QuestionTo send data(streams) of audio & video on network? Pin
shumyla198323-May-05 17:29
shumyla198323-May-05 17:29 

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.