當前位置: 首頁>>代碼示例>>C#>>正文


C# String.ToInt32方法代碼示例

本文整理匯總了C#中System.String.ToInt32方法的典型用法代碼示例。如果您正苦於以下問題:C# String.ToInt32方法的具體用法?C# String.ToInt32怎麽用?C# String.ToInt32使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.String的用法示例。


在下文中一共展示了String.ToInt32方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TryGetProblemDataPath

        /// <summary>
        /// 獲取題目數據
        /// </summary>
        /// <param name="pid">題目ID</param>
        /// <param name="dataPath">題目數據路徑</param>
        /// <param name="error">錯誤信息</param>
        /// <returns>獲取是否成功</returns>
        public static Boolean TryGetProblemDataPath(String pid, out String dataPath, out String error)
        {
            dataPath = String.Empty;

            try
            {
                error = JudgeStatusManager.GetJudgeServerLoginStatus();

                if (!String.IsNullOrEmpty(error))
                {
                    return false;
                }

                Int32 problemID = pid.ToInt32(0);
                String path = ProblemDataManager.GetProblemDataRealPath(problemID);

                if (String.IsNullOrEmpty(path))
                {
                    error = "Problem data does not exist!";
                    return false;
                }

                dataPath = path;
                return true;
            }
            catch (System.Exception ex)
            {
                error = ex.Message;
                return false;
            }
        }
開發者ID:prostickman,項目名稱:sdnuoj,代碼行數:38,代碼來源:JudgeProblemManager.cs

