www.pudn.com > MpegDShow.rar > MySocket.h
// MySocket.h: interface for the CMySocket class. // ////////////////////////////////////////////////////////////////////// #include// MFC socket extensions #if !defined(AFX_MYSOCKET_H__EEF2A353_DF4E_4FA0_BD9D_9B091C602D34__INCLUDED_) #define AFX_MYSOCKET_H__EEF2A353_DF4E_4FA0_BD9D_9B091C602D34__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 struct FILEINFO { int iFileLength; }; class CMySocket { public: CMySocket(); virtual ~CMySocket(); public: bool Init(); bool ConnectServer(CString strServerIP, int iServerPort); bool SendFile(CString strFilePath); private: SOCKET m_Socket; SOCKADDR_IN m_AddrSocket; CString m_strServerIP; int m_iServerPort; bool SendFileInfo(const CFile& sendfile); bool SendFileBuf(CFile& sendfile); bool InitConfig(); CString ReadTxt(CString strFileName); CString GetCurrentPath(); void UnInit(); }; #endif // !defined(AFX_MYSOCKET_H__EEF2A353_DF4E_4FA0_BD9D_9B091C602D34__INCLUDED_)