public string SendFile(string strFullFileName, byte[] bData, JID jidto) { string strFileName = FileTransfer.GetFileNameFromFullString(strFullFileName); FileTransfer trans = new FileTransfer(bData, strFileName, jidto) { FileTransferDirection = FileTransferDirection.Send }; lock (m_objFileTransferLock) { FileTransfers.Add(trans); } XMPPClient.StreamInitiationAndTransferLogic.RequestStartFileTransfer(trans); return(trans.sid); }
public string SendFile(string strFullFileName, JID jidto) { string strFileName = FileTransfer.GetFileNameFromFullString(strFullFileName); System.IO.FileStream stream = new FileStream(strFullFileName, FileMode.Open, FileAccess.Read); byte [] bData = new byte[stream.Length]; stream.Read(bData, 0, bData.Length); stream.Close(); FileTransfer trans = new FileTransfer(bData, strFileName, jidto) { FileTransferDirection = FileTransferDirection.Send }; lock (m_objFileTransferLock) { FileTransfers.Add(trans); } XMPPClient.StreamInitiationAndTransferLogic.RequestStartFileTransfer(trans); return(trans.sid); }