1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.ComponentModel; |
---|
4 | using System.Data; |
---|
5 | using System.Drawing; |
---|
6 | using System.Linq; |
---|
7 | using System.Text; |
---|
8 | using System.Windows.Forms; |
---|
9 | |
---|
10 | using Com.Piwigo.Lib.Proxy; |
---|
11 | using Com.Piwigo.Lib.Service; |
---|
12 | using Com.Piwigo.Lib.DTO; |
---|
13 | |
---|
14 | |
---|
15 | namespace 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 | } |
---|