示例2: VisualizarGrafico

 public void VisualizarGrafico(String id)
 {
     PesquisaOpiniaoVO p = Pesquisas.Find(x=> x.Id == id.ToInt32());
     setChart(p.Respostas.ToList());
     winGrafico.Render();
     winGrafico.Show();
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:7,代碼來源:ResponderPesquisasOpiniao.aspx.cs

示例3: AdicionarConhecimento

 public void AdicionarConhecimento(String id)
 {
     LimparCamposConhecimento();
     TopicoSelecionado = new TopicoBaseConhecimentoBO().SelectById(id.ToInt32());
     this.AcaoTelaBaseConhecimento = Common.AcaoTela.Inclusao;
     winBaseConhecimento.Title = "Cadastrando Conhecimento";
     CarregarTopicos();
     cboTopico.SetValue(TopicoSelecionado.Id);
     winBaseConhecimento.Show();
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:10,代碼來源:GerenciarBaseConhecimento.aspx.cs

示例4: AdicionarArquivo

 public void AdicionarArquivo(String id)
 {
     LimparCamposArquivo();
     TipoSelecionado = new TipoArquivoBO().SelectById(id.ToInt32());
     this.AcaoTelaArquivo = Common.AcaoTela.Inclusao;
     winArquivo.Title = "Cadastrando Arquivo";
     CarregarTipos(TipoSelecionado);
     cboTipo.SetValue(TipoSelecionado.Id);
     winArquivo.Show();
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:10,代碼來源:GerenciarArquivos.aspx.cs

示例5: AdicionarVideo

 public void AdicionarVideo(String id)
 {
     LimparCamposVideo();
     GaleriaSelecionado = new GaleriaBO().SelectById(id.ToInt32());
     this.AcaoTelaVideo = Common.AcaoTela.Inclusao;
     winVideo.Title = "Cadastrando Video";
     CarregarGalerias(GaleriaSelecionado);
     cboGaleria.SetValue(GaleriaSelecionado.Id);
     winVideo.Show();
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:10,代碼來源:GerenciarGaleriasVideos.aspx.cs

示例6: AdicionarItemManual

 public void AdicionarItemManual(String id)
 {
     LimparCamposItemManual();
     TopicoSelecionado = new TopicoManualColaboradorBO().SelectById(id.ToInt32());
     this.AcaoTelaItemManual = Common.AcaoTela.Inclusao;
     winItemManual.Title = "Cadastrando Item";
     CarregarTopicos();
     cboTopico.SetValue(TopicoSelecionado.Id);
     winItemManual.Show();
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:10,代碼來源:GerenciarManualColaborador.aspx.cs

示例7: Statistic

        public ActionResult Statistic(Int32 pid = 0, Int32 id = 1, String lang = "all", String order = "default")
        {
            ContestEntity contest = ViewData["Contest"] as ContestEntity;
            ProblemStatistic ps = SolutionManager.GetProblemStatistic(contest.ContestID, pid);

            String reallang = lang.ToByte(LanguageType.Null.ID).ToString();
            String realorder = order.ToInt32(-1).ToString();

            Dictionary<String, Byte> langs = LanguageManager.GetSupportLanguages(contest.SupportLanguage);
            ViewBag.Languages = langs;

            PagedList<SolutionEntity> list = SolutionManager.GetSolutionList(id, contest.ContestID, pid, null, reallang, ((Byte)ResultType.Accepted).ToString(), realorder);

            ViewBag.ContestProblemID = pid.ToString();
            ViewBag.Language = lang;
            ViewBag.Order = order;

            return ViewWithPager(list, ps, id);
        }
開發者ID:prostickman,項目名稱:sdnuoj,代碼行數:19,代碼來源:ProblemController.cs

示例8: OpenNoticia

 public void OpenNoticia(String noticia)
 {
     winHtmlNoticia.Html = new NoticiaBO().SelectById(noticia.ToInt32()).HTML;
     winHtmlNoticia.Show();
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:5,代碼來源:Master.Master.cs

示例9: RemoverTipo

 public void RemoverTipo(String id)
 {
     try
     {
         TipoArquivoVO tipo = new TipoArquivoBO().SelectById(id.ToInt32());
         new TipoArquivoBO(tipo).DeleteUpdate();
         LoadPagina();
     }
     catch (Exception ex)
     {
         base.MostrarMensagem("Erro", "Erro ao tentar remover pasta.", "");
     }
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:13,代碼來源:GerenciarArquivos.aspx.cs

示例10: Statistic

        public ActionResult Statistic(Int32 pid = 0, Int32 id = 1, String lang = "all", String order = "default")
        {
            ProblemStatistic ps = SolutionManager.GetProblemStatistic(-1, pid);

            String reallang = lang.ToByte(LanguageType.Null.ID).ToString();
            String realorder = order.ToInt32(-1).ToString();

            Dictionary<String, Byte> langs = LanguageManager.MainSubmitSupportLanguages;
            ViewBag.Languages = langs;

            PagedList<SolutionEntity> list = SolutionManager.GetSolutionList(id, -1, pid, null, reallang, ((Byte)ResultType.Accepted).ToString(), realorder);

            ViewBag.Language = lang;
            ViewBag.Order = order;

            return ViewWithPager(list, ps, id);
        }
開發者ID:prostickman,項目名稱:sdnuoj,代碼行數:17,代碼來源:ProblemController.cs

示例11: PreencherCampos

        private void PreencherCampos(String id)
        {
            TipoSelecionado = new TipoArquivoBO().SelectById(id.ToInt32());
            txtTipoNome.Text = TipoSelecionado.Nome;

            txtNome.Hidden = true;
            txtDescricao.Hidden = true;
            txtNome.AllowBlank = true;

            fufArquivoTipo.Hidden = true;
            fufArquivoTipo.AllowBlank = true;

            winTipoArquivo.Height = 120;
        }
開發者ID:rafathan,項目名稱:intranet,代碼行數:14,代碼來源:GerenciarArquivos.aspx.cs

示例12: RemoverGaleria

 public void RemoverGaleria(String id)
 {
     try
     {
         GaleriaVO galeria = new GaleriaBO().SelectById(id.ToInt32());
         new GaleriaBO(galeria).DeleteUpdate();
         LoadPagina();
     }
     catch (Exception ex)
     {
         base.MostrarMensagem("Erro", "Erro ao tentar remover galeria.", "");
     }
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:13,代碼來源:GerenciarGaleriasVideos.aspx.cs

示例13: TryUpdateSolutionStatus

        /// <summary>
        /// 更新評測狀態
        /// </summary>
        /// <param name="sid">提交ID</param>
        /// <param name="pid">題目ID</param>
        /// <param name="username">用戶名</param>
        /// <param name="result">評測結果</param>
        /// <param name="detail">出錯信息</param>
        /// <param name="tcost">花費時間</param>
        /// <param name="mcost">花費內存</param>
        /// <param name="error">錯誤信息</param>
        /// <returns>是否更新成功</returns>
        public static Boolean TryUpdateSolutionStatus(String sid, String pid, String username, String result, String detail, String tcost, String mcost, out String error)
        {
            try
            {
                error = JudgeStatusManager.GetJudgeServerLoginStatus();

                if (!String.IsNullOrEmpty(error))
                {
                    return false;
                }

                SolutionEntity entity = new SolutionEntity()
                {
                    SolutionID = Int32.Parse(sid),
                    ProblemID = pid.ToInt32(0),
                    UserName = username,
                    Result = (ResultType)result.ToByte(0),
                    TimeCost = tcost.ToInt32(0),
                    MemoryCost = mcost.ToInt32(0)
                };

                if (entity.Result > ResultType.Accepted)//沒有題目數據則評測失敗 否則重新評測
                {
                    entity.Result = String.IsNullOrEmpty(ProblemDataManager.GetProblemDataRealPath(entity.ProblemID)) ? ResultType.JudgeFailed : ResultType.RejudgePending;
                }

                SolutionManager.JudgeUpdateSolutionAllResult(entity, detail);

                return true;
            }
            catch (System.Exception ex)
            {
                error = ex.Message;
                return false;
            }
        }
開發者ID:prostickman,項目名稱:sdnuoj,代碼行數:48,代碼來源:JudgeSolutionManager.cs

示例14: RemoverTopico

 public void RemoverTopico(String id)
 {
     try
     {
         TopicoBaseConhecimentoVO topico = new TopicoBaseConhecimentoBO().SelectById(id.ToInt32());
         new TopicoBaseConhecimentoBO(topico).Delete();
         LoadPagina();
     }
     catch (Exception ex)
     {
         base.MostrarMensagem("Erro", "Erro ao tentar remover tópico.", "");
     }
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:13,代碼來源:GerenciarBaseConhecimento.aspx.cs

示例15: PreencherCampos

 private void PreencherCampos(String id)
 {
     TopicoSelecionado = new TopicoBaseConhecimentoBO().SelectById(id.ToInt32());
     txtTitulo.Text = TopicoSelecionado.Titulo;
     txtConhecimentoTopico.AllowBlank = true;
     txtConhecimentoTopico.Hidden = true;
     winTopico.Height = 120;
 }
開發者ID:rafathan,項目名稱:intranet,代碼行數:8,代碼來源:GerenciarBaseConhecimento.aspx.cs


注:本文中的System.String.ToInt32方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。