-
java.lang.IllegalArgumentException: timeout arguments out of range错误
java.lang.IllegalArgumentException:timeoutargumentsoutofrange异常代码如下 longt=list.get(0).getFromTime()-0; for(inti=0;i<list.size();i++) { try { Thread.sleep(t); }catch(Inte...
7198
热度 -
一道关于错误的面试题
一道关于异常的面试题publicclassyichang{ publicstaticvoidmain(String[]args){ System.out.println(testyichang()); } privatestaticinttestyichang(){ //TODOAuto-generatedmethodstub try{ return1; }catch(Exceptio...
4271
热度 -
it.sauronsoftware.ftp4j.FTPException [code=550,message= /DLL:Permission denied,该怎么处理
it.sauronsoftware.ftp4j.FTPException[code=550,message=/DLL:Permissiondeniedpublicvoidcd(Stringpath){try{this.changeDirectory(path);}catch(Exceptione){try{this.createDir(path);this.changeDirectory(path...
10313
热度 -
有一想法,用错误做逻辑判断,有人做过不
有一想法,用异常做逻辑判断,有人做过不例如,信息表以身份证号做主键,新增数据时,填写的身份证号数据库已存在,通过主键唯一性的异常,做逻判断,有人做过吗,做过的是如何实现的color='#e78608'>------解决方案--------------------------------------------------------就在表中添加唯一约束就行啦。你程序insert已存在数据的时候,它...
1148
热度 -
java判断匹配的有关问题
java判断匹配的问题importjava.io.BufferedReader;importjava.io.BufferedWriter;importjava.io.FileNotFoundException;importjava.io.FileOutputStream;importjava.io.FileReader;importjava.io.IOException;importjava.io...
1173
热度 -
【爬虫】使用Post方法爬取网页,但是获取到的是原网页解决方法
【爬虫】使用Post方法爬取网页,但是获取到的是原网页从cnblogs的站内搜索网页提交post表单,爬取cnblogs返回的博客链接。将带有搜索结果的页面保存到文件中。JavacodepackagepostMethod;importjava.io.FileOutputStream;importjava.io.IOException;importjava.io.InputStream;import...
2801
热度 -
creatImage在图片名不确定的时候如何用啊
creatImage在图片名不确定的时候怎么用啊?form=newForm(account.getUserName());Stringss=account.getUserName();System.out.println(ss);try{ Imageimg=Image.createImage(XX); this.append(img); }catch(IOExceptione){ /...
4820
热度 -
如何判断WCF地址是否可用
怎么判断WCF地址是否可用?在系统中用到wcf比如这样使用:AppWebServiceReference.AppWebServiceClientclient=newAppWebServiceReference.AppWebServiceClient();//地址今后由数据库获取client.Endpoint.Address=newEndpointAddress("http://localhost:...
1313
热度 -
建立txt,并把文本框里的数据写入txt,帮帮忙吧.解决思路
建立txt,并把文本框里的数据写入txt,帮帮忙吧...建立txt,并把文本框里的数据写入txt,帮帮忙吧...给我点代码...color='#e78608'>------解决方案--------------------------------------------------------最简单的C#codetry{File.WriteAllText(@"c:\text.txt&quo...
3856
热度 -
有关获取错误有关问题
有关获取异常问题catch(Exceptionex){OffModel.OfficeErrorerr=newOffModel.OfficeError();err.OffError=ex.ToString();returnfalse;}我想把异常转换成string类型方到MODEL中,但是数据存不进去,我也读不出来为什么??publicclassOfficeError{publicstringOff...
2586
热度 -
如何实现加减乘除
怎么实现加减乘除?比如两个textbox,当点击button时,label.text显示两个的值。color='#e78608'>------解决方案--------------------------------------------------------当你2个文本框里面输入是都是数字的时候label.Text=(Convert.ToInt32(textbox1.Text)-Convert...
2599
热度 -
求教 例(aspx?id=1) 如果id为空 或者id不存在跳转到其他的页面,该怎么解决
求教例(aspx?id=1)如果id为空或者id不存在跳转到其他的页面求教aspx?id=1如果id为空或者id不存在跳转到其他的页面。有人让我用try。。catch做,请我怎么做?还有没有其他的办法可以做,那种最好?谢谢了没分了各位大哥见谅color='#e78608'>------解决方案-----------------------------------------------------...
7289
热度 -
怎么判断是否连接数据库成功 如果不成功提示连接失败
如何判断是否连接数据库成功如果不成功提示连接失败为什么我的不提示就是说并且是错误的页面说SA登陆失败我想字定义判断并让他友好提示color='#e78608'>------解决方案--------------------------------------------------------try{链接代码}catch(SqlExceptionex){ex....}不知道是不是这样SqlExcep...
6639
热度 -
代码获取Android的VersionCode跟VersionName信息
代码获取Android的VersionCode和VersionName信息VersionCode升级App版本时用,VersionName显示给用户。/***getAppversionCode*@paramcontext*@return*/publicStringgetVersionCode(Contextcontext){PackageManagerpackageManager=context....
33
热度 -
怎么用ViewPager实现图片的切换
如何用ViewPager实现图片的切换@Override publicObjectinstantiateItem(Viewcontainer,intposition){ ImageViewiv=newImageView(mContext); try { Stringpath=mPaths.get(position); Bitmapbm=BitmapFactory.decodeFile...
55
热度 -
,关于new HttpGet 出现IllegalArgumentException的有关问题
求助,关于newHttpGet出现IllegalArgumentException的问题newHttpGet(Url)出现IllegalArgumentException,前面用的同一个函数,没有问题,参数我也没发现有空字符串,还Trim了!不知道这是由于什么原因产生的请大神指点!请求的代码/** *TODOget请求调用接口 * *@paramurl *@parammTran *@paramma...
0
热度 -
将string部类的时间转换成SQL date 型
将string类型的时间转换成SQLdate型// 将string类型的时间转换成SQLdate型 publicDatedateChange(Stringdate1) { SimpleDateFormatsdf=newSimpleDateFormat("yyyy-MM-dd");java.util.DatecDate; Datedd=null; try{ cDate=sdf.parse(d...
362
热度 -
Window 跟 WindowManagerService建立联系 google android源码
Window和WindowManagerService建立联系googleandroid源码客户端访问服务端的Session。ViewRoot.javapublicstaticIWindowSessiongetWindowSession(LoopermainLooper){synchronized(mStaticInit){if(!mInitialized){try{InputMethodMana...
67
热度 -
android中获取网络图片并展示以及去掉标题
android中获取网络图片并显示以及去掉标题获取网络图片:?publicstaticBitmapreturnBitMap(Stringurl){ URLmyFileUrl=null; Bitmapbitmap=null; HttpURLConnectionconn=null; try{ myFileUrl=newURL(url); }catch(MalformedURLExcept...
70
热度 -
android 线程更新view及数据传接
android线程更新view及数据传送很多新手在启动新线程更新view时会出现“Onlytheoriginalthreadthatcreatedaviewhierarchycantouchitsviews”以下是正确做法第一步:/*启动Thread*/newThread(mTasks).start();第二部:privateRunnablemTasks=newRunnable(){publicv...
60
热度