本文整理汇总了C#中ServiceReference1.Service1Client类的典型用法代码示例。如果您正苦于以下问题:C# ServiceReference1.Service1Client类的具体用法?C# ServiceReference1.Service1Client怎么用?C# ServiceReference1.Service1Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceReference1.Service1Client类属于命名空间,在下文中一共展示了ServiceReference1.Service1Client类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UploadDB
async Task<bool> UploadDB()
{
try
{
ServiceReference1.IService1 s = new ServiceReference1.Service1Client();
Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
Windows.Storage.StorageFile sampleFile = await storageFolder.GetFileAsync("SQLITEV2.sqlite");
byte[] result;
using (Stream stream = await sampleFile.OpenStreamForReadAsync())
{
using (var memoryStream = new MemoryStream())
{
stream.CopyTo(memoryStream);
result = memoryStream.ToArray();
}
}
await s.UploadFileAsync(result);
return true;
}
catch (Exception)
{
return false;
throw;
}
}
开发者ID:IIIArbiIII,项目名称:MedicineApp,代码行数:30,代码来源:App.xaml.cs
示例2: Button2_Click
protected void Button2_Click(object sender, EventArgs e)
{
ServiceReference1.Service1Client crime = new ServiceReference1.Service1Client();
string a = TextBox9.Text;
int x= crime.CrimeData(a);
TextBox10.Text = Convert.ToString(x);
}
开发者ID:GauthamAtluri,项目名称:Real-Estate-BookingSystem,代码行数:7,代码来源:Services.aspx.cs
示例3: Search_User
protected void Search_User(string user_name)
{
ServiceReference1.Get_User_By_UserName_v2_Result user = new ServiceReference1.Service1Client().Get_User_By_UserName_v2(user_name);
username = user.Username;
pass = user.Password;
security_code = user.Security_Code;
txtUsername.Text = user.Username;
txtEmail.Text = user.Email;
txtPhone.Text = user.Phone_Number;
switch (user.Gender)
{
case "Male": rdMale.Checked = true;
break;
case "Female": rdFemale.Checked = true;
break;
case "Other": rdOther.Checked = true;
break;
}
ddlUserType.SelectedValue = user.Role_ID.ToString();
if (user.Role_Name == "Admin")
{
ddlUserType.Enabled = false;
btnDelete.Visible = false;
}
else
{
ddlUserType.Enabled = true;
btnDelete.Visible = true;
}
txtUsername.Enabled = false;
btnAdd.Visible = false;
btnUpdate.Visible = true;
btnCancel.Visible = true;
}
开发者ID:QuangNguyen263,项目名称:Online-Railway-Reservation-ASP.NET,代码行数:34,代码来源:User_Manager.aspx.cs
示例4: Main
static void Main(string[] args)
{
ServiceReference1.Service1Client SvcProxy = new ServiceReference1.Service1Client("tcpWcfSvcLib1EP");
SvcProxy.Open();
//2,147,483,647
byte[] valuesBytes;
valToTransfer[] mivs = null;
for (int x = 0; x < TEST_COUNT; x++)
{
DateTime startTime = DateTime.Now;
valuesBytes = SvcProxy.GetData();
mivs = HandDeserialize(valuesBytes);
DateTime endTime = DateTime.Now;
TimeSpan ts = new TimeSpan(endTime.Ticks - startTime.Ticks);
aggregateMilliseconds += ts.Milliseconds;
Console.WriteLine("time for call:[" + ts.Milliseconds + "]");
Console.WriteLine("size of data passed [" + valuesBytes.Length + "]");
Console.WriteLine("packet number[" + mivs[0].struct2_data_len + "]"); // hijacked for testing purposes..
Console.WriteLine("500th item audit[" + mivs[499].struct1_ulong1 + "]");
Console.WriteLine("9000th item audit[" + mivs[8999].struct1_ulong1 + "]");
}
Console.WriteLine("avg time per call [" + aggregateMilliseconds/TEST_COUNT + "]");
SvcProxy.Close();
}
开发者ID:ehershey,项目名称:development,代码行数:28,代码来源:Program.cs
示例5: Main
static void Main(string[] args)
{
ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();
try
{
string retorno = client.GetData(1232);
Console.WriteLine(retorno);
}
catch (EndpointNotFoundException e)
{
Console.WriteLine("Servidor desligado");
}
catch (Exception e)
{
Console.WriteLine("Deu algo errado");
}
finally
{
Console.WriteLine("Finalizou");
}
Console.Read();
}
开发者ID:TiagoSoczek,项目名称:MOC,代码行数:25,代码来源:Program.cs
示例6: TestConnection
public ActionResult TestConnection()
{
ServiceReference1.Service1Client proxy = new ServiceReference1.Service1Client();
ViewBag.Message = proxy.getResponse();
proxy.Close();
return View();
}
开发者ID:Razom,项目名称:Razom,代码行数:7,代码来源:AdminController.cs
示例7: Button1_Click
protected void Button1_Click(object sender, EventArgs e)
{
string r = TextBox1.Text;
ServiceReference1.Service1Client ob = new ServiceReference1.Service1Client();
Label2.Text = ob.nearbyhotels(r);
Label2.Visible = true;
}
开发者ID:Aritra23,项目名称:DSOD-Assignment3-part-3,代码行数:7,代码来源:NearestHotelInformationForm.aspx.cs
示例8: btnAddMission2_Click
protected void btnAddMission2_Click(object sender, EventArgs e)
{
ServiceReference1.Service1Client x = new ServiceReference1.Service1Client();
setFields();
ServiceReference1.CompositeMission mission = new ServiceReference1.CompositeMission();
mission.Description = Description;
int oid = Convert.ToInt32(ddOffice.SelectedValue);
ServiceReference1.CompositeOffice office = new ServiceReference1.CompositeOffice();
office = x.GetOffice(oid);
mission.OID = office.OID;
int eid = Convert.ToInt32(ddEmployee.SelectedValue);
ServiceReference1.CompositeEmployee employee = new ServiceReference1.CompositeEmployee();
employee = x.GetEmployee(eid);
mission.EID = employee.EID;
mission.StartDate = Date;
int manager = Convert.ToInt32(ddManager.SelectedValue);
ServiceReference1.CompositeEmployee mana = new ServiceReference1.CompositeEmployee();
mana = x.GetEmployee(manager);
mission.Manager = mana.EID;
x.SaveMission(mission);
buttonsAddMission2();
setFieldsEnabled(false);
updateGW();
}
开发者ID:Bal000,项目名称:VITS-Utbildningar,代码行数:30,代码来源:HanteraUppdrag.aspx.cs
示例9: btnlogin_Click
protected void btnlogin_Click(object sender, EventArgs e)
{
var user = new ServiceReference1.Service1Client().Get_User_By_UserName_v2(txtusername.Text);
if (user != null && txtmail.Text == user.Email)
{
try
{
new CheckValidate.CheckDataValidate().send_Mail(user.Username, user.Email, "Message from ONLINE RAILWAY RESERVATION SYSTEM", "<h2 style='color:#0091d4; text-align:center'>ONLINE RAILWAY RESERVATION SYSTEM</h2><br/> " + "<h3 style='text-align:center; font-weight:bold'>YOUR NEW PASSWORD</h3><br/><br/>" + "Username: " + user.Username + "<br/>" + "Password: " + user.Security_Code);
string pass = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(user.Security_Code, "SHA1"); // encrypt password
ServiceReference1.User u = new ServiceReference1.User();
u.Username = user.Username;
u.Password = pass;
if(new ServiceReference1.Service1Client().Update_Password(u) == 1){
lblkq.Text = "Check mail to receive new password";
}
}
catch (Exception)
{
ScriptManager.RegisterStartupScript(this, GetType(), "Thông báo", "alert('Can not send mail !!!');", true);
}
}
else
{
lblkq.Text = "Username or email are incorrect";
}
}
开发者ID:QuangNguyen263,项目名称:Online-Railway-Reservation-ASP.NET,代码行数:26,代码来源:Forget_pass.aspx.cs
示例10: dgCoaches_ItemCommand
protected void dgCoaches_ItemCommand(object source, DataGridCommandEventArgs e)
{
Label lbl = (Label)e.Item.FindControl("lblid");
id = int.Parse(lbl.Text);
ServiceReference1.Service1Client sv = new ServiceReference1.Service1Client();
ServiceReference1.get_Coach_By_ID_Result coaches = sv.Get_Coach_By_ID(id);
// get train name
string trainname = sv.get_Train_By_ID(int.Parse(coaches.Train_ID.ToString())).Train_Name;
// show data
ddlTrainName.SelectedValue = coaches.Train_ID.ToString();
ddlCoachesType.SelectedItem.Text = coaches.Coach_Type;
txtSeats.Text = coaches.Number_Of_Seats.ToString();
_train_id = int.Parse(coaches.Train_ID.ToString());
txtPrices.Text = coaches.Price.ToString();
if (coaches.Status.ToString() == "Active")
{
RadioButton1.Checked = true;
RadioButton2.Checked = false;
}
else
{
RadioButton2.Checked = true;
RadioButton1.Checked = false;
}
ddlTrainName.Enabled = false;
ddlCoachesType.Enabled = false;
btnUpdate.Visible = true;
btnDelete.Visible = true;
btnCancel.Visible = true;
btnAdd.Visible = false;
}
开发者ID:QuangNguyen263,项目名称:Online-Railway-Reservation-ASP.NET,代码行数:32,代码来源:Coaches_Manager.aspx.cs
示例11: Button1_Click
protected void Button1_Click(object sender, EventArgs e)
{
ServiceReference1.Service1Client ob = new ServiceReference1.Service1Client();
Label1.Text = searchkey;
Label1.Text = ob.NewsFocusService(searchkey);
Label1.Visible = true;
}
开发者ID:Aritra23,项目名称:DSOD-Assignment5,代码行数:7,代码来源:NewsFocus.aspx.cs
示例12: Main
static void Main(string[] args)
{
var client = new ServiceReference1.Service1Client();
var result = client.GetData(5);
Console.WriteLine(result);
Console.ReadLine();
}
开发者ID:bigfont,项目名称:hello-wcf,代码行数:7,代码来源:Program.cs
示例13: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
var client = new ServiceReference1.Service1Client();
var list = client.getPreviews();
gdPreview.DataSource = list;
gdPreview.DataBind();
}
开发者ID:Boeschemayt,项目名称:community,代码行数:7,代码来源:Default.aspx.cs
示例14: AllContacts_Button_Click
private void AllContacts_Button_Click(object sender, RoutedEventArgs e)
{
using (var db = new ServiceReference1.Service1Client())
{
ContactsGrid.ItemsSource = db.GetFullAddrs();
}
}
开发者ID:t2310,项目名称:AddrBook,代码行数:7,代码来源:MainWindow.xaml.cs
示例15: Add_Button_Click
private void Add_Button_Click(object sender, RoutedEventArgs e)
{
using (var db = new ServiceReference1.Service1Client())
{
LogBlock.Text+="Add new row: " + db.AddNewName(fio.Text, tel.Text) + ("\n");
}
}
开发者ID:t2310,项目名称:AddrBook,代码行数:7,代码来源:MainWindow.xaml.cs
示例16: bt_dangbai_Click
private void bt_dangbai_Click(object sender, EventArgs e)
{
if (tb_monan.Text!=""&&tb_gia.Text!="")
{
ThucDon thd = new ThucDon();
thd.IdNhaHang = nh.Id;
thd.MonAn = tb_monan.Text;
thd.NguyenLieu = tb_nguyenlieu.Text;
thd.PhuongPhap = tb_phuongphap.Text;
thd.Gia = int.Parse(tb_gia.Text);
try
{
ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();
client.DangThucDonCompleted += new EventHandler<ServiceReference1.DangThucDonCompletedEventArgs>(DangThucDonCallBack);
client.DangThucDonAsync(thd);
}
catch
{
MessageBox.Show("Lỗi Dịch Vụ !", "Warning: ", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{
MessageBox.Show("Bạn phải nhập tên và giá của món ăn");
}
}
开发者ID:ntdat1390,项目名称:WCF-v1,代码行数:26,代码来源:DangThucDon.cs
示例17: DangThucDon_Load
private void DangThucDon_Load(object sender, EventArgs e)
{
lv_dsketqua.Items.Clear();
client = new ServiceReference1.Service1Client();
client.TimnguoidangCompleted += new EventHandler<ServiceReference1.TimnguoidangCompletedEventArgs>(TimnguoidangCallBack);
client.TimnguoidangAsync(Form1.username);
}
开发者ID:ntdat1390,项目名称:WCF-v1,代码行数:7,代码来源:DangThucDon.cs
示例18: MainPage
public MainPage()
{
InitializeComponent();
ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();
client.getUsernamesAsync();
client.getUsernamesCompleted += client_getUsernamesCompleted;
}
开发者ID:GirtsM,项目名称:Projects,代码行数:7,代码来源:MainPage.xaml.cs
示例19: LoadMissions
protected void LoadMissions()
{
using (var client = new ServiceReference1.Service1Client())
{
List<UppdragStatus> missionList = new List<UppdragStatus>();
//String currUser = HttpContext.Current.User.Identity.Name;
//int eid = client.GetEmployeeByIdNumber(currUser);
//missionList = client.GetMissionsByEid(eid);
uppdrag.Mission.Description = "CGI";
uppdrag.Mission.StartDate = DateTime.Today;
uppdrag.Mission.EID = 1;
uppdrag.Mission.MID = 1;
uppdrag.TravelOrder.Sent = false;
uppdrag.TravelOrder.Approved = false;
uppdrag.TravelOrder.Answered = false;
//Sent, Ap, An
// Skickad 1, 0, 0
// Ej godkänd 1, 0, 1
// Godkänd 1, 1, 1
// Ej skickad 0, 0, 0
missionList.Add(uppdrag);
GridView1.DataSource = missionList;
GridView1.DataBind();
}
}
开发者ID:Bal000,项目名称:VITS-Utbildningar,代码行数:33,代码来源:Uppdrag.aspx.cs
示例20: Button_Click
private void Button_Click(object sender, RoutedEventArgs e)
{
int check = 0;
if (isEmail(username.Text) == false)
{
MessageBox.Show("Email is not correct!");
}
else if (userpass.Password.Trim().Length == 0)
{
MessageBox.Show("Write a password!");
}
else
{
for (int i = 0; i < userList.Count; i++)
{
if (username.Text == userList[i].username)
{
if (userpass.Password == userList[i].password)
{
userID = userList[i].ID_user;
loginpanel.Visibility = Visibility.Collapsed;
tabPanel.Visibility = Visibility.Visible;
check = 1;
ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();
client.getSnakeScoreDataAsync(userID);
client.getSnakeScoreDataCompleted += client_getSnakeScoreDataCompleted;
}
}
}
if (check == 0)
{
MessageBox.Show("Incorrect password or username!");
}
}
}
开发者ID:GirtsM,项目名称:Projects,代码行数:35,代码来源:MainPage.xaml.cs
注:本文中的ServiceReference1.Service1Client类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论