Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // On récupére la valeur du text dans la TextBox
     String name = Request.QueryString["NomImage"];
     String path = Request.QueryString["Path"];
     // Si ce paramètre n'est pas nul
     if (name != null)
     {
         if (path != null)
         {
             // Instanciation de la référence de service
             ImageTransfertServiceReference.ImageTransfertClient imageTransfertService = new ImageTransfertServiceReference.ImageTransfertClient();
             MemoryStream imageStream = new MemoryStream(lireFichier(path));
             ImageTransfertServiceReference.ImageInfo info = new ImageTransfertServiceReference.ImageInfo();
             info.ID = name;
             info.idAlbum = 1;
             ImageTransfertServiceReference.ImageUploadRequest request = new ImageTransfertServiceReference.ImageUploadRequest();
             request.ImageData = imageStream;
             request.ImageInfo = info;
             // Appel de notre web method
             imageTransfertService.UploadImage(info, imageStream);
             Session["transfert"] = "Transfert terminé";
         }
     }
 }
Пример #2
0
 static void Main(string[] args)
 {
     // Instanciation de la référence de service
     ImageTransfertServiceReference.ImageTransfertClient
     imageTransfertService = new ImageTransfertServiceReference.ImageTransfertClient();
     MemoryStream imageStream = new MemoryStream(lireFichier(@"D:\image.jpg"));
     // Appel de notre web method
     imageTransfertService.UploadImage(imageStream);
     Console.Out.WriteLine("Transfert Terminé");
     Console.ReadLine();
 }
Пример #3
0
 static void Main(string[] args)
 {
     // Instanciation de la référence de service
     ImageTransfertServiceReference.ImageTransfertClient imageTransfertService = new ImageTransfertServiceReference.ImageTransfertClient();
     MemoryStream imageStream = new MemoryStream(lireFichier(@"C:\Users\user\Pictures\absorbeur.PNG"));
     ImageTransfertServiceReference.ImageInfo info = new ImageTransfertServiceReference.ImageInfo();
     info.ID = "Plop2";
     info.idAlbum = 1;
     ImageTransfertServiceReference.ImageUploadRequest request = new ImageTransfertServiceReference.ImageUploadRequest();
     request.ImageData = imageStream;
     request.ImageInfo = info;
     // Appel de notre web method
     imageTransfertService.UploadImage(info, imageStream);
     Console.Out.WriteLine("Transfert Terminé");
     Console.ReadLine();
 }