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 | using Com.Piwigo.Lib.Proxy.Response; |
---|
14 | |
---|
15 | |
---|
16 | namespace 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 | } |
---|
28 | |
---|
29 | private void button1_Click(object sender, EventArgs e) |
---|
30 | { |
---|
31 | PwgConfigProxy.PwgUserAgent = "TestPiwigoLib"; |
---|
32 | PwgConfigProxy.PwgServeurUriBuilder.Host = "bayral.free.fr"; |
---|
33 | PwgConfigProxy.PwgServeurUriBuilder.Path = "phpwebgallery/ws.php"; |
---|
34 | PwgConfigProxy.PwgServeurUriBuilder.Scheme = "http://"; |
---|
35 | |
---|
36 | Console.WriteLine(PwgConfigProxy.PwgServeurUriBuilder.Uri.AbsoluteUri); |
---|
37 | |
---|
38 | try |
---|
39 | { |
---|
40 | PwgSession sess = null; |
---|
41 | sess = PwgSessionService.GetPwgSession(); |
---|
42 | Console.WriteLine("user : " + sess.UserName + " " + sess.Status); |
---|
43 | |
---|
44 | sess = PwgSessionService.Login(tbUser.Text,tbPassword.Text); |
---|
45 | Console.WriteLine("user : " + sess.UserName + " " + sess.Status); |
---|
46 | |
---|
47 | //Boolean rc = PwgTagsService.AddTag("Loic"); |
---|
48 | |
---|
49 | //List<PwgTag> lstTag = PwgTagsService.GetAdminListOfTag(); |
---|
50 | |
---|
51 | sess = PwgSessionService.Logout(); |
---|
52 | Console.WriteLine("user : " + sess.UserName + " " + sess.Status); |
---|
53 | } |
---|
54 | catch (PwgServiceException ex) |
---|
55 | { |
---|
56 | Console.WriteLine("Erreur " + ex.NumeroErr + " " + ex.MessageErr); |
---|
57 | Console.WriteLine(ex.Message); |
---|
58 | } |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | |
---|
63 | } |
---|
64 | } |
---|
65 | } |
---|