Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 验证WP8中服务器的登录数据_C#_.net_Authentication_Windows Phone 8_Webclient - Fatal编程技术网

C# 验证WP8中服务器的登录数据

C# 验证WP8中服务器的登录数据,c#,.net,authentication,windows-phone-8,webclient,C#,.net,Authentication,Windows Phone 8,Webclient,我需要为我的应用程序提供身份验证。通过使用电子邮件id和密码,我需要发布和放置数据。。我是WP8新手,所以任何人都可以告诉我如何提供身份验证 当我单击“登录”按钮时。。它应该验证来自urlserver的电子邮件id和密码,并且应该重定向到新页面 我的XAML代码 <TextBlock HorizontalAlignment="Left" Height="45" Margin="26,79,0,0" TextWrapping="Wrap" Text="E-Mail ID" VerticalA

我需要为我的应用程序提供身份验证。通过使用电子邮件id和密码,我需要发布和放置数据。。我是WP8新手,所以任何人都可以告诉我如何提供身份验证

当我单击“登录”按钮时。。它应该验证来自urlserver的电子邮件id和密码,并且应该重定向到新页面

我的XAML代码

<TextBlock HorizontalAlignment="Left" Height="45" Margin="26,79,0,0" TextWrapping="Wrap" Text="E-Mail ID" VerticalAlignment="Top" Width="115"/>
            <TextBlock HorizontalAlignment="Left" Height="45" Margin="26,159,0,0" TextWrapping="Wrap" Text="Password" VerticalAlignment="Top" Width="115"/>
            <TextBox x:Name="txt_email" HorizontalAlignment="Left" Height="75" Margin="141,49,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="292" InputScope="EmailSmtpAddress"/>
            <TextBox x:Name="txt_password" HorizontalAlignment="Left" Height="80" Margin="141,139,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="292" InputScope="Password"/>
            <Button x:Name="btn_loin" Content="Log-In" HorizontalAlignment="Left" Height="80"  VerticalAlignment="Top" Width="180" Click="btn_loin_click" Margin="141,254,0,0"/>
通过静态传递电子邮件和密码,我的代码运行良好

//正在添加新组织

public Organization addNewOrganization(string organizationDetails)
    {

    String email="far@c.com";
    String password ="qq";

    JsonClient client = new JsonClient();
    string servicePath = ORGANIZATION_SERVICE + "?"+"email="+email+"&"+"sig="+password;
    Organization organizationregisteredDetails = client.Post<Organization>(servicePath, organizationDetails);
    return organizationregisteredDetails;
}
我的默认Post方法代码工作正常

public T Post<T>(string servicePath, string result)
        {

            string serviceURL = REST_URI + servicePath;
            Uri URI = new Uri(serviceURL);
            System.Net.WebClient webClient = new WebClient();
            webClient.Headers["ContentType"] = "application/json";
            webClient.Headers["Accept"] = "application/json";
            webClient.UploadStringCompleted += this.sendPostCompleted;
            webClient.UploadStringAsync(URI, HTTP_POST, result);
            return default(T);
        }

如果有人指导我,我会很有帮助。

你能出示你的代码吗?对不起,我不知道如何启动。.我已经更新了帖子,请检查一下。。
public T Post<T>(string servicePath, string result)
        {

            string serviceURL = REST_URI + servicePath;
            Uri URI = new Uri(serviceURL);
            System.Net.WebClient webClient = new WebClient();
            webClient.Headers["ContentType"] = "application/json";
            webClient.Headers["Accept"] = "application/json";
            webClient.UploadStringCompleted += this.sendPostCompleted;
            webClient.UploadStringAsync(URI, HTTP_POST, result);
            return default(T);
        }