Пример #1
0
        private void BtnGenerateSID_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (!validateApiAccount(Context))
                {
                    MessageBox.Show("Pleasse fill in Api Account first.");
                    return;
                }

                GetSessionIDCall gsc = new GetSessionIDCall(Context);
                if(txtRulName.Text==string.Empty)
                {
                    MessageBox.Show("Please input a RuName");
                    return;
                }
                //the rule name can be retrived from the app.config file, otherwise the user must input it himself.

                Context.RuName = txtRulName.Text;
                String sessionID = gsc.GetSessionID(Context.RuName);
                TxtSessionID.Text = sessionID;
            }
            catch(ApiException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #2
0
 public static string GetSessionID()
 {
     ApiContext context = AppSettingHelper.GetGenericApiContext("US");
     GetSessionIDCall calla = new GetSessionIDCall(context);
     return calla.GetSessionID(context.RuName);
 }