• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Connect类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Connect的典型用法代码示例。如果您正苦于以下问题:C# Connect类的具体用法?C# Connect怎么用?C# Connect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Connect类属于命名空间,在下文中一共展示了Connect类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Awake

 // Use this for initialization
 void Awake()
 {
     score = 0;
     scoreEditor = 0;
     scorePanel = GetComponent<Text>();
     server = GameObject.FindGameObjectWithTag("Server").GetComponent<Connect>();
 }
开发者ID:hellwilliam,项目名称:DonkeyKongRemake,代码行数:8,代码来源:ScoreManager.cs


示例2: GetAllBranches

 /// <summary>
 /// This method fetches the list of branches from the database.
 /// </summary>
 /// <returns>It returns a data set containing the list of branches.</returns>
 public static DataSet GetAllBranches()
 {
     sql = "SELECT * FROM Branches";
     Connect.ConnectTT();
     c = new Connect(sql);
     return c.ds;
 }
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:11,代码来源:ParticipantRepository.cs


示例3: erlReceive

    public override void erlReceive(Connect connect, ErlKVMessage message)
    {
        if (!MiniConnectManager.IsRobot )
        {
            try
            {

               // Log.debug("===============this is socketReceive! cmd=" + message.Cmd + " jsonString " + message.toJsonString(),true);
            }
            catch (Exception exception)
            {
                //Log.debug(" =================== : " + exception.ToString(),true);
            }
        }
        string cmd = message.Cmd;
        switch (cmd)
        {
            case "r_ok":
            case "r_err":
            {
                int port = message.getPort();
                ErlEntry entry = this.removeReciveFun(port);
                if ((entry == null) || (entry.receiveFun == null))
                {
                    return;
                }
                entry.receiveFun(connect, message);
                break;
            }
            default:
                message.addValue("cmd", new ErlString(cmd));
                this.defaultHandle(connect, message);
                break;
        }
    }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:35,代码来源:DataAccess.cs


