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

Last change on this file since 3818 was 3818, checked in by bayral, 15 years ago

get Tags List support

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;
13using Com.Piwigo.Lib.Proxy.Response;
14
15
16namespace TestPiwigoLib
17{
18    public partial class Form1 : Form
19    {
20        public Form1()
21        {
22            InitializeComponent();
23        }
24
25        private void Form1_Load(object sender, EventArgs e)
26        {
27            PwgConfigProxy.PwgUserAgent = "TestPiwigoLib";
28            PwgConfigProxy.PwgServeurUriBuilder.Host = "bayral.free.fr";
29            PwgConfigProxy.PwgServeurUriBuilder.Path = "phpwebgallery/ws.php";
30            PwgConfigProxy.PwgServeurUriBuilder.Scheme = "http://";
31
32            Console.WriteLine(PwgConfigProxy.PwgServeurUriBuilder.Uri.AbsoluteUri);
33
34            try
35            {
36                PwgSession sess = null;
37                sess = PwgSessionService.GetPwgSession();
38                Console.WriteLine("user : " + sess.UserName + " "+ sess.Status);
39
40                sess = PwgSessionService.Login("xxx", "xxx");
41                Console.WriteLine("user : " + sess.UserName + " " + sess.Status);
42
43                List<PwgTag> lstTag = PwgTagsService.GetAdminListOfTag();
44
45                sess = PwgSessionService.Logout();
46                Console.WriteLine("user : " + sess.UserName + " " + sess.Status);
47
48                sess = PwgSessionService.Login("xxx", "xxx");
49                Console.WriteLine("user : " + sess.UserName + " " + sess.Status);
50            }
51            catch (PwgServiceException ex)
52            {
53                Console.WriteLine("Erreur " + ex.NumeroErr + " " + ex.MessageErr);
54            }
55
56           
57
58        }
59    }
60}
Note: See TracBrowser for help on using the repository browser.