TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Antony Xavier
NA
7
996
Call WebApi Link to Windows form for Login Authentication
Feb 7 2020 12:08 AM
using (var client = new HttpClient())
{
string data = txtPass.Text;
string password = Encrypt(data);
HttpResponseMessage response = Client.GetAsync("api/Values/Login?UserLogin = '" + txtUser.Text + "' & Password = '" + password + "'").Result;
client.BaseAddress = new Uri("http://qaen.hr2eazy.com/MobileAPI/");
LoginClass lgn = new LoginClass { Email = txtUser.Text.ToString(), Password = txtPass.Text.ToString() };
var response = client.PostAsJsonAsync("api/Values/Login? UserLogin = '" + txtUser.Text + "' and Password = '" + password + "'", lgn).Result;
var a = response.Content.ReadAsStringAsync();
if (a.Result.ToString().Trim() == "0")
{
MessageBox.Show("Invalid Username");
}
else
{
MessageBox.Show ("Login Successful");
Main f = new Main();
f.Show();
this.Hide();
}
}
Reply
Answers (
2
)
User selection in dropdown list
Create Nuget Package on local drive