当前位置: 首页>>代码示例>>C#>>正文


C# ServiceReference1.Service1Client类代码示例

本文整理汇总了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;
            }


        }
开发者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


注:本文中的ServiceReference1.Service1Client类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。