source: extensions/PiwigoLib/TestPiwigoLib/Form1.cs @ 3817

Last change on this file since 3817 was 3817, checked in by bayral, 15 years ago
File size: 1.8 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Linq;
7using System.Text;
8using System.Windows.Forms;
9
10using Com.Piwigo.Lib.Proxy;
11using Com.Piwigo.Lib.Service;
12using Com.Piwigo.Lib.DTO;
13
14
15namespace TestPiwigoLib
16{
17    public partial class Form1 : Form
18    {
19        public Form1()
20        {
21            InitializeComponent();
22        }
23
24        private void Form1_Load(object sender, EventArgs e)
25        {
26            PwgConfigProxy.PwgUserAgent = "TestPiwigoLib";
27            PwgConfigProxy.PwgServeurUriBuilder.Host = "bayral.free.fr";
28            PwgConfigProxy.PwgServeurUriBuilder.Path = "phpwebgallery/ws.php";
29            PwgConfigProxy.PwgServeurUriBuilder.Scheme = "http://";
30
31            Console.WriteLine(PwgConfigProxy.PwgServeurUriBuilder.Uri.AbsoluteUri);
32
33            try
34            {
35                PwgSession sess = null;
36                sess = PwgSessionService.GetPwgSession();
37                Console.WriteLine("user : " + sess.UserName + " "+ sess.Status);
38
39                sess = PwgSessionService.Login("xxx", "xxx");
40                Console.WriteLine("user : " + sess.UserName + " " + sess.Status);
41
42                List<PwgTag> lstTag = PwgTagsService.GetListOfPwgTag(false);
43
44                sess = PwgSessionService.Logout();
45                Console.WriteLine("user : " + sess.UserName + " " + sess.Status);
46
47                sess = PwgSessionService.Login("xxx", "xxx");
48                Console.WriteLine("user : " + sess.UserName + " " + sess.Status);
49            }
50            catch (PwgServiceException ex)
51            {
52                Console.WriteLine("Erreur " + ex.NumeroErr + " " + ex.MessageErr);
53            }
54
55           
56
57        }
58    }
59}
Note: See TracBrowser for help on using the repository browser.