本文整理汇总了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;
}
}
示例2: VisualizarGrafico
public void VisualizarGrafico(String id)
{
PesquisaOpiniaoVO p = Pesquisas.Find(x=> x.Id == id.ToInt32());
setChart(p.Respostas.ToList());
winGrafico.Render();
winGrafico.Show();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例8: OpenNoticia
public void OpenNoticia(String noticia)
{
winHtmlNoticia.Html = new NoticiaBO().SelectById(noticia.ToInt32()).HTML;
winHtmlNoticia.Show();
}
示例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.", "");
}
}
示例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);
}
示例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;
}
示例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.", "");
}
}
示例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;
}
}
示例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.", "");
}
}
示例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;
}