为什么输出了两遍??!! [问题点数:20分]

Bbs1
本版专家分:0
结帖率 0%
Bbs6
本版专家分:6127
Blank
黄花 2005年6月 C++ Builder大版内专家分月排行榜第二
2004年11月 C++ Builder大版内专家分月排行榜第二
Blank
蓝花 2006年5月 C/C++大版内专家分月排行榜第三
2006年5月 C++ Builder大版内专家分月排行榜第三
Bbs6
本版专家分:6860
Blank
GitHub 绑定GitHub第三方账户获取
Blank
红花 2019年7月 C/C++大版内专家分月排行榜第一
Blank
黄花 2019年6月 C/C++大版内专家分月排行榜第二
2019年4月 C/C++大版内专家分月排行榜第二
2019年3月 C/C++大版内专家分月排行榜第二
2019年2月 C/C++大版内专家分月排行榜第二
Bbs6
本版专家分:8916
Bbs1
本版专家分:0
Bbs1
本版专家分:0
字符输出了汉字
char a=176,b=219; rnprintf("%c%c%c%c%c\n",a,b,a,b,a);rn为何<em>输出</em>的是“佰佰?”
为什么执行两遍
界面上有一个TEXTBOX,AUTOPOSTBACK=TRUErnTextChanged里写了读库的代码,当我在文本框输入值,并按下回车,它却执行了两遍TextChanged
header输出了一行空行
我用header导出excel的表格。在本地和服务器上别的项目里一切正常。但是在一个项目里导出的表格的第一行是空行。我把他打印出来,在记事本里是正常的,在notepad可以看到第一行有个回车。rn但是我是gb2312编码的。rn求个大佬给个神奇的方案,可以解决这个空行[img=https://img-bbs.csdn.net/upload/201706/23/1498200736_715634.png][/img]rn[img=https://img-bbs.csdn.net/upload/201706/23/1498200846_470818.png][/img]rn[img=https://img-bbs.csdn.net/upload/201706/23/1498200857_27715.png][/img]rnheader头。rn header ("Content-type: application/vnd.ms-excel; charset=GB2312");rn header ("Content-Disposition: attachment; filename=$file.xls");rn换成utf-8无bom会乱码。
这个输出了部分乱码
[code=C/C++]#includernusing namespace std;rnrntemplaternclass temrnrnpublic:rn tem(T1 a,T2 b);rn ~tem();rn void output();rn T1 * h;rn;rnrnrntemplaterntem::tem(T1 a, T2 b) rnrn h=new T1 [b+1];rn for(int i=0; irntem::~tem ()rnrn delete [] h;rn cout<< b(i,a);rn b.output ();rn// b.~tem ();rn rn int P;cin>>P;rn[/code]
PHP执行输出了代码
php从5.3改为5.6,结果以前能执行的程序,就不能正确执行啦!
输出了,不等于NULL!
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); rnConnection con = DriverManager.getConnection("jdbc:odbc:mydbs","sa",""); rnStatement stmt = con.createStatement();rnsqlstr = "select * from tbl_user where name ='"+name+"'";rnResultSet rs = stmt.executeQuery(sqlstr);rn如果查询为空,返回什么?rs = NULL???我<em>输出</em>了,不等于NULL!rn为什么返回的集要按照列的顺序才能取出?修改一下顺序就unexpection condition?rn我记得是可以不按顺序的呀?难道需要什么配置???rn刚刚开始学啊!
为什么会显示两遍呢?
初学者,不要笑呀。rnrnarticle.xmlrn------------begin--------------rn rnrnrn rn 2rn test2rn zsq2rn test2rn 1rn 2003-1-9rnrn rn 1rn testrn zsqrn testrn 1rn 2003-1-8rnrnrn-------------end--------------rnrnarticle.xslrn-------------begin-------------rnrnrnrnrn rnrnrnrn rn rn rn rn rn rn rn rn rn rnrnrnrn------------------end--------------rnrn为什么显示成:rnrn2 test2 zsq2 2003-1-9 rn1 test zsq 2003-1-8 rn2 test2 zsq2 2003-1-9 rn1 test zsq 2003-1-8 rnrn这样呢?rn
datagrid 为什么显示了两遍数据
[code=C#]rnrnDataGrid dg = new DataGrid();rn rn for (int i = 0; i < 13; i++)rn rn BoundColumn bc = new BoundColumn();rn string columns = "";rn switch (i)rn rn case 0: columns = "订单号"; break;rn case 1: columns = "XXXX"; break;rn .........rn ..........rnrn rn bc.DataField = columns;rn bc.HeaderText = columns;rn dg.Columns.Add(bc);rn dg.DataSource = dataset1.Tables[0];rn dg.DataBind();rn//然后dg导出excel发现有两遍数据,怎么解决?rn//不能取消上边的添加列代码 rn// dataset 里有ABCDE 5列,而datagrid只想要ACE 3列 怎么办??rnrn[/code]
简单的汇编代码输出字符到显示器,为什么输出了只是空行?
.model smallrn.stackrn.coderngo:rnmov dl,61hrnmov ah,2hrnint 21hrnend gornrnrnrn我用tasm,tlink生成了可执行文件,运行什么都没有只是<em>输出</em>空行(看到有换行了,但是字符没有显示出来)。 没有<em>输出</em> 61h(字符a). 为什么?
这个程序为什么到了这个函数就不能输出
[code=C/C++][/code]rnDate.hrn#ifndef DATE_H_rn#define DATE_H_rnrn#include rnclass Daternrnprivate:rn int year,month,day;rn static int DaysofMonth[13];rn static int DaysofEvery4Year[4];rnpublic:rn Date()rn Date(int y,int m,int d):year(y),month(m),day(d)rn rnrn void InputDate();rn bool IsLeapYear()const;rn void LeapYearEnable()const;rn int DateGoThough(Date d);rn int Datedays(Date a,Date b);rn Date Datebefore(int n,Date da);rn Date Dateafter(int n,Date da);rnrn Date& operator=(const Date& rhs);rn friend std::ostream &operator<<>y;year=y;rn std::cout<>m;month=m;rn std::cout<>d;day=d;rnrnbool Date::IsLeapYear()constrnrn return (year%4==0&&year%100!=0)||(year%400==0);rnrnvoid Date::LeapYearEnable()constrnrn if (IsLeapYear())rn DaysofMonth[2]=29;rn elsern DaysofMonth[2]=28;rnrnint Date::DateGoThough(Date d)rnrn LeapYearEnable();rn int n=0;rn n+=d.day;rn --d.month;rn while (d.month>=1)rn rn n+=DaysofMonth[d.month];rn --d.month;rn rn return n;rnrnrnDate Date::Datebefore(int n,Date da)rnrn Date d;rn n=da.DateGoThough(da)-n;rn if (n>0) rn rn int y=0;rn while (n>=DaysofEvery4Year[y%4])rn rn n-=DaysofEvery4Year[y%4];rn ++y;rn if (n==DaysofEvery4Year[y%4])rn break;rn rn rn d.year=da.year+y;rn d.LeapYearEnable();rn int m=1;rn while (n>=DaysofMonth[m])rn rn n-=DaysofMonth[m];rn ++m;rn if (n==DaysofMonth[m])rn break;rn rn d.month=m;rn d.day=n;rn rn elsern rn int y=0;rn n=-n;rn while (n>=DaysofEvery4Year[y%4])rn rn n-=DaysofEvery4Year[y%4];rn ++y;rn if (n==DaysofEvery4Year[y%4])rn break;rn rn d.year=da.year-1-y;rn if (da.IsLeapYear())rn rn n=366-n;rn d.LeapYearEnable();rn int m=1;rn while (n>=DaysofMonth[m])rn rn n-=DaysofMonth[m];rn ++m;rn if (n==DaysofMonth[m])rn break;rn rn d.month=m;rn d.day=n;rn rn elsern rn n=365-n;rn d.LeapYearEnable();rn int m=1;rn while (n>=DaysofMonth[m])rn rn n-=DaysofMonth[m];rn ++m;rn if (n==DaysofMonth[m])rn break;rn rn d.month=m;rn d.day=n;rn rn if (n==0)rn rn d.year-=1;rn d.month=12;rn d.day=31;rn rn rn return d;rnrnDate Date::Dateafter(int n,Date da)rnrn Date d;rn n=n+da.DateGoThough(da);rn int y=0;rn while (n>=DaysofEvery4Year[y%4])rn rn n-=DaysofEvery4Year[y%4];rn ++y;rn if (n==DaysofEvery4Year[y%4])rn break;rn rn d.year=da.year+y;rn d.LeapYearEnable();rn int m=1;rn while (n>=DaysofMonth[m])rn rn n-=DaysofMonth[m];rn ++m;rn if (n==DaysofMonth[m])rn break;rn rn d.month=m;rn d.day=n;rn if (d.day==0)rn ++d.day;rn return d;rnrnDate&Date::operator=(const Date& rhs)rnrn if (this!=&rhs)rn rn year=rhs.year;rn month=rhs.month;rn day=rhs.day;rn rn return *this;rnrnrnint Date::Datedays(Date a,Date b)//这里是计算两个日期所隔的天数rnrn int n1=a.DateGoThough(a);//计算日期是当年的多少天rn int n2=b.DateGoThough(b);//计算日期是当年的多少天rn int n=0;rn if (n1>=n2)rn rn n=n1-n2;rn rn elsern rn n=n2-n1;rn rn if (a.year>b.year)//我把这里改成大于号却可以运行rn rn for (int i=b.year;i>n;rn std::cout<
输出了呢">为什么sys.setdefaultencoding("utf-8")后没有输出了呢
![图片说明](https://img-ask.csdn.net/upload/201610/14/1476412524_33878.png)
C求助,为什么数字增大就不能正确输出
请大家看看这段程序,编译之后可以运行,输入四位数也可以正确<em>输出</em>结果,但是输入五位数再大点之后就不能正确<em>输出</em>结果了。都是乱码,纠结中………… rn(其中三维数组zimo[10][10][6]是我用来存储0~9十个数字的LED模式的字模的)rnprintf("intput an number:(0~99999)\n");rn scanf("%d",&nn); /* 请求用户输入一个整数 */rnrn itoa(nn,str,10); /* 将数nn转换成字符串str */rnrn/* 将字符串转换成整形数组 */rnrn conter=-1; /* 字符数统计器初始化 */rn for(i=0;i);rnrn rnrnrnrnrn正确的 <em>输出</em>样式是这样的::rnrn[img=http://0ljqiq.bay.livefilestore.com/y1pNc8A-rmdgoXVcoUlmN7m_ugxig1kGl3LyTehiCaCeWf4YMAIAXqZHSAAWH8HXs9-E38RqTgPJjXekl16icayhTI5zQDD1Xst/%E6%AD%A3%E7%A1%AE.png][/img]rnrnrn输入33658这样的大点的数后就<em>输出</em>这样的了::rn[img=http://0ljqiq.bay.livefilestore.com/y1plCfXYd5ArFBSuWE-Vhxtnagt7b7O3WZ-bd66IwQUZ7AWXHTJ_eGdpcO2zgqT5FaTvT3PbIf15QvsVHq2DadilAFPl_JLZ3Ps/%E9%94%99%E8%AF%AF%E7%9A%84%E8%BE%93%E5%87%BA.png][/img]
为什么调用Invalidate后程序不能输出了????
void CMymenuView::OnTest1()rnrn// Invalidate();rn CClientDC dc(this);rn dc.TextOut(0,0,m_nxingxi[0]);rnrnvoid CMymenuView::OnTest2()rnrn// Invalidate();rn CClientDC dc(this);rn dc.TextOut(0,0,m_nxingxi[1]);rnrnvoid CMymenuView::OnTest3()rnrn// Invalidate();rn CClientDC dc(this);rn dc.TextOut(0,0,m_nxingxi[2]);rnrnvoid CMymenuView::OnTest4()rnrn// Invalidate();rn CClientDC dc(this);rn dc.TextOut(0,0," ");rn dc.TextOut(0,0,m_nxingxi[3]);rnrn
为什么同样是去掉空字符,换个方法就不能输出了呢?
原方法是这样的rn[code=C#] rn /// 16进制转换成字符串 rn public static string HexStringToString(string hs)rn rn //以%分割字符串,并去掉空字符rn string[] chars = hs.Split(new char[] '%' , StringSplitOptions.RemoveEmptyEntries);rn byte[] b = new byte[chars.Length];rn //逐个字符变为16进制字节数据rn for (int i = 0; i < chars.Length; i++)rn rn b[i] = Convert.ToByte(chars[i], 16);rn rn //按照指定编码将字节数组变为字符串rn return Encoding.GetEncoding("GB2312").GetString(b, 0, b.Length);rnrn [/code]rn我把它改成了这样rn[code=C#] public static string HexStringToString(string hs)rn rn //以%分割字符串,并去掉空字符 rn hs.Trim();rn string[] chars = hs.Split(new char[] '%' );rn byte[] b = new byte[chars.Length];rn //逐个字符变为16进制字节数据rn for (int i =1; i < chars.Length; i++)rn rn b[i] = Convert.ToByte(chars[i], 16);rn MessageBox.Show(chars[i]);rn rn //按照指定编码将字节数组变为字符串rn return Encoding.GetEncoding("GB2312").GetString(b, 0, b.Length);rn [/code]rnrn两种方法的chars数组内容是一样的,但是在最后一步,第二种方法就不能<em>输出</em>内容.rn我之所以这样改,是因为wince下不认StringSplitOptions,我只能用其他方法去代替他.rn哪位前辈知道怎样去改写啊?只要绕过StringSplitOptions,能<em>输出</em>正常的GB2312中文就可以.rn非常感谢!
为什么我接收的Code是两遍?...
我使用蓝牙实现条形码扫描仪和手机的通信(通过COM),条形码扫描仪扫描后传给手机的Code传了两遍(一个完整、一个不完整),我的接收程序代码如下:rnvoid CMessageServer::RunL()rn rn if ( iStatus == KErrDisconnected )rn rn // Disconnected so go back to listeningrn StopL();rn StartL();rn return;rn rn else if ( iStatus == KErrAbort )rn rn StopL();rn return;rn rn else if ( iStatus != KErrNone )rn rn StopL();rn return;rn rnrn switch ( iState )rn rn case EConnecting:rn rn // do not accept any more connectionsrn iAdvertiser->UpdateAvailabilityL( EFalse );rn RequestData();rn iState = EWaitingForMessage;rn rn break;rnrn case EWaitingForMessage:rn rn iAppViewExt->Draw2(iBuffer);rn iAcceptedSocket.RecvOneOrMore( iBuffer, 0, iStatus, iLen );rn SetActive();rn rn break;rnrn default:rn Panic( EBTPointToPointReceiverInvalidState );rn break;rn rn rn麻烦大家帮我看看是不是有问题?谢谢。
下载文件的servlet为什么会执行两遍?
代码如下:rnpackage office.servlet;rnrnrnimport javax.servlet.http.*; rnimport javax.servlet.*;rnrnimport java.sql.*;rnimport java.io.*;rnimport office.notify.*;rnrnpublic class showNotify extends HttpServletrnrn public void doGet(HttpServletRequest request, HttpServletResponse response)rn service(request,response);rn rnrn public void doPost(HttpServletRequest request, HttpServletResponse response)rn service(request,response);rn rnrn public void service(HttpServletRequest request, HttpServletResponse response)rn rn tryrn rn rn NotifyExec NotifyExec = new NotifyExec();rn String notifyid="";rn String strExt="";rn String sql = "";rn notifyid=request.getParameter("notifyid");rn strExt=NotifyExec.getOneNotifyExt(notifyid);rn System.out.println(strExt);rn sql = "select affix from of_notify where notifyid="+ notifyid ; rn System.out.println(sql);rn cscec.database.sysdbcon DB = new cscec.database.sysdbcon();rn ResultSet rs = DB.executeQuery(sql);rn while(rs.next())rn rn response.reset();rn if(strExt.equalsIgnoreCase("doc"))rn rn response.setContentType("application/msword");rn rn else if(strExt.equalsIgnoreCase("xls"))rn rn response.setContentType("application/vnd.ms-excel");rn rn else if(strExt.equalsIgnoreCase("jpg"))rn rn response.setContentType("image/jpeg");rn rn else if(strExt.equalsIgnoreCase("txt")) rn response.setContentType("text/plain");rn rn else if(strExt.equalsIgnoreCase("jpeg"))rn rn response.setContentType("image/jpeg");rn rn else if(strExt.equalsIgnoreCase("gif"))rn rn response.setContentType("image/gif");rn rn else if(strExt.equalsIgnoreCase("bmp"))rn rn response.setContentType("image/bmp");rn rn elsern rn response.setContentType("application/octet-stream");rn String fileName = "";rn fileName = rs.getString("affix");rn response.setHeader("Content-Disposition", "filename=" + new String(fileName.getBytes(),"ISO-8859-1")); rn rnrn OutputStream sos = response.getOutputStream();rn InputStream in = null;rn in = rs.getBinaryStream("affix");rnrn int len = 0;rn byte[] b = new byte[1024];rn while((len = in.read(b)) > 0)rn rn sos.write(b,0,len);rn rn b=null;rn in.close();rn sos.close();rn rn rs.close();rn DB.close();rnrn catch(Exception ee)rn ee.printStackTrace();rn rnrnrn
为什么我这段程序总要执行两遍?
我在w_backgrount窗口中的resize事件中写了如下代码:rnp_1.SetReDraw(false)rnuo_1.setredraw(false)rnuo_1.x = 0rnuo_1.y = newheight - uo_1.height + 100rnuo_1.width = newwidthrnp_1.Move(0,0)rnP_1.Resize(this.workspacewidth(),this.WorkspaceHeight())rnp_1.SetReDraw(True)rnuo_1.setredraw(true)rnrn我跟中调试总是一遍执行完后,又执行一遍,所以图象总是要闪烁一下,怎样解决?
ExecuteScalar 为什么会执行两遍SQL语句?
sql = " declare @pid int"rnsql &= " set @pid=" & pidrnsql &= " if @pid>0 begin"rnSql &= "insert into oftool (t_name,parent_id,member_id,mtype) values('" & tname & "'," & pid & "," & memid & "," & kinds & ")"rnsql &= " select @pid as pid end"rnDim cmd As SqlCommand = New SqlCommand(sql, con)rnDim cnt as String = cmd.ExecuteScalarrnif cint(cnt) > 0 then rn response.write("新增数据成功!")rnelsern response.write("新增数据失败!")rnend ifrn执行成功后,我发现数据库里一次新增两条数据rn如果不用 ExecuteScalar 而用 ExecuteNonQuery 就只会新增一条数据rn请问这是什么原因.谢谢!
cout把字符当成int输出了?
[code=C/C++]rn#include rn#include rn#include rnusing namespace std;rnrnint main()rnrn string s("abcdefg");rn string::iterator iter = s.begin();rn while(iter != s.end())rn rn cout << toupper(*iter);rn iter++;rn rn return 0;rn[/code]rnrn为何<em>输出</em>的是65666768697071,即他们的ASCII码?rn要是我把rncout << toupper(*iter);rn改成:rn*iter = toupper(*iter);rncout << *iter;则<em>输出</em>的是ABCDEFGrnrn这是为什么?rn
怎么把上传的图片直接输出
怎么把上传的图片直接<em>输出</em>了,不移动临时文件,直接把tmp_name临时文件 <em>输出</em>了
php 生成json,输出了NULL,何解???
$a=mysql_query("SELECT * FROM `qq` WHERE userid='$userid'");rn $id= 1;rn while($row=mysql_fetch_array($a))rn [color=#FF0000]$name = file_get_contents("http://zx.52reso.com/pznc.php?id=2224503435");[/color]rn $user =new User();rn $user->id = $id++;rn $user->qq = $row["qq"];rn $user->txUrl ='http://q.qlogo.cn/headimg_dl?dst_uin='.$row["qq"].'&spec=100&img_type=jpg';rn [color=#FF0000]$user->qqName = $name;[/color]rn $user->pczx = $row["pczx"];rn $user->txgj = $row["txgj"];rn $user->iphone = $row["iphone"];rn $user->qqmusic = $row["qqmusic"];rn $user->xunzhang = $row["xunzhang"];rn $user->qqgame = $row["qqgame"];rn $user->qqpay = $row["qqpay"];rn $user->qqvip = $row["qqvip"];rn $user->qqhtdy = $row["qqhtdy"];rn $user->qqhtyy = $row["qqhtyy"];rn $user->time = $row["time"];rn $data[]=$user;rn rn rn $json = json_encode($data);rn echo "".'"msg"'.":true,"."\"nr\":".$json."";rnrnrn<em>输出</em>后,qqName是null值,这$name明明是有文本值的,却<em>输出</em>null我就想不明白了,特来求问rnrn[img=https://img-bbs.csdn.net/upload/201603/19/1458366898_771987.png][/img]
显示器突然没有输出了,怎么回事?
winxp的系统。运行中突然显示器没有<em>输出</em>了,显示器的开关指示灯也由原先的黄绿色变成暗黄色了。主机倒是正常的,电源灯和硬盘等都亮的。什么原因?这个现象在一个月中出现了2次。应该不是微软的黑屏吧
printf 输出了2次,不知怎么回事!……
[code=C/C++]rn#include "unp.h"rnrnstatic void sig_cld(int);rnrnint main(int argc, char **argv) rn int listenfd, connfd, udpfd, nready, maxfd1;rn struct sockaddr_in srvaddr, cliaddr;rn fd_set allset, rset;rn size_t len;rn char buff[MAXLINE];rn const int on = 1;rn pid_t pids;rnrn listenfd = socket_e(AF_INET, SOCK_STREAM, 0);rn udpfd = socket_e(AF_INET, SOCK_DGRAM, 0);rnrn bzero(&srvaddr, sizeof(srvaddr));rn srvaddr.sin_family = AF_INET;rn srvaddr.sin_addr.s_addr = htonl(INADDR_ANY);rn srvaddr.sin_port = htons(SRV_PORT);rnrn setsockopt_e(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));rn bind_e(listenfd, (SA*) &srvaddr, sizeof(srvaddr));rn bind_e(udpfd, (SA*) &srvaddr, sizeof(srvaddr));rnrn listen_e(listenfd, LISTENQ);rn rn FD_ZERO(&allset);rn FD_SET(listenfd, &allset);rn FD_SET(udpfd, &allset);rn maxfd1 = MAX(listenfd, udpfd) + 1;rnrn if( (pids = fork()) < 0)rn exit(-1);rn else if(pids)rn exit(0);rn rn setsid();rnrn signal(SIGCHLD, sig_cld);rnrn for( ; ; ) rn rset = allset;rn if( (nready = select(maxfd1, &rset, NULL, NULL, NULL)) < 0) rn if(errno == EINTR)rn continue;rn elsern err_sys("select error");rn rnrn /*TCP connection reached*/rn if(FD_ISSET(listenfd, &rset)) rn pid_t pid;rn char pre_str[100];rn len = sizeof(cliaddr);rn connfd = accept_e(listenfd, (SA*) &cliaddr, &len);rnrn if( !(pid = fork())) rn close_e(listenfd);rn daytime_tcpsrv(connfd);rn exit(0);rn rn fflush(stdout);rnrn [color=#FF0000]/* this message will be print twice occasionally */[/color]rn printf("connection from %s:%d [service handled by process %d]\n",rn inet_ntop(AF_INET, &cliaddr.sin_addr, pre_str, 100),rn ntohs(cliaddr.sin_port),rn pid);rnrn close_e(connfd);rn rnrn /*UDP datagram reached*/rn if(FD_ISSET(udpfd, &rset)) rn char pre_str[100];rn len = sizeof(cliaddr);rn recvfrom_e(udpfd, buff, MAXLINE, 0, (SA*) &cliaddr, &len);rn printf("request from %s:%d\n",rn inet_ntop(AF_INET, &cliaddr.sin_addr, pre_str, 100),rn ntohs(cliaddr.sin_port));rn daytime_udpsrv(udpfd, (SA*) &cliaddr, len);rn /*rn * if daytime_srv returned, this means that servicern * has successfully handled.rn */rn printf("%60s\n", "[serviced]");rn rn rn exit(0);rnrnrnstatic void sig_cld(int signo) rn pid_t pid;rn int stat;rn rn while( (pid = waitpid(-1, &stat, WNOHANG) > 0)) rn fprintf(stdout, "process %d terminated\n", pid);rn rnrn return;rnrnrn[/code]
下面的HTML代码我不想输出了怎么办
一个jsp页面:rnrnrn rn......rn.....rnrnrn我想在满足if条件的情况下,out.println("你的密码不正确!");rn然后下面的html内容就不<em>输出</em>了,怎么可以办到?rn记得asp里面好像有个buffer属性,jsp中也一样吗,是怎么用的?rn
asp 输出了一个表格 怎样分页
asp <em>输出</em>了一个表格 是显示客户信息的 但是客户太多 几千个 怎样分页rn请高手讲一下大致思路。
为何以前的线程无法输出了?
[code=C/C++]rnrn#include "stdafx.h"rn#include rn#include rnusing namespace std;rnDWORD WINAPI threadFunc(LPVOID pParam);rnint _tmain(int argc, _TCHAR* argv[])rnrn int i = 0;rn while (TRUE)rn rn i++;rn CreateThread(NULL,0,threadFunc,&i,0,NULL);rn Sleep(10000);rn rnrnDWORD WINAPI threadFunc(LPVOID pParam)rnrn int* i = (int *)pParam;rn while (TRUE)rn rn cout<<
如何解决!输入超出了文件尾 !!!
content = request.form("s4")rnset rs = server.CreateObject("adodb.recordset")rnsql ="select * from gk"rnrs.open sql,conn,1,3rnrs.addnewrnrs("gk")=contentrnSet fso=Server.CreateObject("Scripting.FileSystemObject")rnSet Mb=fso.OpenTextFile("index.htm")rnMbcontent=Mb.ReadAllrn上面是代码片断,提示Mbcontent=Mb.ReadAll<em>输出</em>超出了文件尾!!!
我又有一本图书输出
     非常高兴,我是通过一位台湾读者在我的51CTO读者圈留言的一封感谢信和收到台湾出版公司的邮件才得知我的《网管员面试宝典》一书<em>输出</em>到了台湾。新书名为《网管人员面试宝典》:http://www.gotop.com.tw/waweb2004/main/home.aspx?pg=HM010X2007&amp;amp;bn=ACN023400。        真是非常高兴,至此我的4本图书正式<em>输出</em>...
页面绑定的时候,HTML直接输出
今天遇到这样个问题,我在后台添加资讯的时候,用的是Fck编辑器,在保存的时候,我用了Server.HtmlEncode 进行编码,在前台绑定的时候,我也用了Server.HtmlDecode进行解码,但是郁闷的是虽然解码是成功了,但是前台的html却不解析,直接<em>输出</em>了。这我那天如何解决,求教各位rnrn绑定后前台<em>输出</em>如下:rn 新华社电 财政部昨日发布消息说,中央财政已决定今年安排20亿元,用于支持节能服务公司采取合同能源管理方式在工业、建筑、交通等领域以及公共机构实行节能改造,此举旨在加快推行合同能源管理,促进我国节能服务产业发展。   财政部、国家发改委已于日前联合出台了《关于印发合同能源管理财政奖励资金管理暂行办法》的通知,明确对节能服务公司以节能效益分享型合同能源管理方式实施的,年节能量在500吨标准煤以上(含)、10000吨标准煤以下的工业节能改造项目给予奖励,其他节能改造项目的节能量下限放宽到100吨标准煤以上(含)。   根据通知,奖励资金将由中央财政和省级财政共同负担。中央财政奖励标准为240元/吨标准煤,省级财政奖励标准不低于60元/吨标准煤。
echo把选项-e输出了?
1.echo -e "hello,world\n"rn<em>输出</em> -e hello,world+换行rnrn2.echo -E "hello,world\n"rn<em>输出</em> -E hello,world+换行rnrnubuntu,Linux version 3.2.0-29-generic-pae 不懂,要不要这个信息呢,呵呵。rn何解?
什么是"输入超出了文件尾 "
源代码rn...rnset fsText = fsFile.OpenAsTextStreamrnstrText = fsText.ReadAllrn....rnrn提示出错内容rnMicrosoft VBScript 运行时错误 错误 '800a003e' rnrn输入超出了文件尾 rnrn/net.asp,行28 rn
没有记录却统计输出了"1"
要统计一篇文章的评论数量rn代码是这样的:rn $strSql="select count(*) from artic where artic_class=$row[articid]";rn $total =mysql_num_rows(mysql_query($strSql,$myconn));rnartic_class,是评论对应的文章ID ,如果文章则值设置为了0rnarticid是文章的ID号rn但是发现即使这篇文章没有任何评论的时候total统计的结果还是1rn这个是什么问题呢
单链表中的结点数据为什么输出两遍
我想实现建立一个单链表,然后将其<em>输出</em>,但是为什么每个结点都<em>输出</em>2遍啊rn#includernstruct nodern int data;rn struct node * next; rn;rnstruct node * createList()rn struct node *head,*p,*r;rn int x;rn char ch;rn p=(struct node*)(malloc(sizeof(struct node)));rn p->next=NULL;//生成头结点 rn head=p;rn r=p;//建立单链表表尾指针 rn while(ch!='#')/为建立与否的标识符 rn rn scanf("%d",&x);rn p=(struct node*)(malloc(sizeof(struct node)));rn p->data=x;rn p->next=NULL;//产生新结点rn r->next=p;//连接新结点 rn r=p;rn ch=getchar();rn rn return head;rnrnint main()rnrn struct node * head,*p;rn head=createList();rn p=head->next;rn while(p->next!=NULL)rn rn printf("%d->",p->data);rn p=p->next; rn rn printf("%d\n",p->data);rn system("pause");rn return 1;rnrn [img=C:\Documents and Settings\Administrator\桌面\未命名.jpg][/img]
方法为什么会执行两遍呢~
表单页面是a1.jsp提交修改,提交给m.jsp,这个JSP去调用一个类中的方法,然后根据此方法返回的值,如果“失败”请求转发给a1.jsp这个提交的页面,如果“成功”重定向到查询页面去。rn现在点击修改后,可以修改成功,但是后台打印却打印了两遍,比如说这个类的这个方法接收一个String a,在方法中打印。a和执行SQL,打印就是这样了:rn-----------------a:...rn-----------------a:...rn-------------SQL:updata......rn-------------SQL:updata......rn但有时就是这样的:rn-----------------a:...rn-------------SQL:updata......rn-----------------a:...rn-------------SQL:updata......rnrn应该是:rn-----------------a:...rn-------------SQL:updata......rnrn这个跟我请求转发回提交页有关吗?rn求助。
网页中的操作被执行了两遍?这是为什么?
程序中有一个按钮,但每次程序都执行了两遍!!!语言c#
为什么要按两遍才能刷新数据? (在线给分)
PB6.5开发.数据库ACCESS 2000. 用ODBC连接.rnrn问题是: 第一次执行事件的时候数据窗口总是没有办法刷新,rn 等第二次执行同一事件的时候数据窗口会显示上一次插入的数据?rnrnrnrnrnrn代码如下:rnrninsert into inout (item,docdate,detail,moneyin,moneyout,moneylast,beizhu) rnvalues (:newitem,:ls_docdate,:ls_detail,0,:ls_moneyout,:ls_moneylast,:ls_beizhu) USING SQLCA;rnrnIf SQLCA.SQLDBCode=0 Thenrn COMMIT using sqlca;//提交事务rnelsern MessageBox("数据库错误","插入失败")rn ROLLBACK USING SQLCA;//事务回滚rn ReturnrnEnd Ifrnw_main.dw_1.SetTransObject(SQLCA)rnw_main.dw_1.Retrieve()
为什么我的datareader显示两遍呢?
string sqlx = "select * from RS_POPEDOM"; rn SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["conStr"]); rn conn.Open(); rn SqlCommand cmd = new SqlCommand(sqlx, conn); rn SqlDataReader rdr = cmd.ExecuteReader(); rn try rn rn while (rdr.Read()) rn rnrn TextBox1.Text += rdr["name"].ToString(); ---我想显示Name字段下所有的信息。可结果却显示两遍。。。不知怎么搞的。不是说这样写就是显示全部吗?我也没有循环代码啊。为什么多显示一次啊。 rnrn rn rn rn finally rn rn if (rdr != null) rn rn rdr.Close(); rn rn rn rn conn.Close();
关于Formshortcut ? 为什么会执行两遍?
想当在表单中按下回车键时,相当于按下某个按钮的,(因SpeedButton没有Default属性),所以想在FormShortCut中执行这个代码,但为什么在测试时会执行两遍,怎样做?rnrnvoid __fastcall TForm1::FormShortCut(TWMKey & Msg, bool &Handle)rnrn if (Msg.CodeChar == VK_RETURN) //回车rn ShowMessage("ShortCut");rnrnrn为什么会执行两遍,两次Show出这个信息,我的表单上还有一个控件Edit,但我再加一个也是执行2次,应该跟这个没关吧,help
为什么运行时jtable中会出现两遍数据
我运行netbeans的时候,jtable会出现两遍数据,而且每次点击搜索按钮,jtable都会多出现一遍重复的数据,大家能不能帮我看看是怎么回事呢rnrn[img=https://img-bbs.csdn.net/upload/201307/07/1373196086_910592.jpg][/img]rnrnrn这是我jtable中的代码rnrn[code=java]rntableModel=new DefaultTableModel(entity.getCustomerInfo(), getTitles());//把客户信息和列名给DefaultTableModelrnrnrncustomerjTable1 = new javax.swing.JTable();rncustomerjTable1.setModel(tableModel);rnjScrollPane1.setViewportView(customerjTable1);rnrn[/code]
求助:为什么消息对话框会执行两遍?
if(MessageBox(" Save changes to Untitled?","Message",MB_YESNOCANCEL)==IDYES)rn rn //执行程序1;rn rnif(MessageBox(" Save changes to Untitled?","Message",MB_YESNOCANCEL)==IDNO)rn rn //执行程序2;rn rn为什么消息对话框总是弹出两遍?该如何才能实现点击消息对话框的YES按钮时执行程序1,点击NO按钮时执行程序2?望指点
为什么javaceript里要写两遍filename?
filename rn为什么javaceript里要写两遍filename?
下面的servlet为什么会被执行两遍阿
package loginServlet;rnrnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpSession;rnimport javax.servlet.http.HttpServlet;rnimport java.io.IOException;rnimport java.sql.*;rnimport java.util.Date;rnrn//import baseServlet.MyBaseServlet;rnimport dbConnection.DBconn;rnimport logManage.Logger;rnrnpublic class BaseLoginServlet extends HttpServletrnpublic void doPost(HttpServletRequest request, HttpServletResponse response)throws IOException,ServletExceptionrn String uid = request.getParameter("userid");rn String upa = request.getParameter("password");rn System.out.println("1......");rn Logger.writeLog(uid+" is trying to login...");rn String error = null;rn boolean passLogin = false;rn if(uid != null && !uid.equals("") && upa != null && !upa.equals(""))rn Connection conn = DBconn.sql_jdbc();rn if(conn != null)rn String sql = "select uID,uPass from user_info where uID='"+uid+"' and uPass='"+upa+"'";rn tryrn Statement stmt = conn.createStatement();rn ResultSet rs = stmt.executeQuery(sql);rn if(rs.next())rn passLogin = true;rn rn elsern error = "帐号或密码错误!"; rn rs.close();rn stmt.close();rn conn.close();rn catch(SQLException sqle)rn error = "数据库连接失败!";rn System.out.println(new Date()+"BaseLoginServlet: "+sqle);rn rn rn elsern error = "数据库连接失败!";rn rn rn if(passLogin == true)rn HttpSession session = request.getSession();rn session.setAttribute("sessionExist","yes");rn session.setAttribute("USERID",uid);rn response.sendRedirect("GetPopedomServlet");rn Logger.writeLog(uid+" finishing login...");rn rn elsern HttpSession session = request.getSession();rn session.setAttribute("error",error);rn response.sendRedirect("index.jsp");rn Logger.writeLog(uid+" fails in login...");rn rnrnrn
swing中的getCellRendererComponent为什么会调用两遍
[code=Java]rnpublic class Test1 rn public static void main(String[] args) rn Test1 t = new Test1();rn t.init();rn rnrn private void init()rn JFrame frame = new JFrame();rn JTable table = new JTable(new Object[][]1,2,3,4,new Object[]"A","B");rn JComboBox jcb = new JComboBox();rn jcb.addItem("1");rn jcb.addItem("2");rn table.setDefaultEditor(Object.class, new MyEditor(jcb));rn table.setDefaultRenderer(Object.class, new MyRenderer());rn frame.add(new JScrollPane(table));rn frame.setVisible(true);rn frame.setSize(400,300);rn frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn rn rn //===================rn class MyRenderer extends DefaultTableCellRendererrn @Overridern public Component getTableCellRendererComponent(JTable table,rn Object value, boolean isSelected, boolean hasFocus, int row,rn int column) rn if(row==1 && column==1)rn JButton jtf = new JButton();rn jtf.setText(value.toString());rn return jtf;rn rn return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);rn rn rn rn class MyEditor extends DefaultCellEditorrn private JComboBox jcb;rn public MyEditor(JComboBox comboBox) rn super(comboBox);rn this.jcb = comboBox;rn rn rn public Component getTableCellEditorComponent(JTable table, Object value,rn boolean isSelected,rn int row, int column) rn return this.jcb;rn rn rnrnrn[/code]rn在getTableCellRendererComponent中为什么会调用两遍?
为什么这段代码有时会执行两遍呢?
with main_form.ADOStoredProc1 dornbeginrn ProcedureName :='sh_cgrk';rn Parameters.Refresh ;rn Parameters.ParamByName('@dj_num').Value :=trim(dj_edit.Text);rn Parameters.ParamByName('@total_money').Value :=total_money_edit.Text ;rn tryrn main_form.ADOStoredProc1.ExecProc; rn exceptrn application.MessageBox('系统执行失败!','提示',mb_ok+mb_iconerror);rn end;rnrnend;rn在程序中执行存储过程时,有时会自动执行两遍,并不是每次都这样,但是几率也挺频繁的,实在找不出原因了。大侠给看看!rn下面是存储过程rnIF EXISTS (SELECT name FROM sysobjects rn WHERE name = 'sh_cgrk' AND type = 'P')rn DROP PROC sh_cgrkrnGOrnCREATE proc sh_cgrkrn( rn@dj_num varchar(100),rn@total_money dec(18,4)rn)rnwith encryptionrnasrndeclarern@line_id varchar(100)rnbegin rnrn--写入cb表 rn insert into cgrk_cb(gsp_id,sp_id,sp_name,sp_dw,sp_lb,sp_jx,sp_gg) rn select @line_id,sp_id,sp_name,sp_dw,sp_lb,sp_jx,sp_gg from cgrk where dj_num=@dj_num rnendrnGOrn
为什么抛出了空指针异常
我是想写一个登录界面,如现有两个界面:UserLogin和MainPagern 我要在UserLogin里单击一个按钮进入MainPage界面我的代码如下:rn mainFrame.setVisible(true);//mainFrame是MainPage的引用rn si.closeConnection();//关闭连接rn this.dispose();//消除对像rnrnrn在mainFrame.setVisible(true)这一行抛了异常:rn Exception in thread "AWT-EventQueue-0" java.lang.NullPointerExceptionrn at liu.model.UserLogin.actionPerformed(UserLogin.java:112)rn at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:19rn95)rn at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.javrna:2318)rn at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModelrn.java:387)rn at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242rn)rn at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonLrnistener.java:236)rn at java.awt.Component.processMouseEvent(Component.java:6038)rn at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)rn at java.awt.Component.processEvent(Component.java:5803)rn at java.awt.Container.processEvent(Container.java:2058)rn at java.awt.Component.dispatchEventImpl(Component.java:4410)rn at java.awt.Container.dispatchEventImpl(Container.java:2116)rn at java.awt.Component.dispatchEvent(Component.java:4240)rn at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322rn)rn at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)rnrn at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)rn at java.awt.Container.dispatchEventImpl(Container.java:2102)rn at java.awt.Window.dispatchEventImpl(Window.java:2429)rn at java.awt.Component.dispatchEvent(Component.java:4240)rn at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)rn at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThrernad.java:273)rn at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.rnjava:183)rn at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThrernad.java:173)rn at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)rnrn at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)rnrn at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)rn如果那位还其他的方法,将更加感谢.rn 排除错误真是累啊!一个通宵没睡都没解决.rn
为什么odbc出了错?
我做了个asp的程序,在其他机器上可以,可就是我的不行,为什么?rnrn错误提示:rnMicrosoft OLE DB Provider for ODBC Drivers (0x80004005)rn/office/asp/opendb.asp, 第 13 行rnrn源程序:rnfunction opendb(sessionname)rn dim connrn if not isobject(session(sessionname)) thenrn Set conn=Server.CreateObject("ADODB.Connection")rn DBPath1=server.MapPath("db/abc.mdb")rn conn.Open "driver=Microsoft Access Driver (*.mdb);dbq=" & DBPath1rn set session(sessionname)=connrn end ifrn set opendb=session(sessionname)rnend function
为什么溢出了?
dim dblTemp as doublerndim lngSpot as longrnrnlngSpot = dblTemp mod 100rnrn为什么当dblTemp = 4000000000时b出现溢出错误,rn当dblTemp = 400000000时还可以的,把lngSpot改为rndouble时还不行,为什么?rnrndblTemp = Abs(Round(dblMoney, 2) * 100)rn lngSpot = (dblTemp Mod 100)
为什么还是溢出了?
[code=C/C++]#includern#includernint main(void)rnrn long long a = pow(2,31);rn printf("%d\n",sizeof(long long));rn printf("%lld",a);rn return 0;rnrn[/code]
为什么输出错误了?
我构造了一个循环单向链表,想实现约瑟夫环问题。为什么在打印<em>输出</em>的时候错误 呢?请大神们帮忙看看,感激不尽!rn#include rn#include rn#include rn#include rnrn#define MAX 100rn#define MIN 80rn#define AMOUNT 5rn#define LOOP 7rnrnrnstruct nodernrn int num;rn node* link;rn;rnbool CreateLoopList(node* head,int amount);rnvoid PrintList(node* head,int amount);rnvoid JosephPrintList(node* head, int amount, int loop);rnrnint main()rnrn node* head = (node*)malloc(sizeof(node));rn head->link = NULL;rn CreateLoopList(head,AMOUNT);rn PrintList(head,AMOUNT);rn JosephPrintList(head,AMOUNT,LOOP);rn return 0;rnrnrnbool CreateLoopList(node* head,int amount)rnrn bool flag = true;rn node* tail = head;rnrn srand((unsigned int)time(NULL));rn for(int i = 0; i < amount-1; i++) //第一次赋值了两个节点rn rn if(head->link == NULL)rn rn head->num = rand()%((MAX+1)-MIN)+MIN; rn rn node* newNode = (node*)malloc(sizeof(node));rn if(newNode == NULL) //内存分配不成功rn rn flag = false;rn break;rn rn newNode->num = rand()%((MAX+1)-MIN)+MIN;rn newNode->link = NULL;rnrn tail->link = newNode;rn tail = newNode;rn rn tail->link = head; //构成循环rn return flag;rnrnrnvoid PrintList(node* head,int amount)rnrn node* tail = head;rn int count = amount;rn while(tail != NULL && count != 0)rn rn printf("%d ", tail->num);rn tail = tail->link;rn count--;rn rn printf("\n");rnrnrnvoid JosephPrintList(node* head, int amount, int loop)rnrn int i,k;rn/* for(i=0; inum);rn rnrn printf("\n");rnrnrn
为什么result输不出来?
结果中的result 为什么输不出来?rnrn#includern#includern#includernvoid longestcommonSubsequence(char*a,char*b,char*result)rnrn int **d;rn int m=strlen(a),n=strlen(b);rn int i,j,len;rn d=(int**)malloc(sizeof(int*)*(m+1));rn for(i=0;i);rn return 0;rn
为什么输不出值?
Area Area1 = (Area)LoadControl("Area.ascx");rnphArea1.Controls.Add(Area1);rnResponse.Write("((DropDownList)phArea1.FindControl('Area1').FindControl('ddlProvince')).SelectedItem.Value");
为什么输不出汉字?
wchar_t *c=L"汉";rn cout<<
ajaxSubmit提交两遍
如果你确认你的情况不是没有return false, 那么可以检查下是不是在ajaxsubmit方法里又放了一遍data参数,ajaxsubmit帮你把你交给他的id的表单参数提交了,你把参数又交给他一遍,所以提交了两遍。
为什么只打出了6行??
#include rn#include rnrnint main()rnrn int i;rn int j;rn bool odd_number=true;rnrn for(i=0;i<<<
为什么没有声音?Bios出了什么问题?
技嘉845D主板,集成声卡,在98下一切正常.在2K(新装上的)却不能听到声音.rnrn状态栏上也没有声音小图标.不知什么原因造成的.rnrn 今天突然发现 bios下的advaced bios(?我很菜,不知道对不对)下面关于从软盘启动\光盘启动什么的,不能够设置了.(显示的是灰白色,不能选择)可是在安装2K之前设置的时候还是可以的呀.不只是什么原因.请大家想想办法.rn
退出了 ,为什么还运行?
在点击事件中,执行unload me ,为什么好像退出了 ,但是在任务管理器中,它 还在运行。
为什么安装jboss2.4.4_tomcat4.0.1出了问题?
新安装的jboss2.4.4_tomcat4.0.1,运行run_with_catalina.bat直到出现 rn[INFO,Default] JBoss-2.4.4 Started in 0m:38s.886 rn的信息也没有出任何错误提示,自带的tomcat-test.ear也deployed了。但是在浏览器输入http://locathost:8080出现HTTP 500 - 内部服务器错误,找不到页面,jboss的窗口也出现错误提示: rn[INFO,EmbeddedCatalinaServiceSX] StandardHost[localhost]: MAPPING configuration rnerror for request URI rn[ERROR,EmbeddedCatalinaServiceSX] HttpProcessor[8080][4] process.invoke rnjava.lang.NullPointerException rn at org.apache.catalina.valves.ErrorDispatcherValve.status(ErrorDispatche rnrValve.java:280) rnrn……, rn究竟怎么才知道jboss-tomcat是否正确运行?那个tomcat-test的页面怎么打开?
程序出了错误,不知道为什么?
系统说我在下面这个地方出了错误:rnusing System.Web.UI.WebControls.DataGrid MyDataGrid;rn说using无效,rn为什么?rn我的具体程序如下:rnnamespace yjs.WebUserControlrnrn using System;rn using System.Data;rn using System.Drawing;rn using System.Web;rn using System.Web.UI.WebControls;rn using System.Web.UI.HtmlControls;rn using System.Data.SqlClient;rnrn /// rn /// WebUserControl_BlockShown 的摘要说明。rn /// rn public class WebUserControl_BlockShown : System.Web.UI.UserControlrn rn using System.Web.UI.WebControls.DataGrid MyDataGrid;rn private void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户代码以初始化页面rn SqlConnection myConnection;rn myConnection = new SqlConnectionrn ("server=(local);database=graduate_student;Trusted_Connection=yes");rn SqlDataAdapter myCommand = new SqlDataAdapterrn ("select distinct * from t_news",myConnection);rnrn DataSet ds = new DataSet();rn myCommand.Fill(ds,"t_news");rnrn MyDataGrid.DataSource= ds.Tables["t_news"].DefaultView;rn MyDataGrid.DataBind();rn rnrn #region Web 窗体设计器生成的代码rn override protected void OnInit(EventArgs e)rn rn //rn // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。rn //rn InitializeComponent();rn base.OnInit(e);rn rn rn /// rn /// 设计器支持所需的方法 - 不要使用代码编辑器rn /// 修改此方法的内容。rn /// rn private void InitializeComponent()rn rn this.Load += new System.EventHandler(this.Page_Load);rnrn rn #endregionrn rnrn
为什么老要我输密码
我建了一个Interbase的数据库,用BDE联上了,但是每次程序启动就问我要密码,我快疯了,用什么方法可以让他自动输入密码呢?
求助:为什么输不出+号?
[code=C/C++]//问题一:输入2 3 +'\n'输不出+号,但输入2 3 + '\n'时就能<em>输出</em>+号,为嘛?rn#include rn#include rnrn#define NUM 'f'rnrnint line = 0;rnint c = 0;rnrnint getop(void)rnrn while ((c = getchar())== ' ' || c == '\t')rn rn ;rn rnrn if (!isdigit(c))rn rn return c;rn rn rn stdin->_ptr--;rnrn scanf("%d", &line);rnrn return NUM;rnrnrnvoid main()rnrn int number = 0;rn int oper = 0;rnrn printf("input:\n");rn while (getop() != '\n')rn rn printf("c = %c\n", c);rn rnrnrn//问题二:输入2 3 + 4 +'\n' 输不出最后一个+号,但输入2 3 + 4 + '\n'就能<em>输出</em>最后一个+号,为嘛?rn#include rn#include rnrn#define NUM 'f'rnrnvoid main()rnrn int number = 0;rn int oper = 2;rnrn printf("input:\n");rn while (oper != '\0')rn rn if (scanf("%d", &number) == 1)rn rn printf("number = %d\n", number);rn oper = NUM;rn rn else if (*stdin->_ptr == '\n' || *stdin->_ptr == ' ')rn rn stdin->_ptr--;rn if (scanf("%c", &oper) == 1)rn rn printf("oper = %c\n", oper);rn rn rn else if (scanf("%c", &oper) == 1)rn rn printf("oper = %c\n", oper);rn rn rn[/code]
为什么输不出字符呢?
#include"stdio.h"rnmain()rnchar a=3,b=6,c;rnc=a^b<,c,);rnrn为什么这个程序得到的答案不是:51,3rn 54,6rn 27rn而是一些数字和图形呢??
为什么这个输出时3,3,3
#include rn#include rnmain()rnint *a,*b,*c;rna=b=c=(int*)malloc(sizeof(int));rn*a=1;*b=2;*c=3;rna=b;rnprintf("%d,%d,%d\n",*a,*b,*c);rn
新人求解为什么输不出no?
折半查找法查找输入的x是否在输入的m个按升序输入的数据rn```rn #include rnint main()rnrn int m,x,i,low=0,mid,high,a[50];rn scanf("%d ",&m);rn high=m-1;rn for(i=0;ix)rn rn high=mid-1;rn rn rn if(low>high)rn printf("no");rn return 0;rnrnrn```
为什么$aar输出时41
[code=php]rn\n";rn if ($numargs >= 2) rn echo "Second argument is: " . func_get_arg(1) . " \n";rn rn $arg_list = func_get_args();rn for ($i = 0; $i < $numargs; $i++) rn echo "Argument $i is: " . $arg_list[$i] . " \n";rn rnrnrnfoo(1, 2, 3);rn?>rn[/code]
C#toolStripMenuItem为什么输不了汉字
我想在菜单项输入汉字,可是输入的总是英文(不是输入法的问题),为什么会这样?
为什么这个输不出结果?
#includernusing namespace std;rnconst n=5,m=10;rnint main()rnrn int i,j,k,max;rn double score[m][n],scoresum[m],scoreavg[m],t;rn for(j=0;j>score[j][i];rn rn rn for(j=0;j
想知道为什么输不出结果?
编译成功了,环境变量也配置啦 CLASSPATH 《%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar》 JAVA_HOME《C:\Program Files\Java\jdk1.6.0_18》 Path《%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%JAVA_HOME%\bin》rn 不知道哪儿不对就是不能<em>输出</em>结果 提示< caused by: java.lang.ClassNotFoundError:hello>rn 《Could not find the main class: hello. 》rnrnrnrnrnrnrnrnpublic class hellornrnrnpublic static void mian(String[] args)rnrnrn rn rn rnSystem.out.println("hello!"); rn rnrnrnrn这是那个代码!文件在F盘
为什么输不出来结果啊
#includernusing namespace std;rnvoid main()rnvoid sort(int a[],int n);rnint a[10];rnint i,k;rncout<<>a[i];rnsort(a,10);rncout<<>k;rncout<a[i-1]) rntemp=a[i];a[i]=a[i-1];a[i-1]=temp;rn
为什么文本输入会不可用?
为什么不起作用,rn我已经改过好几次name属性了,studnet,abc等名称都用了就是不起作用.rnrnrnrn ¹ÜÀíϵͳrn rn rnrnrnrnrnrnrnrn :: ÐÂÉú»ù±¾ÐÅÏ¢Èë²á :: ÐÞ¸ÄѧÉú»ù±¾ÐÅÏ¢ :: ɾ³ýѧÉúÐÅÏ¢ ::rn ÌîдѧÉú×¢²áÐÅÏ¢:rn rn rn rn rn rn rn rn rn ÇëÑ¡ÔñËùÊôרҵ:rn rn rn rn rn ÇëÑ¡Ôñרҵrn rn ">rn rn rn rn rn rn rn rn ÇëÑ¡ÔñËùÊô°à¼¶:rn rn rn rn rn ÇëÑ¡Ôñ°à¼¶rn rn ">rn rn rn rn rn rn rn rn ÇëÌîдѧºÅ:rn rn rn rn rn rn rn rn rn rn ÇëÌîдÐÕÃû£ºrn rn rn rn rn rn rn rn rn rn ÇëÑ¡ÔñÐÔ±ð:rn rn rn ÄÐ : rn rn Å®: rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rnrnrn
repaint()函数要做两遍?
在自定义的class中重载paint();再自定义一个方法如setrepaint();在setrepaint()中rn调用repaint();发现setrepaint()被执行了两遍,同时重绘两次界面.why??rn我这么也没想明白.注:j2me版本,ntt 公司出品.rnmy email address:purples@yeah.netrnwelcome commuication with me by e-mail for this question.
page_load执行两遍
我在page_load事件里初始化了一些变量,当我点击imageButtong时,又执行了一遍page_loadrnrn于是我这样写rn If Not IsPostBack Thenrn 初始化操作rn end ifrnrn当第二编page_load时,由于我这样写,导致了我的变量都成Nothing了,难道要执行两编?
初始化数组走了两遍...
在c#中 我有两个窗体 分别是 登录和注册 还有一个用户信息类 封装了用户字段 在登录窗体建立了 对象数组 在注册页面填充数组 可是我每进一次注册页 都会把上一次填充的给丢掉 为什么??[img=https://img-bbs.csdn.net/upload/201511/02/1446476846_628858.png][/img][img=https://img-bbs.csdn.net/upload/201511/02/1446476815_741069.png][/img]分别是注册和登录代码
启动组的程序启动了两遍
我用2000,莫名其妙,Documents and Settings/ALL User/「开始」菜单/程序/启动,中的程序会反复运行两次。rnrn我把其中的快捷键都移到了Administrator/「开始」菜单/程序/启动,的文件夹中,结果,在 开始/程序/启动中可以看到这些图标,但他们一次都不运行了。rnrn我知道可以在注册表中添加让程序在开机时运行,可实在是够麻烦的。请教高手,这种问题到底是什么原因造成的?解决方法?
OnCmgMsg()执行两遍的问题
问题如下:rnBOOL Ca2Dlg::OnCmdMsg(UINT nID, int nCode,void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)rnrn if(nID == ID_EXIT)rn rn MessageBox(_T("^_^^_^"), _T("NoName"),NULL);rn Ca2Dlg::OnCancel();rn rn elsern rn return CDialog::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);rn rn return 0;rn//此处执行两遍,就是跳出两个MessageBox,不知为何rnrn改成rnBOOL Ca2Dlg::OnCommand( WPARAM wParam, LPARAM lParam )rnrn int wmId = LOWORD(wParam);rn if(wmId == ID_EXIT)rn rn MessageBox(_T("^_^^_^"), _T("NoName"),NULL);rn Ca2Dlg::OnCancel();rn rn elsern rn return CDialog::OnCommand(wParam, lParam);rn rn return 0;rn//这里正确,只执行一遍rnID_EXIT是一个菜单项,我看网上说OnCmdMsg是管理消息路由的rn为什么OnCmdMsg执行两遍,而OnCommand只执行一遍呢?
Log4j输出两遍日志
各位大侠:rn 我的环境是redhat linux9, tomcat4.1.29 jdk1.4.1 使用log4j1.2.8,但是我每次<em>输出</em>日志总是两遍。以下是我的log4j配置文件和日志<em>输出</em>样例:rnlog4j.lcfrn-----------------------------------------------------------------------rnlog4j.rootLogger=debug, Rrnrnlog4j.appender.R=org.apache.log4j.DailyRollingFileAppenderrnrnlog4j.appender.R.File=/home/wp/logs/UNIOrder/UNIOrder.logrnrnlog4j.appender.R.DatePattern='.'yyyy-MM-ddrnrnlog4j.appender.R.layout=org.apache.log4j.PatternLayoutrnrnlog4j.appender.R.layout.ConversionPattern=%p, %t, %c, %dISO8601, - ,%m%nrnrn++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++rnrnUNIOrder.log.2004-08-23rn------------------------------------------------------------------------------rnINFO, http80-Processor69, com.myweb.servlet.DataInit, 2004-08-23 16:19:16,657, - ,Provider Data Initial Start!rnINFO, http80-Processor69, com.myweb.servlet.DataInit, 2004-08-23 16:19:16,658, - ,Provider Data Initial End!rnINFO, HostConfig[localhost], com.myweb.servlet.DataInit, 2004-08-23 16:19:31,422, - ,Provider Data Initial Start!rnINFO, HostConfig[localhost], com.myweb.servlet.DataInit, 2004-08-23 16:19:31,422, - ,Provider Data Initial End!rnINFO, http80-Processor70, com.myweb.servlet.DataInit, 2004-08-23 16:27:54,228, - ,Provider Data Initial Start!rnERROR, http80-Processor70, com.myweb.db.DBOpt, 2004-08-23 16:27:54,528, - ,java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 'MS_OwnerInfo' 无效。rnINFO, http80-Processor70, com.myweb.servlet.DataInit, 2004-08-23 16:27:54,528, - ,Provider Data Initial End!rnINFO, HostConfig[localhost], com.myweb.servlet.DataInit, 2004-08-23 16:28:02,237, - ,Provider Data Initial Start!rnERROR, HostConfig[localhost], com.myweb.db.DBOpt, 2004-08-23 16:28:02,436, - ,java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 'MS_OwnerInfo' 无效。rnINFO, HostConfig[localhost], com.myweb.servlet.DataInit, 2004-08-23 16:28:02,436, - ,Provider Data Initial End!rnINFO, http80-Processor70, com.myweb.servlet.DataInit, 2004-08-23 16:32:31,874, - ,Provider Data Initial Start!rnERROR, http80-Processor70, com.myweb.db.ConnPool, 2004-08-23 16:32:32,004, - ,java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]用户 'UNIOrder' 登录失败。rnINFO, HostConfig[localhost], com.myweb.servlet.DataInit, 2004-08-23 16:32:32,769, - ,Provider Data Initial Start!rnERROR, HostConfig[localhost], com.myweb.db.ConnPool, 2004-08-23 16:32:32,907, - ,java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]用户 'UNIOrder' 登录失败。
为何会执行两遍???
请教:rn 有如下程序:rn//定义变量rnstring ls_ckmc,ls_cllbrnint i,li_rowrnrn//判断仓库名称是否为空rnif ddlb_ckmc.text <> "" thenrn ls_ckmc=trim(ddlb_ckmc.text)rnelsern messagebox("提示!","请选择仓库名称!")rn ddlb_ckmc.setfocus()rn returnrnend if rnrn//判材料类别是否为空rnif ddlb_cllb.text <> "" then rn ls_cllb=trim(ddlb_cllb.text)rnelsern messagebox("提示!","请选择材料类别!")rn ddlb_cllb.setfocus()rn returnrnend if rnrn//根据仓库名称和材料类别检索品名规格并初始化rnif ddlb_cllb.text="" or ddlb_ckmc.text="" thenrnelsern dw_3.settransobject(sqlca)rn dw_3.retrieve(ls_ckmc,ls_cllb)rn li_row=dw_3.rowcount()rn ddlb_pmgg.reset()rn if li_row < 1 thenrn elsern for i=1 to li_rowrn ddlb_pmgg.additem(dw_3.getitemstrin(i,"pmgg"))rn nextrn end if rnend if rnrn我想请教的问题是:rn1、我写这段程序的意思是想根据第一、二个下拉列表框是否为空或它们的内容的改变来决定第三个列表框 的内容,我把这段程序写在第三个下拉列表框的getfocus()中,我不知道把这段程序写在这个事件中是否正确,如果不是,那应该写在什么事件里?rn2、当我执行上面这段程序是,提示信息会重复出现两遍,请问这是为什么,是程序有问题,还是.......rnrn
为什么我在执行 if。。else的时候 重新执行了两遍?
能帮我看看原因吗?rnusing System;rnusing System.Data;rnusing System.Configuration;rnusing System.Collections;rnusing System.Web;rnusing System.Web.Security;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.WebControls.WebParts;rnusing System.Web.UI.HtmlControls;rnusing System.Data.SqlClient;rnusing WSE_Booking.BLL;rnusing WSE_Booking.Model;rnrnpublic partial class M_预约课程5 : System.Web.UI.Pagernrn protected void Page_Load(object sender, EventArgs e)rn rn if (Session["M_Uname"] == null)rn Response.Redirect("WSE_Login.aspx"); rn elsern rn Label1.Text = "";rn SqlDataSource1.SelectCommand = "select * from 课程信息表 where C_Time>'" + DateTime.Now + "' and C_ID in(select C_ID from(select C_ID,COUNT(C_ID) as Times from 定课表 group by C_ID having COUNT(C_ID)'" + DateTime.Now + "' and C_ID not in(select C_ID from 定课表) order by C_ID desc";rn rnrn rn protected void Button1_Click(object sender, EventArgs e)rn rn DateTime a = DateTime.Now;rn if (DropDownList1.SelectedItem.Value.ToString() == "Encounter")rn SqlDataSource1.SelectCommand = "select * from 课程信息表 where C_Time>'" + a + "' and C_Style='Encounter' and C_ID in(select C_ID from(select C_ID,COUNT(C_ID) as Times from 定课表 group by C_ID having COUNT(C_ID)'" + DateTime.Now + "' and C_ID not in(select C_ID from 定课表) order by C_ID desc";rn else if (DropDownList1.SelectedItem.Value.ToString() == "Complementary Class")rn SqlDataSource1.SelectCommand = "select * from 课程信息表 where C_Time>'" + a + "' and C_Style='Complementary Class' and C_ID in(select C_ID from(select C_ID,COUNT(C_ID) as Times from 定课表 group by C_ID having COUNT(C_ID)'" + DateTime.Now + "' and C_ID not in(select C_ID from 定课表) order by C_ID desc";rn else if (DropDownList1.SelectedItem.Value.ToString() == "Social Club")rn SqlDataSource1.SelectCommand = "select * from 课程信息表 where C_Time>'" + a + "' and C_Style='Social Club' and C_ID in(select C_ID from(select C_ID,COUNT(C_ID) as Times from 定课表 group by C_ID having COUNT(C_ID)'" + DateTime.Now + "' and C_ID not in(select C_ID from 定课表) order by C_ID desc";rn elsern SqlDataSource1.SelectCommand = "select * from 课程信息表 where C_Time>'" + a + "' and C_ID in(select C_ID from(select C_ID,COUNT(C_ID) as Times from 定课表 group by C_ID having COUNT(C_ID)'" + DateTime.Now + "' and C_ID not in(select C_ID from 定课表) order by C_ID desc";rn GridView1.DataBind();rnrn rn protected void Button3_Click(object sender, EventArgs e)rn rn for (int i = 0; i < TextBox3.Text.Length; i++)//是否录入的编号为数字rn rn if (char.IsNumber(TextBox3.Text[i]) != true)rn rn Label1.Text = "您输入的编号错误,请重新输入!! ";rnrn rn elsern rn Label1.Text = " ";rn rn if (TextBox3.Text != "" && TextBox4.Text != "" && new 课程信息Bll().Exists2(Convert.ToInt32(TextBox3.Text)) == true)//用户名,编号不能为空,且该课程编号要存在rn rn 定课表 a = new 定课表();rn a.C_ID = Convert.ToInt32(TextBox3.Text);rn a.S_Uname = TextBox4.Text;rn string strCon = "Data Source=53E2ED31D85A42C\\SQLEXPRESS;Initial Catalog=wall steet English Booking System;Integrated Security=True";rn SqlConnection cn = new SqlConnection();rn cn.ConnectionString = strCon;rn cn.Open();rnrn SqlCommand cmd = new SqlCommand();rn cmd.CommandText = "SELECT C_Style FROM 课程信息表 WHERE C_ID='" + TextBox3.Text + "'";rn cmd.Connection = cn;rnrn a.C_Style = Convert.ToString(cmd.ExecuteScalar());rnrnrn SqlCommand cmd1 = new SqlCommand();rn cmd.CommandText = "SELECT C_Time FROM 课程信息表 WHERE C_ID='" + TextBox3.Text + "'";rn cmd.Connection = cn;rnrn a.C_Time = Convert.ToDateTime(cmd.ExecuteScalar());rnrn SqlCommand cmd2 = new SqlCommand();rn cmd.CommandText = "SELECT T_Name FROM 课程信息表 WHERE C_ID='" + TextBox3.Text + "'";rn cmd.Connection = cn;rnrn a.T_Name = Convert.ToString(cmd.ExecuteScalar());rn SqlCommand cmd5 = new SqlCommand();rnrn cmd.CommandText = "SELECT C_Hours FROM 课程信息表 WHERE C_ID='" + TextBox3.Text + "'";rn cmd.Connection = cn;rnrn a.C_Hours = Convert.ToString(cmd.ExecuteScalar());rnrnrn cn.Close();rn if (new 学员信息Bll().Exists(TextBox4.Text) == true)//判断是否存在该用户rn rnrn if (new 定课信息Bll().Exists(Convert.ToInt32(TextBox3.Text)) == false)//验证课程编号在定课表中是否存在,如果不出在课直接添加成功!rn rn new 定课信息Bll().Add(a);rnrn Label1.Text = "课程预约成功!!!";rnrn rn rn else if (new 定课信息Bll().Exists2(TextBox4.Text) == true)//判断是否存在该学员同一个课程的信息,如果不存在,预约成功!rn rn string strCon2 = "Data Source=53E2ED31D85A42C\\SQLEXPRESS;Initial Catalog=wall steet English Booking System;Integrated Security=True";rn SqlConnection cn2 = new SqlConnection();rn cn2.ConnectionString = strCon2;rn cn2.Open();rnrn SqlCommand cmd4 = new SqlCommand();rn cmd4.CommandText = "SELECT C_ID FROM 定课表 WHERE S_Uname='" + TextBox4.Text + "' AND C_ID='" + TextBox3.Text + "'";rn cmd4.Connection = cn2;rn int c;rn c = Convert.ToInt32(cmd4.ExecuteScalar());rnrn if (c == 0)rn rn new 定课信息Bll().Add(a);rnrn Label1.Text = "课程预约成功!!!";rnrn rn elsern rnrn Label1.Text = "定课失败,该学员已经预约过该课程,无法重复预约!";rn rn cn2.Close();rn rn else if (new 定课信息Bll().Exists(Convert.ToInt32(TextBox3.Text)) == true)//判断是否存在该学员同一个课程的信息,如果不存在,预约成功!rn rn string strCon3 = "Data Source=53E2ED31D85A42C\\SQLEXPRESS;Initial Catalog=wall steet English Booking System;Integrated Security=True";rn SqlConnection cn3 = new SqlConnection();rn cn3.ConnectionString = strCon3;rn cn3.Open();rnrn SqlCommand cmd3 = new SqlCommand();rn cmd3.CommandText = "SELECT S_Uname FROM 定课表 WHERE S_Uname='" + TextBox4.Text + "' AND C_ID='" + TextBox3.Text + "'";rn cmd3.Connection = cn3;rn string d;rn d = Convert.ToString(cmd3.ExecuteScalar());rn cn3.Close();rn if (d == null || d.Equals(""))rn rn new 定课信息Bll().Add(a);rnrn Label1.Text = "课程预约成功!!!";rn rn elsern rn Label1.Text = "定课失败,该学员已经预约过该课程,无法重复预约!";rn rn rnrn rn elsern rn Label1.Text = "不存在该用户,请重新输入!!!";rnrn rnrn rn elsern rn Label1.Text = "您没有输入课程编号或用户名或录入的信息有误,请重新录入!!!";rn rnrn rn rn rnrnrnrnrn我在录入信息后,点击 添加后,该程序从if开始执行,执行后,又重新从if开始执行了一遍,这是为什么?能帮我解决下吗?
C#的工程为什么把exe/dll生成了两遍?
我建立一个类库的工程名叫ClassLibrary1,编译以后发现在rnClassLibrary1\obj\Debug和ClassLibrary1\bin\Debug下面都生成了一个dll,同名,而且大小相同,奇怪了。rnrn我如果建立一个控制台程序的话,发现会有一样的现象。以上现象也适用于Release版本。rn感觉有点多余啊,obj目录下面难道不是应该只是存放一些中间文件的吗,最终的exe/dll为什么这里也有一份?rn
为什么我的ashx中的代码会执行两遍
我是用的easyui 的form表单提交将数据传到到ashx中。rnashx文件中的代码:rn[code=csharp]public class register : IHttpHandler rn public void ProcessRequest (HttpContext context) rn context.Response.ContentType = "text/html";rn string aa = context.Request.ToString();rn string uname = context.Request["uname"].ToString();rn string tname = context.Request["tname"].ToString();rn string pwd = context.Request["pwd"].ToString();rn string role = context.Request["role"].ToString();rn int res = new Class_bll.UserBll().Register(uname, tname, pwd, role);rn if (res > 0)rn rn context.Response.Write(" ");rn rn elsern rn context.Response.Write(" ");rn rn rn rn public bool IsReusable rn get rn return false;rn rn rn[/code]rnrnjs代码:rn[code=javascript]$(".submit").click(function () rn uname = $("#firstname").val().toString().trim();rn tname = $("#truename").val().toString().trim();rn pwd = $("#confirm_password").val().toString().trim();rn role = $("#DropDownList_Role").val().toString().trim();rn $('#signupForm').form('submit', rn url: "/register.ashx?uname=" + uname + "&tname=" + tname + "&pwd=" + pwd + "&role=" + role,rn dataType: "json",rn onSubmit: function () rn return $(this).form('validate');rn ,rn success: function (result) rn rn rn );rn );[/code]rnrn求解 为什么ashx中的每一行代码会执行两遍,最终会插入两条数据
为什么点击一下按钮会提交两遍页面?
页面A中有一按钮a,点击a后将A内表单提交到页面B,但不知为何,点击a后B页面要连续执行两遍,各位有谁遇到过此种问题,如何解决?
怎么回事啊????为什么输不出,输不出啊,,,backspace->\b
#include rn rn#define ESC_CHAR '\\'rn rnint main(void)rnrn int c;rn rn while((c = getchar()) != EOF)rn rn switch(c)rn rn case '\b':rn /* The OS on which I tested this (NT) intercepts \b characters. */rn putchar(ESC_CHAR);rn putchar('b');rn break;rn case '\t':rn putchar(ESC_CHAR);rn putchar('t');rn break;rn case ESC_CHAR:rn putchar(ESC_CHAR);rn putchar(ESC_CHAR);rn break;rn default:rn putchar(c);rn break;rn rn rn return 0;rn rn明明在键盘上敲了backspace,但是就是输不出\b啊~~~求解,尽详讲~~~~~~~~~~
为什么输出到标准输出输出到文件还慢呢
每次都用了flush.
页面提交时,为什么Page_Load函数总是执行两遍?
在一个登陆页面中,当用户按“提交”时,程序会对用户填写的信息进行核对。我采用的时button的click事件,如下: rn rnprotected void SubmitBtn_Click(Object sender, EventArgs e) rn rn if (Page.IsValid == true) rn Response.Redirect("login.aspx?action=chk");//其实就是返回本页面 rn rn然后在该页面的Page_Load函数中, rnif(Request.QueryString["action"]=="chklogin") rn rn string user = username.Text; rn string pwd = password.Text; rn rn但是我发现当我按了“登陆”按钮后,总是先执行一遍Page_Load函数,这时Request.QueryString["action"]是空的,然后才会触发SubmitBtn_Click事件,再去执行的时候username.Text和password.Text的值都是空了。 rn很奇怪,为什么Page_Load函数会执行两次,而且第一次执行以后,会把我原来填写的信息都冲掉。 rn高手帮忙!
为什么我的这个程序中的循环会执行两遍
我的代码如下,请大家看看,最后页面上显示的结果是123456123456,请务必帮忙rnrnrnrnrnrn rnrnrnrnrnrn
springMVC@Value取不到值,直接输出了${name}字符串
对于小白来说今天在项目遇到@Value(${xxx})取出来的时候还是${xxx};我就郁闷了为什么?后来在网上查了一下:如果取不到值。检查下配置文件是否符合:在使用spring mvc时,实际上是两个spring容器: 1,dispatcher-servlet.xml 是一个,我们的controller就在这里,所以这个里面也需要注入属性文件 org.springframework.web.se...
输出了6594??">int i=1;printf("%d",&i);怎么输出了6594??
如题,i在运行中却是正确的!!rn这是怎么回事!!!!!!!!!!!
一个字节竟输出了四个字节的值.
我写的一段代码:rn rn float c =-2;rn char *b = (char *)&c;rn printf("%x\t",b[3]);rn printf("%d",sizeof(b[3]));rn 竟然<em>输出</em>: rn ffffffc0 1rn b[3]明明只有一个字节,为什么却<em>输出</em>了四字节的数值,请高手指点迷津.
@Value取不到值,直接输出了${name}字符串
解决方法 分别在spring-config.xml和springMVC-config.xml中配置 &amp;lt;context:property-placeholder location=&quot;classpath:resource.properties&quot; ignore-unresolvable=&quot;true&quot;/&amp;gt;  
怎么用拦截器知道HttpServletResponse向前台输出了内容
scenario是这样的:ajax向action发起一个业务调用,如果失败,会用HttpServletResponse向前台<em>输出</em>错误消息,我想用拦截器进行拦截,在不修改action的基础上,如果出现错误,做一些别的操作.rnrn[code=Java]rnpublic void updateReport() throws Exception //要调用的业务方法rn rn try rn bo.insert(...);rn rn catch (Exception e) rn setResErrMsg(MessageUtil.getMessage(e.getMessage(), new Object[0]));rn rn rnrn rnrnprotected void setResErrMsg(String errMsg) throws IOException rn rn HttpServletResponse res = ServletActionContext.getResponse();rnrnrnrn res.setContentType("test/html;charset=Shift-Jis");rn OutputStreamWriter writer =rn new OutputStreamWriter(res.getOutputStream(),ApplicationInfo.getNativeEncoding());rnrn try rn JSONObject obj = new JSONObject();rn obj.put("errMsg", errMsg);rn writer.write(obj.toString());rn rn finally rn writer.flush();rn writer.close();rn rn rn[/code]rnrn如果实在没办法,只能重构action,加上一个标志boolean来判断了.
页面没解析,直接输出了,请问是怎么回事?
[code=HTML]rnrnrnrn rn JQuery学习笔记三(Get Post)rn rn rnrnrn 输入姓名和生日rn姓名: rn生日:rn rnrnrn rn rnrnrn[/code]rn[code=HTML]rnrnrnrnrn[/code]rn[img=http://hi.csdn.net/attachment/201005/5/64639_12730285539977.jpg][/img]rn请问为什么我的结果是%3C%25@%20Page%20Language=%22C#%22%20ContentType=%22text/html%22%20ResponseEncoding=%22gb2312%22%20%25%3E%0D%0A%3C%25@%20Import%20Namespace=%22System.Data%22%20%25%3E%0D%0A%3C%25%0D%0A%09if(Request.HttpMethod%20==%20%22POST%22)%0D%0A%09%09Response.Write(%22POST:%20%22%20+%20Request%5B%22sFirstName%22%5D%20+%20%22,Birthday:%20%22%20+%20Request%5B%22sTwoName%22%5D);%0D%0A%09else%20if(Request.HttpMethod%20==%20%22GET%22)%0D%0A%09%09Response.Write(%22GET:%20%22%20+%20Request%5B%22sFirstName%22%5D%20+%20%22,Birthday:%20%22%20+%20Request%5B%22sTwoName%22%5D);%0D%0A%25%3E%0D%0A
这样定义过后,是不是没有信息输出了?
#define ERRORMSG(cond,printf_exp) ((void)0)rn#define RETAILMSG(cond,printf_exp) ((void)0)rn#define DEBUGMSG(cond,printf_exp) ((void)0)rnrn这样定义过后,rn是不是程序(代码)中的rnERRORMSG(cond,printf_exp), RETAILMSG(cond,printf_exp), DEBUGMSG(cond,printf_exp)rn没有信息<em>输出</em>了?rn
形参里的变量名和类的成员变量一样就不能正常输出了。
#include rn//rnclass pointrnrnpublic:rn int x;rn int y;rn point()rn rn x=0;rn y=0;rn rn point(int a,int b)rn rn x=a;rn y=b;rn rn void output()rn rn cout<
dc.DrawText输出了一些内容,怎么清除呢?
向屏幕写了一些字,然后想清除掉,怎么弄?rn
redhat5.x下安装jdk1.5及tomcat5.0.doc下载
redhat5.x下安装jdk1.5及tomcat5.0.doc 相关下载链接:[url=//download.csdn.net/download/pansw2/2034701?utm_source=bbsseo]//download.csdn.net/download/pansw2/2034701?utm_source=bbsseo[/url]
v880 刷机教程下载
中兴V880刷机教程详细图解,中兴V880刷机教程详细图解 相关下载链接:[url=//download.csdn.net/download/zy287665405/3977034?utm_source=bbsseo]//download.csdn.net/download/zy287665405/3977034?utm_source=bbsseo[/url]
WORD转FDF打印机下载
用于把WORD 转换成PDF文件。简单易用。 相关下载链接:[url=//download.csdn.net/download/u013701610/6940931?utm_source=bbsseo]//download.csdn.net/download/u013701610/6940931?utm_source=bbsseo[/url]
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview
我们是很有底线的