Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 呃) { saveErr(“HTTP错误!!!!HTTP输出错误!!!>>”+回复); Show(“参数超出范围异常”); } 捕获(异常错误) { saveErr(“主错误==>”+err.ToString()); MessageBox.Show(“主错误”); } /*如果(!reader.IsClosed) reader.Close()*/ findSMS.Enabled=true;_C#_Performance - Fatal编程技术网

C# 呃) { saveErr(“HTTP错误!!!!HTTP输出错误!!!>>”+回复); Show(“参数超出范围异常”); } 捕获(异常错误) { saveErr(“主错误==>”+err.ToString()); MessageBox.Show(“主错误”); } /*如果(!reader.IsClosed) reader.Close()*/ findSMS.Enabled=true;

C# 呃) { saveErr(“HTTP错误!!!!HTTP输出错误!!!>>”+回复); Show(“参数超出范围异常”); } 捕获(异常错误) { saveErr(“主错误==>”+err.ToString()); MessageBox.Show(“主错误”); } /*如果(!reader.IsClosed) reader.Close()*/ findSMS.Enabled=true;,c#,performance,C#,Performance,如果您真的希望在任务管理器中显示程序集,并且内存比丢弃托管代码所需的内存少。作弊的一种方法是使用类似的东西编译应用程序,使应用程序成为本机可执行文件而不是.NET程序集。? 或 另一种方法是使用本机编译代码的,它来自Microsoft(因此可能是可靠/安全的) 来源:15MB不是很多,我认为这不是你的代码,但框架本身消耗了大部分,对此你无能为力。尝试获取较小版本的.NET framework(卸载所有以前的.NET framework)检查此版本: string reply = ""; MySq

如果您真的希望在任务管理器中显示程序集,并且内存比丢弃托管代码所需的内存少。作弊的一种方法是使用类似的东西编译应用程序,使应用程序成为本机可执行文件而不是.NET程序集。?

另一种方法是使用本机编译代码的,它来自Microsoft(因此可能是可靠/安全的)


来源:

15MB不是很多,我认为这不是你的代码,但框架本身消耗了大部分,对此你无能为力。尝试获取较小版本的.NET framework(卸载所有以前的.NET framework)检查此版本:
string reply = "";
MySqlDataReader reader = null;
try
{
    findSMS.Enabled = false;
    findSMS.Interval = 30000;

    if (mycon.State == ConnectionState.Closed)
        mycon.Open();

    MySqlCommand mycmd = null;
    MySqlCommand updatecmd = null;
    string strnewsms = "select * from isms_data where sms_status='processing' and ((id%" 
                    + total_exe + ")=" 
                    + appflag + ") and try<=15 order by id desc limit 0," 
                    + query_limit + "";

    int countupdate1 = 0;

    while (countupdate1 < 10)
    {
        try
        {
            if (mycon.State == ConnectionState.Closed)
            {
                mycon.Open();
            }

            mycmd = mycon.CreateCommand();
            mycmd.CommandText = strnewsms;
            reader = mycmd.ExecuteReader();
            countupdate1 = 0;
        }
        catch (Exception ex)
        {
            mycmd.Dispose();
            if (mycon.State != ConnectionState.Closed)
            {
                mycon.Close();
            }
            Thread.Sleep(2000);
            saveErr("Error Occurred on select command >> " 
                    + ex.ToString() 
                    + " Frequency=" + countupdate1);
            countupdate1++;

        }
        if (countupdate1 == 0)
            break;
    }

    if (countupdate1 > 0)
    {
        string smsTest = "An error has encountered for selecting data For ISMS New Application No " 
            + appflag;
        try
        {
            sendTestSMS("01726300352", smsTest, "0");
            Thread.Sleep(2000);
            sendTestSMS("01722412196", smsTest, "0");
            Thread.Sleep(2000);
            saveErr("Error Occurred on select command");
            MessageBox.Show("select Error >>");
        }
        catch (Exception exx)
        {
            MessageBox.Show("Err");
        }
    }

    reply = "No Processing";
    string msisdn = "No MSISDN";
    string sms = "No Request Found";
    string strupdate = "";
    string stakeholder = "";
    string tarstr = "No Processing";

    if (appmonitor_status == Convert.ToString(1))
        api_status = InsertIntoBit(APPLICATION_ID);

    if (reader.HasRows)
    {
        while (reader.Read())
        {
            findSMS.Interval = 10;
            int id = int.Parse(reader.GetValue(0).ToString());
            stakeholder = reader.GetValue(2).ToString();
            msisdn = reader.GetValue(5).ToString();
            msisdn = msisdn.Replace(" ", "");
            msisdn = msisdn.Replace("-", "");
            sms = reader.GetValue(8).ToString();
            chkdup = reader.GetInt32(11);
            guid = reader.GetValue(14).ToString();
            int startid = -1, endid = -1;

            reply = sendSMS(sms, msisdn, chkdup, guid);

            startid = reply.IndexOf("<SMS_STATUS>");
            endid = reply.IndexOf("</SMS_STATUS>");
            tarstr = reply.Substring((startid + 12), (endid - (startid + 12)));


            int countUpdate = 0;
            while (countUpdate < 10)
            {

                if (tarstr == "SUCCESS")
                {
                    strupdate = "Update isms_data SET sms_status='" 
                        + tarstr 
                        + "',send_time=now(),try=try+100 WHERE id=" 
                        + id.ToString();
                }
                else
                {
                    strupdate = "Update isms_data SET sms_status='" 
                        + tarstr 
                        + "',send_time=now(),try=try+1 WHERE id=" 
                        + id.ToString();
                }

                try
                {
                    if (mycon1.State == ConnectionState.Closed)
                    {
                        mycon1.Open();
                    }

                    updatecmd = mycon1.CreateCommand();
                    updatecmd.CommandText = strupdate;

                    updatecmd.ExecuteNonQuery();
                    countUpdate = 0;
                }

                catch (Exception ex)
                {
                    updatecmd.Dispose();
                    if (mycon1.State != ConnectionState.Closed)
                    {
                        mycon1.Close();
                    }
                    Thread.Sleep(2000);
                    saveErr("Error Occurred on Update command For MSISDN" 
                        + msisdn + ">>" 
                        + ex.ToString() 
                        + " Frequency=" + countUpdate);
                    countUpdate++;
                }

                if (countUpdate == 0)
                    break;
            }

            if (countUpdate > 0)
            {
                string smsTest = "An error has encountered for updating sms status of " 
                    + msisdn + " For " 
                    + stakeholder + " in ISMS Application No >> " + appflag;
                saveErr(smsTest);
                try
                {
                    sendTestSMS("01726300352", smsTest, "0");
                    Thread.Sleep(2000);
                    sendTestSMS("01722412196", smsTest, "0");
                    Thread.Sleep(2000);
                    sendTestSMS("01730070547", smsTest, "0");
                    Thread.Sleep(2000);
                }
                catch (Exception exx)
                {
                    MessageBox.Show("Error in sending test sms for mobile no " + msisdn + "");
                }

                MessageBox.Show("Update Error >>");
            }

            if (sendSMSList.Items.Count >= 20)
                sendSMSList.Items.Clear();

            string[] listdata1 = { msisdn, sms, tarstr };
            ListViewItem li2 = new ListViewItem(listdata1);
            sendSMSList.Items.Add(li2);
            Application.DoEvents();

            //api_status = InsertIntoBit(APPLICATION_ID);
        }
        if (appmonitor_status == Convert.ToString(1))
            api_status = InsertIntoBit(APPLICATION_ID);
    }

    if (!reader.IsClosed)
        reader.Close();

    if (mycon.State != ConnectionState.Closed)
        mycon.Close();
    if (mycon1.State != ConnectionState.Closed)
        mycon1.Close();

    if (sendSMSList.Items.Count >= 20)
        sendSMSList.Items.Clear();

    string msisdn1 = "No MSISDN";
    string sms1 = "No Request Found";
    string tarstr1 = "No Processing";
    string[] listdata = { msisdn1, sms1, tarstr1 };
    ListViewItem li = new ListViewItem(listdata);
    sendSMSList.Items.Add(li);

}

catch (ArgumentOutOfRangeException err)
{
    saveErr("HTTP Error!!!!Wrong Output from http!!! >> " + reply);
    MessageBox.Show("Argument out of range exception");
}

catch (Exception err)
{
    saveErr("Main Error ==> " + err.ToString());
    MessageBox.Show("Main Error");
}

/*if (!reader.IsClosed)
    reader.Close();*/

findSMS.Enabled = true;