示例4: Form1

 public Form1()
 {
     InitializeComponent();
     pref = new prefs();
     pref.Owner = this;
     if (File.Exists("prefs"))
     {
         BinaryFormatter formatter = new BinaryFormatter();
         FileStream inputStream = File.OpenRead("prefs");
         try
         {
             Con = (Connect)formatter.Deserialize(inputStream);
         }
         catch (Exception ex)
         {
             System.Windows.Forms.MessageBox.Show("Ошибка:\n" + ex.Message, "",
                             MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
         }
         inputStream.Close();
     }
     else
     {
         BinaryFormatter formatter = new BinaryFormatter();
         FileStream outputStream = File.OpenWrite("prefs");
         formatter.Serialize(outputStream, Con);
         outputStream.Close();
     }
 }
开发者ID:Taubm,项目名称:RoutSearching,代码行数:29,代码来源:Graph_form.cs


示例5: User

 public User()
 {
     _Updater = new Regulus.Utility.Updater<Regulus.Utility.IUpdatable>();
     _ConnectProvider = new Regulus.Remoting.Ghost.TProvider<TestNativeGameCore.IConnect>();
     _Connecter = new Connect();
     _Complex = new Regulus.Remoting.Ghost.Native.Agent();
 }
开发者ID:kof1016,项目名称:Regulus,代码行数:7,代码来源:User.cs


示例6: GetAllSocieties

 /// <summary>
 /// This method returns all the societies from the database.
 /// </summary>
 /// <returns>It returns a datatable containing all the societies.</returns>
 public static DataTable GetAllSocieties()
 {
     sql = "SELECT * FROM Societies";
     Connect.ConnectEMS();
     c = new Connect(sql);
     return c.ds.Tables[0];
 }
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:11,代码来源:SocietyRepository.cs


示例7: GetAllEvents

 /// <summary>
 /// This method fetches all the events from the database.
 /// </summary>
 /// <returns>It returns a datatable containing all the events.</returns>
 public static DataTable GetAllEvents()
 {
     sql = "SELECT * FROM Events";
     Connect.ConnectEMS();
     c = new Connect(sql);
     return c.ds.Tables[0];
 }
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:11,代码来源:EventRepository.cs


示例8: Start

    //init
    void Start() { 
        //get game objects from scene
        globalObj = GameObject.FindWithTag(TAG_GLOBAL); //global game object
        globalScript = globalObj.GetComponent<Global>(); //global script
        setupObj = GameObject.FindWithTag(TAG_SETUP); //setup game object
        connectScript = setupObj.GetComponent<Connect>(); //connect script
        activateScript = setupObj.GetComponent<Activate>(); //activate script

        //disable scripts to start
        //note: disable/uncheck scripts in the Unity interface
        connectScript.enabled = false;
        activateScript.enabled = false;

        //state manager
        //transition into scene
        //initialize since this is the first scene
        if (StateManager.Instance != null) {
            //set the transition effects for the state manager
            StateManager.Instance.gameObject.GetComponent<TransitionFade>().isFadingIn = true;
            StateManager.Instance.gameObject.GetComponent<TransitionFade>().isHoldFade = false;
        }

        //audio manager
        //initialize since this is the first scene
        if (AudioManager.Instance != null) {
            //set the transition effects for the audio manager
            //bgm
            AudioManager.Instance.switchBgmAfterDelay(AudioManager.Instance.bgmMenu, 0.0f);
            AudioManager.Instance.bgmIsFadingIn = true;
            AudioManager.Instance.bgmIsHoldFade = false;
        }

    } //end function
开发者ID:Ar2rZ,项目名称:tetbeams,代码行数:34,代码来源:SetupManager.cs


示例9: ExpressionHighlighterPlugin

 public ExpressionHighlighterPlugin(Connect con, DTE2 appObject, AddIn addinInstance)
     : base(con, appObject, addinInstance)
 {
     workerToDos.WorkerReportsProgress = false;
     workerToDos.WorkerSupportsCancellation = true;
     workerToDos.DoWork += new System.ComponentModel.DoWorkEventHandler(workerToDos_DoWork);
 }
开发者ID:sgtgold,项目名称:bids-helper-extension,代码行数:7,代码来源:ExpressionHighlighterPlugin.cs


示例10: BtnStart_Click

 protected void BtnStart_Click(object sender, EventArgs e)
 {
     sql = "SELECT SubjectType FROM Subject WHERE SubjectID=" + int.Parse(DDLSubjects.SelectedValue.ToString()) + "";
     c = new Connect(sql);
     if (c.ds.Tables[0].Rows[0]["SubjectType"].ToString().Equals("Theory"))
     {
         sql = "SELECT StudentNo,RollNo,Name FROM Student WHERE SectionID=" + int.Parse(DDLSectionGroup.SelectedValue.ToString()) + " AND Semester=(SELECT Semester FROM Subject WHERE SubjectID=" + int.Parse(DDLSubjects.SelectedValue.ToString()) + ")";
         c = new Connect(sql);
         GridView1.DataSource = c.ds;
         GridView1.DataBind();
     }
     else
     {
         sql = "SELECT StudentNo,RollNo,Name FROM Student WHERE GroupID=" + int.Parse(DDLSectionGroup.SelectedValue.ToString()) + " AND Semester=(SELECT Semester FROM Subject WHERE SubjectID=" + int.Parse(DDLSubjects.SelectedValue.ToString()) + ")";
         c = new Connect(sql);
         GridView1.DataSource = c.ds;
         GridView1.DataBind();
     }
     BtnSubmit.Visible = true;
     sql = "SELECT * FROM AttendanceType";
     c = new Connect(sql);
     foreach (GridViewRow row in GridView1.Rows)
     {
         DropDownList d = (DropDownList)row.FindControl("DDLAttendanceType");
         d.DataSource = c.ds;
         d.DataTextField = "AttendanceTypeName";
         d.DataValueField = "AttendanceTypeID";
         d.Width = 40;
         d.DataBind();
         d.Items[2].Attributes.CssStyle["Color"] = "red";
     }
 }
开发者ID:priyanshu92,项目名称:AttendanceManagementSystem,代码行数:32,代码来源:UploadAttendance.aspx.cs


示例11: Test01

 void Test01()
 {
     var gd = new Connect();
     var sample = new Sample
                      {
                          Method = "GET",
                          Uri = "/test",
                          Timestamp = DateTime.Now.TimeOfDay.TotalMilliseconds,
                          ResponseTime = 100,
                          CpuTime = 20,
                          Context =
                              new[]
                                  {
                                      new Context {Name = "/", ResponseTime = 11},
                                      new Context {Name = "/one", ResponseTime = 12},
                                      new Context {Name = "/two", ResponseTime = 13}
                                  }
                      };
     gd.Init("26873", "testing", logger, null);
     for (int i = 0; i < 1000; i++)
     {
         gd.Store(sample, logger, null);
         Thread.Sleep(300);
     }
     gd.Term(logger, null);
     Console.Read();
 }
开发者ID:alphashack,项目名称:NET_graphdat,代码行数:27,代码来源:Program.cs


示例12: BIDSHelperPluginReference

        public BIDSHelperPluginReference(Type t, DTE2 applicationObject, AddIn addInInstance, Connect addinCore)
        {
            pluginType = t;
            _applicationObject = applicationObject;
            _addInInstance = addInInstance;
            _core = addinCore;

        }
开发者ID:japj,项目名称:bidshelper,代码行数:8,代码来源:BIDSHelperPluginReference.cs


示例13: GetEventDetails

 /// <summary>
 /// This method fetches the details of a particular event.
 /// </summary>
 /// <param name="eventID">An integer parameter containing the ID of the event.</param>
 /// <returns>It returns a data table containing the details of the event.</returns>
 public static DataTable GetEventDetails(int eventID)
 {
     sql = "SELECT * FROM Events WHERE [email protected]";
     string[] s = { "@eventID" };
     Connect.ConnectEMS();
     c = new Connect(sql, s, eventID);
     return c.ds.Tables[0];
 }
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:13,代码来源:EventRepository.cs


示例14: GetStudentDetails

 /// <summary>
 /// This method fetches the details of the student from the EMS database based on the student number.
 /// </summary>
 /// <param name="studentNumber">A string containing the student number of the student.</param>
 /// <returns>It returns a data table containing the details of the student.</returns>
 public static DataTable GetStudentDetails(string studentNumber)
 {
     sql = "SELECT * FROM Students WHERE [email protected]";
     Connect.ConnectEMS();
     string[] s = { "@StudentNo" };
     c = new Connect(sql, s, studentNumber);
     return c.ds.Tables[0];
 }
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:13,代码来源:StudentRepository.cs


示例15: GetOrganiserDetails

 /// <summary>
 /// This method fetches the details of the organiser based on the username and password.
 /// </summary>
 /// <param name="username">A string containing the username of the organiser.</param>
 /// <param name="password">A string containing the password of the organiser.</param>
 /// <returns>It returns a data table containing the details of the organiser.</returns>
 public static DataTable GetOrganiserDetails(string username,string password)
 {
     sql = "SELECT * FROM Login WHERE [email protected] AND [email protected]";
     Connect.ConnectEMS();
     string[] s = { "@username", "@password" };
     c = new Connect(sql, s, username, password);
     return c.ds.Tables[0];
 }
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:14,代码来源:OrganiserRepository.cs


示例16: Awake

 // Use this for initialization
 void Awake()
 {
     gameOverScreen.SetActive(false);
     instance = this;
     GameObject serverObj = GameObject.FindGameObjectWithTag("Server");
     server = serverObj.GetComponent<Connect>();
     dead = 0;
 }
开发者ID:hellwilliam,项目名称:DonkeyKongRemake,代码行数:9,代码来源:GameOverManager.cs


示例17: GetEvents

 /// <summary>
 /// This method fetches the events of a particular society.
 /// </summary>
 /// <param name="societyID">An integer parameter containing the societyID</param>
 /// <returns>It returns a data table containing the events.</returns>
 public static DataTable GetEvents(int societyID)
 {
     sql = "SELECT * FROM EVENTS WHERE [email protected]";
     Connect.ConnectEMS();
     string[] s = { "@societyID" };
     c = new Connect(sql, s, societyID);
     return c.ds.Tables[0];
 }
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:13,代码来源:SocietyRepository.cs


示例18: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["StudentNo"] == null)
            Response.Redirect("~/Default.aspx");
        else
        {
            //-----------Get the details of the student-----------------//
            sql = "SELECT * FROM Student WHERE StudentNo='" + Session["StudentNo"].ToString() + "'";
            student = new Connect(sql);
            LblName.Text = " " + student.ds.Tables[0].Rows[0]["Name"].ToString();
            LblStudentNo.Text = student.ds.Tables[0].Rows[0]["StudentNo"].ToString();
            LblRollNo.Text = student.ds.Tables[0].Rows[0]["RollNo"].ToString();
            LblSemester.Text = student.ds.Tables[0].Rows[0]["Semester"].ToString();

            sql = "SELECT * FROM Department WHERE DepartmentID=" + int.Parse(student.ds.Tables[0].Rows[0]["DepartmentID"].ToString()) + "";
            c = new Connect(sql);
            LblDepartment.Text = c.ds.Tables[0].Rows[0]["DepartmentName"].ToString();
            sql = "SELECT * FROM Section WHERE SectionID=" + int.Parse(student.ds.Tables[0].Rows[0]["SectionID"].ToString()) + "";
            c = new Connect(sql);
            LblSection.Text = c.ds.Tables[0].Rows[0]["SectionName"].ToString();
            sql = "SELECT * FROM Groups WHERE GroupID=" + int.Parse(student.ds.Tables[0].Rows[0]["GroupID"].ToString()) + "";
            c = new Connect(sql);
            LblGroup.Text = c.ds.Tables[0].Rows[0]["GroupName"].ToString();

            //Get the subjects which the student is studying-------------//
            sql = "SELECT * FROM Subject WHERE Semester=" + int.Parse(student.ds.Tables[0].Rows[0]["Semester"].ToString()) + " AND DepartmentID=" + int.Parse(student.ds.Tables[0].Rows[0]["DepartmentID"].ToString()) + "";
            c = new Connect(sql);
            GridView1.DataSource = c.ds;
            GridView1.DataBind();

            //Get the attendance for each subject
            foreach (GridViewRow row in GridView1.Rows)
            {
                sql = "SELECT * FROM Attendance WHERE SubjectID=(SELECT SubjectID FROM Subject WHERE SubjectName='" + row.Cells[1].Text + "' AND Semester=" + int.Parse(student.ds.Tables[0].Rows[0]["Semester"].ToString()) + " AND DepartmentID=" + int.Parse(student.ds.Tables[0].Rows[0]["DepartmentID"].ToString()) + ") AND (SectionID=(SELECT SectionID FROM Section WHERE SectionName='" + LblSection.Text + "') OR GroupID=(SELECT GroupID FROM Groups WHERE GroupName='" + LblGroup.Text + "'))";
                subjectAttendance = new Connect(sql);
                DataTable subjectAttendanceTable = subjectAttendance.ds.Tables[0];
                var totalClasses = (from i in subjectAttendanceTable.AsEnumerable() select new { Date = i.Field<DateTime>("Date"), LectureID = i.Field<int>("LectureID") }).Distinct().Count();
                row.Cells[3].Text = totalClasses.ToString();

                int numberOfAbsent = 0;
                for (int k = 0; k < subjectAttendance.ds.Tables[0].Rows.Count; k++)
                {
                    if (subjectAttendance.ds.Tables[0].Rows[k]["StudentNo"].ToString().Equals(LblStudentNo.Text + "   "))
                    {
                        numberOfAbsent = numberOfAbsent + 1;
                    }
                }
                Label totalPresent = (Label)row.FindControl("LblPresent");
                totalPresent.Text = (totalClasses - numberOfAbsent).ToString();
                Label percentageAttendance = (Label)row.FindControl("LblPercentageAttendance");
                percentageAttendance.Text = (float.Parse(totalPresent.Text) * 100 / totalClasses).ToString();
                if (float.Parse(percentageAttendance.Text) < 75)
                {
                    row.BackColor = System.Drawing.ColorTranslator.FromHtml("#FF8D7C");
                }
            }
        }
    }
