当前位置: 首页>>代码示例>>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;未经允许,请勿转载。