本文整理汇总了C#中ServiceReference1.Service1Client类的典型用法代码示例。如果您正苦于以下问题:C# ServiceReference1.Service1Client类的具体用法?C# ServiceReference1.Service1Client怎么用?C# ServiceReference1.Service1Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceReference1.Service1Client类属于命名空间,在下文中一共展示了ServiceReference1.Service1Client类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例6: TestConnection
public ActionResult TestConnection()
{
ServiceReference1.Service1Client proxy = new ServiceReference1.Service1Client();
ViewBag.Message = proxy.getResponse();
proxy.Close();
return View();
}
示例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;
}
示例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();
}
示例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";
}
}
示例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;
}
示例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;
}
示例12: Main
static void Main(string[] args)
{
var client = new ServiceReference1.Service1Client();
var result = client.GetData(5);
Console.WriteLine(result);
Console.ReadLine();
}
示例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();
}
示例14: AllContacts_Button_Click
private void AllContacts_Button_Click(object sender, RoutedEventArgs e)
{
using (var db = new ServiceReference1.Service1Client())
{
ContactsGrid.ItemsSource = db.GetFullAddrs();
}
}
示例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");
}
}