开发者ID:priyanshu92,项目名称:AttendanceManagementSystem,代码行数:58,代码来源:ViewAttendance.aspx.cs


示例19: AddNewCollege

 /// <summary>
 /// This method inserts the college into the database.
 /// </summary>
 /// <param name="collegeName">A string containing the name of the college</param>
 /// <returns>It returns the generated id of the college.</returns>
 public static int AddNewCollege(string collegeName)
 {
     sql = "INSERT INTO Colleges(CollegeName) VALUES(@collegeName)";
     Connect.ConnectTT();
     string[] s = { "@collegeName" };
     c = new Connect(sql, s, collegeName);
     int collegeID = -1;
     collegeID = c.lastId;
     return collegeID;
 }
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:15,代码来源:ParticipantRepository.cs


示例20: GetEventID

 /// <summary>
 /// This method returns the event id the team is regisreted in.
 /// </summary>
 /// <param name="teamID">An integer parameter containing the id of the team.</param>
 /// <returns>It returns an integer parameter containing the event id.</returns>
 public static int GetEventID(int teamID)
 {
     sql = "SELECT * FROM EventRegistrations WHERE [email protected]";
     Connect.ConnectEMS();
     string[] s = { "@teamID" };
     c = new Connect(sql, s, teamID);
     if (c.ds.Tables[0].Rows.Count != 0)
         return int.Parse(c.ds.Tables[0].Rows[0]["EventID"].ToString());
     else
         return -1;
 }
开发者ID:priyanshu92,项目名称:EventManagementSystem,代码行数:16,代码来源:TeamRepository.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ConnectState类代码示例发布时间:2022-05-24
下一篇:
C# ConformanceLevel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap