~jbrejner/troja/guifix

« back to all changes in this revision

Viewing changes to Sao/TestClient/Default.aspx.cs

  • Committer: jbr
  • Date: 2011-02-10 09:16:22 UTC
  • Revision ID: svn-v4:93163c94-53e2-4789-836c-c47e9053d533:feature/guifix:131
No FogBugz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
using System;
2
 
using System.Collections.Generic;
3
 
using System.Linq;
4
 
using System.Web;
5
 
using System.Web.UI;
6
 
using System.Web.UI.WebControls;
7
 
using System.ServiceModel;
8
 
using Microsoft.Win32;
9
 
using System.Net;
10
 
 
11
 
namespace TestClient
12
 
{
13
 
    public partial class _Default : System.Web.UI.Page
14
 
    {
15
 
        private TrojaServiceReference.TrojaWcfClient proxy = new TrojaServiceReference.TrojaWcfClient();
16
 
        
17
 
        protected void Page_Load(object sender, EventArgs e)
18
 
        {
19
 
            //proxy.PreAuthenticate = true;
20
 
            //proxy.Credentials = CredentialCache.DefaultCredentials;
21
 
            ServiceUrl.Text = proxy.Endpoint.Address.Uri.AbsoluteUri;
22
 
        }
23
 
 
24
 
        //protected void Button1_Click(object sender, EventArgs e)
25
 
        //{
26
 
        //    proxy.PreAuthenticate = true;
27
 
        //    proxy.Credentials = CredentialCache.DefaultCredentials;
28
 
 
29
 
        //    //TrojaService.TrojaWcfClient service = new TrojaService.TrojaWcfClient();
30
 
        //    //CalculatorService.CalculatorClient service = new CalculatorService.CalculatorClient();
31
 
        //    //service.Endpoint.Address = new EndpointAddress(TextBox1.Text);
32
 
        //    //Label.Text = proxy.ServiceUser() + " - " + proxy.WhoAmI();
33
 
 
34
 
        //    //RegistryKey key = Registry.CurrentUser.
35
 
        //}
36
 
 
37
 
        protected void SetUrl_Click(object sender, EventArgs e)
38
 
        {
39
 
            proxy.Endpoint.Address = new EndpointAddress(ServiceUrl.Text);
40
 
        }
41
 
 
42
 
        protected void FetchCaller_Click(object sender, EventArgs e)
43
 
        {
44
 
            Caller.Text = proxy.WhoAmI();
45
 
        }
46
 
 
47
 
        protected void FetchServiceUser_Click(object sender, EventArgs e)
48
 
        {
49
 
            ServiceUser.Text = proxy.ServiceUser();
50
 
        }
51
 
 
52
 
        protected void GetCommands_Click(object sender, EventArgs e)
53
 
        {
54
 
            //Commands.Text = proxy.GetCommands();
55
 
            Guid id = proxy.CreateCommand("ping", "google.dk", false, new TimeSpan(0, 5, 0), "");
56
 
            Commands.Text = id.ToString();
57
 
        }
58
 
    }
59
 
}
60
 
 
61
 
 
62
 
//public TrojaWS this[string host]
63
 
//{
64
 
//    get
65
 
//    {
66
 
//        if (!proxies.ContainsKey(host))
67
 
//        {
68
 
//            TrojaWS proxy = new TrojaWS();
69
 
//            proxy.Url = string.Format(@"http://{0}:{1}/TrojaWS.asmx", host, ConfigurationSettings.AppSettings["troja_tcp_port"]);
70
 
//            proxy.PreAuthenticate = true;
71
 
//            proxy.Credentials = CredentialCache.DefaultCredentials;
72
 
 
73
 
//            proxies[host] = proxy;
74
 
//        }
75
 
 
76
 
//        return proxies[host];
77
 
//    }
78
 
//}
 
 
b'\\ No newline at end of file'