码迷,mamicode.com
首页 >  
搜索关键字:try    ( 12995个结果
Datetime中yyyy-MM-dd-hh-mm-ss的格式
namespace yyyy_MM_dd_hh_mm{ class Program { static void Main(string[] args) { while (true){ try { Console.WriteLine("请输入您的出生年月日"); DateTime dt = Conve...
分类:其他好文   时间:2015-04-02 22:09:40    阅读次数:125
求奇数偶数的和,,利用while循环
static void Main(string[] args) { while (true) { try { Console.Write("请输入一个数:"); int n = Convert.ToInt32(Console.ReadLine()); int i = 1; int s = 0, z....
分类:其他好文   时间:2015-04-02 20:51:02    阅读次数:152
Jacob操作office文档(Word,PPT,Excel)
publicbooleandoc2pdf(StringsrcFilePath,StringpdfFilePath){ActiveXComponentapp=null;Dispatchdoc=null;try{ComThread.InitSTA();app=newActiveXComponent("W...
分类:其他好文   时间:2015-04-02 20:36:24    阅读次数:207
NPOI导出excel
使用前,导入NPOI dll(测试使用版本:1.2.5.0使用 1 try 2 { 3 string strExcelNamePart ="测试报表"; 4 string strBegin...
分类:其他好文   时间:2015-04-02 18:27:16    阅读次数:196
JUnit 4 如何正确测试异常
本篇讲述如何在JUnit 4下正确测试异常,我会从 try..catch的方式谈起,然后说到 @Test(expected=Exception.class),最后论及 @Rules public ExpectedException的实现方式,最终基本可确定用 @Rules是最方便的。我们在用 JUn...
分类:其他好文   时间:2015-04-02 18:26:55    阅读次数:136
ajax 实例
jsp页面代码:后台action代码:try { /** 获取response对象 */ HttpServletResponse response = ServletActionContext.getResponse(); /** 获取输出o...
分类:Web程序   时间:2015-04-02 18:17:19    阅读次数:153
后台程序控制js弹出框
public void jsWindow(String msg, int i){ HttpServletResponse response=ServletActionContext.getResponse(); try { response.setContentType("text/html...
分类:Web程序   时间:2015-04-02 18:10:52    阅读次数:138
开发STAF扩展插件
开发STAF插件,主要是实现STAFServiceInterfaceLevel30接口,实现init、term、acceptRequest三个方法即可,根据名称可以得知:一个为初始化方法,一个为销毁方法,一个为处理请求方法。   举个例子,我们可以在init中初始化一个handle,然后再term中销毁这个handle   init:   try { fServiceName = inf...
分类:其他好文   时间:2015-04-02 11:47:43    阅读次数:130
python读取并切分
#!/usr/bin/env python import numpy as np fl = open('te.csv') try:   text = fl.readline( ) finally:   print text   #fl.close( ) #print text #data = np.loadtxt("\usr\data\tianchi_mobile_recomm...
分类:编程语言   时间:2015-04-02 09:08:44    阅读次数:195
Add a try-catch with Mono Cecil
Adding exception handlers with Mono.Cecil is not difficult, it just requires you to know how exception handlers are laid out in the metadata.Let say y...
分类:其他好文   时间:2015-04-02 09:00:38    阅读次数:280
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!