qd je compile(sous win mobil 5) le code ci dessus j ai une erreur qui demande d activer l option /clr
#include <iostream>
#include<stdio.h>
#using <System.dll>
using namespace System;
using namespace System::IO;
using namespace System::Net;
using namespace System::Net::Sockets;
using namespace System::Text;
//using namespace System::Threading;
using namespace std;
int main()
{
Socket^ socket = nullptr;
IPEndPoint^ endPoint = nullptr;
IPAddress^ ipServer = nullptr;
int port = 4000;
FileStream^ fs;
array<Byte>^data;
int i;
//on commence
i = 0;
ipServer=IPAddress:arse("172.16.100.15");
endPoint = gcnew IPEndPoint(ipServer, port);
socket = gcnew Socket(AddressFamily::InterNetwork, SocketType::Stream, ProtocolType::IP);
socket->Connect(endPoint);
//boucle d'envois
while(i<11)
{
int nbr,b;
//i = i % 11;
fs = File::Open(i.ToString() + ".jpg", FileMode::Open);
//data = gcnew array<System::Byte>(fs->Length);
data = gcnew array<unsigned char>(fs->Length);
nbr=fs->Read(data, 0, data->Length);
fs->Close();
socket->Send(data,data->Length,SocketFlags::None);
data->Initialize();
std::cin>>b;
i++;
}
return 0;
}
je veux savoir comment puis je le faire et
est ce que le managed code est supportable par win mobile?
sinon y at il un autre moyen pour utiliser les socket en c++ sur win mob 5
![]()
Partager