电脑清理--->一键清理---->自动清理按一下就变成“已开启”,再按一下就编程“已关闭”。求一个这样的按钮。

解决方案 »

  1.   

    private void Buttion1_Click(object sender,EventArgs e)
    {
        if(Button1.Text="已开启")
        {
            Button1.Text="已关闭";
        }
    }
      

  2.   


            private void button10_Click(object sender, EventArgs e)
            {
                if (button1.Text == "关闭")
                {
                    button1.Text = "开始";
                }
                else
                {
                    button1.Text = "关闭";
                }
            }
      

  3.   

    受不鸟,麻烦看一下实际的按钮好不,又不是只换text属性
      

  4.   

    实际效果已经看了 还是俩图片 来回切换  用pictureButton 图片按钮  text属性有用啊 用来标示当前状态
      

  5.   

    private void button10_Click(object sender, EventArgs e)
            {
                if (button1.Text == "关闭")
                {
                    button1.Text = "开始";
                }
                else
                {
                    button1.Text = "关闭";
                }
            }
      

  6.   

    不改text属性也行,那就做图片。来回换。
      

  7.   

    那是TabControl的效果吧,如果按钮变成那样,只能重绘
    要么你就自己弄4个按钮去更换图片背景,下边根据上边按钮选择来显示不同的panel
      

  8.   

    sStartStreamNo[MsgStreamNoFieldLength] = '\0';//结束流水号  pTmp = pTmp + MsgStreamNoFieldLength;
    strncpy(sStopStreamNo, pTmp, MsgStreamNoFieldLength); sStopStreamNo[MsgStreamNoFieldLength] = '\0';
    TMsgStat* pMsgStat = &(y8.m_tMsgStat);char szTmpNumCount[11] = {0};memcpy(szTmpNumCount, (k6 + 57), 10);
    szTmpNumCount[10] = '\0';pMsgStat->m_iTotalNum += atoi(szTmpNumCount);// 实现对对账记录条数的检查
     int iActualCheckRecordNum = -1; // 设定为-1是为了不计算对账文件头FILE* fpCounterCheckFile = NULL;
    if (NULL == (fpCounterCheckFile = fopen(sHwCheckPFName, "r"))){
    ERRORLOG("compensateBK() : Cann't open the file(" << sHwCheckPFName << ")."); z1; z2;
    if (0 == iCompFailFlag){ y6;}z9;}while (NULL != fgets(k6, j3, fpCounterCheckFile)){
    k6[strlen(k6) - 1] = '\0';if (strlen(k6) > 0){// 有记录才算是新的一行 iActualCheckRecordNum++; }
    }fclose(fpCounterCheckFile);if (iActualCheckRecordNum != atoi(szTmpNumCount)){ERRORLOG;z9;}}else
    {ERRORLOG;z1;z2;y7;if (0 == iCompFailFlag){ y6; }fclose(fPHwNotExistFile);return COMPENSATE_HEAD_INCORRECT;
    }//组头处理完毕,读下一列continue;}//如果没有头信息,则报错返回else{ ERRORLOG;z1;z2;y7;if (0 == iCompFailFlag)
    { y6;}fclose(fPHwNotExistFile); return COMPENSATE_HEAD_INCORRECT;}}DEBUGLOG;iCount++;
    //如果传送进来的CompFail文件,则传送进来的文件行中最后增加了//sqlcode|,需要将此信息去掉后在进行下面处理
    if (1 == iCompFailFlag){if (strstr(k6, SeparateFlag) != NULL){k6[strlen(k6)-1] = '\0';
    while (k6[strlen(k6)-1] != '|'){k6[strlen(k6)-1] = '\0';}}}//如果不是组头信息,则将此行信息取到pSelectResult中
    if (Wrong == analyseFileLineToRecord(iNodeIndex, k6,pSelectResult)) {ERRORLOG;if (Wrong == 
    writeFailRLogRecordToFile(iNodeIndex, k6,999999, ExcError)){ERRORLOG;}continue;} sTotalfee[0] = '\0';
    //成功将记录取到pSelectResult中,取得交易流水号strcpy(sTradeStreamNo,z4[0].z6);strcpy(sTelCardNumber,z4[3].z6);
    strcpy(sBKResponseCode, z4[9].z6);//为了兼顾处理二次补偿文件(没有文件头),所以MsgCode直接从文件中得到
    strcpy(sCurMsgCode,z4[16].z6);TMsgStat* pMsgStat = &(y8.m_tMsgStat);char szTmpMoney[13] = {0};
    strcpy(szTmpMoney,z4[18].z6);szTmpMoney[12] = '\0';if (Normal == g_iCurTaskType){pMsgStat->m_iTotalMoney += 
    atoi(szTmpMoney);}strcpy(sCallingNumber,z4[5].z6);strcpy(sFeeType, z4[7].z6);sTradeMoney = atoi(z4[8].z6);
     sprintf(sTradeDateTime, "%s%s",z4[10].z6, z4[11].z6);//切换到数据库,第一个数据必须配置为VC的主数据库
    setCurrentDB(z5[0].m_sDBNickName);//对此交易流水号和银行进行对帐iRet = callSPTransBK(sTradeStreamNo, sCurMsgCode,
      

  9.   

    if ((Compensate == y8.m_iExceptionCompensate) && (0 == iCompFailFlag)&& ((0 == strncasecmp(
    MsgAutoHurryRes, sHeadMsgCode, MsgTypeFieldLength))|| (0 == strncasecmp(MsgAutoHurryReq, 
    sHeadMsgCode, MsgTypeFieldLength))|| (0 == strncasecmp(MsgBKPayRes, sHeadMsgCode,
    MsgTypeFieldLength))))){if (Wrong == exceptionCompensateBK(iNodeIndex, fpHwCompFile, 
    sStartStreamNo, sStopStreamNo, sHeadMsgCode)){ERRORLOG;//回收资源,关闭文件  z1;z2;y7; y6;
    return COMPENSATE_EXP_FAILED;}} //回收资源,关闭文件z1;z2;y7;//二次补偿未打开补偿文件
    if (0 == iCompFailFlag){ y6;}return COMPENSATE_SUCCEED;}
    TFTPExitCode transFileByFTP(int iNodeIndex, char* pFileName, const char* pFTPMode){
    if (NULL == pFileName || NULL == pFTPMode){ERRORLOG;return FTP_EXITCODE_FAILED;} y9{ERRORLOG;
     return FTP_EXITCODE_FAILED;}z3 sPath;char sCommand[2 * LengthOfGeneralString];TFTPInfoCfg* pTmp;
    pTmp = &(y8.m_tFTPInfoCfg);//判断要FTP文件所在路径if (ACCOUNT == y8.m_iNodeType){
    strcpy(sPath, TRANSBALANCEACCOUNT_DIR);} else if (BANK == y8.m_iNodeType){strcpy(sPath, 
    TRANSBALANCEBANK_DIR);}...//进入节点对应的目录strcat(sPath , "/");strcat(sPath, y8.m_sNodeNo);
     /*使用脚本文件将文件FTP取到*/ /*ftpfile的命令格式输入参数:1 -- 本地目录(默认为../log)
    2 -- 异地目录(默认为home/log)3 -- 日志文件(缺省为../log/ftp.log)
    4 -- 出错记录文件(缺省为../log/ftp.error)5 -- 传输模式(bin|ascii)
    6 -- 远端主机地址(如10.108.26.125)7 -- 用户名及密码(user username password,缺省为sms qazpl\,)
    8 -- 待执行命令及参数(如get、put、mget、mput等) 9 -- 文件名
    调用格式:ftpfile   -local <localdir>  -remote <remotedir> -logfile <logfile>
    -errfile <errfile> -bin|-ascii -user <username> <password> <remotehost>  <command>
      <parameters of command> (如文件名、目录名等)*/
    sprintf(sCommand, "ftpfile.sh -local %s -remote %s -logfile %s -errfile %s"
     " -ascii -user %s %s %s %s %s", sPath, pTmp->m_sFTPPath, "ftp.log", "ftp.error",
    pTmp->m_sFTPUser, pTmp->m_sFTPPasswd, pTmp->m_sFTPIP, pFTPMode, pFileName);
    TFTPExitCode iRet = (TFTPExitCode)system(sCommand);
    //FTP传送文件成功 if (FTP_EXITCODE_SUCCEED == iRet) {RUNLOG;sleep(g_pConfigMng->m_iFTPTimeOut);
    // 在文件操作成功的情况下,把文件移动到备份目录int iCount = 0;z3* pFileList = NULL;