帮忙改一下代码! [问题点数:30分,结帖人freshstudent]

Bbs1
本版专家分:0
结帖率 100%
Bbs6
本版专家分:5589
Bbs8
本版专家分:39696
Blank
红花 2003年7月 Delphi大版内专家分月排行榜第一
2003年6月 Delphi大版内专家分月排行榜第一
2003年5月 Delphi大版内专家分月排行榜第一
Bbs5
本版专家分:2603
帮忙一下这段代码
[code=C/C++]#includernrnHHOOK g_hMouse=NULL;rnHWND m_hwnd=GetActiveWindow(); rntagMOUSEHOOKSTRUCT mhs;rnmhs.hwnd=m_hwnd;rnLRESULT CALLBACK MouseProc(rn HC_ACTION, // hook codern WM_LBUTTONDBLCLK, // message identifierrn &mhs // mouse coordinatesrn)rnrn return 1;rnrnrnvoid SetHook(HWND hwnd)rnrn g_hMouse=SetWindowsHookEx(WH_MOUSE,MouseProc,GetModuleHandle("HOOK"),0);rn[/code]rnrn我的目的是 在鼠标双击的时候,判断应用程序名,如果是QQ,关闭程序
谁能帮忙一下代码
<em>代码</em>如下:rn[code=C#]string abcd;rn string wccx="";rn Random myRand = new Random();rn abcd=myRand.Next(0,13).ToString();rn if(abcd=="0")rn rn wccx="yyy@163.com";rn rn else if(abcd=="1")rn rn wccx="xxxx@126.com";rn rn....rn......//等等中间省略rnelse if(abcd=="13")rn rn wccx="xx99@126.com";rn rnrn[/code]rnrnrn我想<em>改</em>成swich来实现,不知如何写?或者有更高明的写法,大家各显神通。rn
跪求,帮忙一下代码!!!
这是一个用c语言写的简易计算器的<em>代码</em>,我想把它<em>改</em>为c++的,可是我c++学的不精,不知道怎么<em>改</em>,大家帮<em>帮忙</em>吧。rnrnrnrn#includern#includern#includern#includernstruct shuju//数据的每一个节点rndouble a;shuju * next;;rnstruct yunsuan //元算符的每一个节点rnchar a;yunsuan * next;;//设计的是链栈程序rnshuju * tops;yunsuan * topc;int i;rn///字符串到浮点型的转换///..只保留6位有效数字rn////在字符串中提取数字rndouble ftd(char * a)rndouble sj;double j=-1.0;sj=0;rnwhile(*a>=48 && *a=48 && *aa=x;//数据的进出“栈”rnp->next=tops;tops=p;rndouble pops(shuju * a) rnrn shuju * q; double pq;rn q=tops;pq=q->a ;rn tops=tops->next;rn free(q); return pq; rnrnvoid push(char x)rn yunsuan * p;p=new yunsuan;rnp->a=x;p->next=topc;topc=p; rnchar pop(yunsuan * a)//运算符的进出“栈”rnyunsuan * q;char ss ;q=topc;ss=q->a;rn topc=topc->next; free(q); return ss ;rndouble zz(double a,char b,double c)rnswitch(b)rncase 42:return a*c;rncase 43:return a+c;rncase 45:return c-a;rncase 47:if(a==0)coutnext=NULL;char as[100];rncoutnext!=NULL&&topc->next->next!=NULL&&bijiao(topc->next->a,topc->a)==60) rn rn char ls;double l=pops(tops);rn ls=pop(topc);rn mm=zz(l,pop(topc),pops(tops));rn pushs(mm);push(ls);rn rn i=i+1;break;rn case 62:push(as[i]);i=i+1;break;rn rn break;rn default:cout<<<
帮忙一下 下面的代码
大家好 这个是我需要修<em>改</em>的<em>代码</em>rnrnrnrn服务器端地址转向 我想<em>改</em>成 Respones.Write 输出JS到客户端 打开页面的 形式 请大家<em>帮忙</em>rnrn注:="&Request("word") 这个是别的页面传过来的参数 我要求JS跳转页面的时候也必须能按照这个参数来跳转!rnrn谢谢各位!
求救,帮忙一下!!!
希望得到的效果:从目录中读出图片文件名,比如在目录中存在3张图片,A.GIF,B.GIF,C.GIF。打开页面即显示数组中的第一张,每当按任意键就显示下一张,如果遍历完成,就退出。现有<em>代码</em>只能显示文件名,如下:rnrn\nvar files = new Array(\n";rnforeach($files as $value)rn if($value!="." && $value!="..") rn if($i>0)rn echo ",";rn echo "'$value'\n";rn $i++;rn rnecho ");\nvar files_con = 1;\n\n";rn?>rn rn rnrn rn
帮忙一下Makefile
一个目录下有四个文件:Makefile、print.c、print.h、test.crnrntest.crn--------------------------------------------------rn#include rn#include rn#include rnrn#include "print.h"rnrnint init_module(void)rnrn char a[20];rn strcpy(a, "Hello world\n");rn print((void*)a);rn return 0;rnrnrnvoid cleanup_module(void)rnrn printk("Goodbye cruel world \n");rnrnrnMODULE_LICENSE("GPL");rn--------------------------------------------------rnrnrnprint.crn--------------------------------------------------rn#include rn#include rn#include rnrnint print(void* data)rnrn return printk("sting: %s\n", (char*)data);rnrn-------------------------------------------------rnrnrnprint.hrn---------------------------------------------------rnextern int print(void*);rn--------------------------------------------------rnrnrnMakefilern-------------------------------------------------rnCC=gccrnKERNELDIR=/usr/src/linux-$(shell uname -r)rnrnMODCFLAGS:=-Wall -DMODULE -D__KERNEL__ -DLINUX -I $(KERNELDIR)/includern rntest.o: test.c print.h print.c /usr/include/linux/version.hrn $(CC) $(MODCFLAGS) -c test.c print.crnrnclean:rn rm -f *.orn-------------------------------------------------rnrn现在用“make”编译后回出现print.o和test.o两个文件,“insmod test.o”会出现“test.o: unresolved symbol print”的信息。上面Makefile应该怎么<em>改</em>?
帮忙一下
//判断 (编译未通过)rnrn static int i = 0;rnrn public void TryReLoad()rn rn var a = GetNewValue();rn if (a != i)rn rn i = a;rn webKitBrowser1.Reload();rn rn rn 这是我写的<em>代码</em>, 貌似语法错了。rnWINFORM窗口应用程序,rn 想判断 web上的 URL是否<em>改</em>变 如果<em>改</em>变就刷新, 有谁能<em>帮忙</em><em>改</em>一下吗
大数相加(帮忙一下)
求二个不超过200位的非负整数的和。rnrnInput rnrn输入数据有二行(A和B),每行是一个不超过200为的非负整数,没有多余的前导0,直到输入到文件结束。rnrnOutput rnrnA+B之后的结果,结果中也不能有前导的0.rnrnSample Input rnrnrn5rn500rn99999rn1rnrnrnSample Output rnrnrn505rn100000rnrn#include"stdio.h"rn#include"string.h"rnint main()rnrn int i,top,j,k,m,n;rn char a[51],b[51],c[54];rn scanf("%s %s",a,b);rn rn top=0;rn n=m=0;rn for(i=strlen(a)-1,j=strlen(b)-1,k=0;i>=-1||j>=-1;i--,j--,k++)rn rn if(i>-1)rn m=a[i]-'0';rn elsern m=0;rn if(j>-1)rn n=a[j]-'0';rn elsern n=0;rn if(top+m+n>9)rn rn c[k]=top+m+n-10+'0';rn top=1;rn rn elsern rn c[k]=top+m+n+'0';rn top=0;rn rnrn k--;rn for(k;k>=0;k--)rn printf("%c",c[k]);rnrn rn
帮忙一下程序!!!!
以下是一个输入 一个输出 一个删除函数rn我想要得的输出结果是:rnrn当我输入:rnrn输入情况如下:rnplease put a age:rn23rn101,zhang,m,23rn102,wang,f,22rn0rn输出rnrn101,zhang,m,23 rn102,wang,f,22rndelete:23rn102,wang,f,22rnrnrn#includern#includernrn#define NULL 0rn#define LEN sizeof(struct student)rnrnrnrnstruct studentrnrn int num;rn char name[6];rn char sex[2];rn int age;rnstruct student *next;rn;rnint n;rnstruct student *creat(void)rnrn struct student *head;rn struct student *p1,*p2;rn n=0; rn p1=p2=(struct student *) malloc(LEN);rn scanf("%d,%s,%s,%d",&p1->num,&p1->name,&p1->sex,&p1->age);rn head=NULL;rn while(p1->num!=0)rn rn n=n+1;rn if(n==1)head=p1;rn else p2->next=p1;rn p2=p1;rn p1=(struct student *)malloc(LEN);rn scanf("%d,%s,%s,%d",&p1->num,&p1->name,&p1->sex,&p1->age );rn rn p2->next=NULL;rn return(head);rnrnvoid print(struct student *head)rnstruct student *p;rnp=head;rnif(head!=NULL)rndornrn printf("%6d,%6s,%6s,%6d\n ", p->num, p->name,p->sex,p->age);rn p=p->next;rnrnwhile(p!=NULL);rnrnrnrnstruct student *del(struct student *head,int num)rnrn struct student *p1,*p2;rn if(head==NULL)rn printf("\nlist null!");rn return(head);rn rn p1=head;rn while(num!=p1->age&&p1->next!=NULL)rn p2=p1;p1=p1->next;rn if(num==p1->age)rn if(p1==head)head=p1->next;rn else p2->next=p1->next;rn printf("delate:%d",num);rn n=n-1;rn rn else printf("%d not befound \n",num);rn return(head);rnrnrnvoid main()rnrn struct student *head;rn int age1;rn printf("please put a age:\n");rn scanf("%d",&age1);rn rn head=creat();rn print(head);rn head=del(head,age1);rn print(head);rnrn输入情况如下:rnplease put a age:rn23rn101,zhang,m,23rn102,wang,f,22rn0rn 101,zhang,m,23 m,23,-855624910 这些码怎么才能消去rn 103,wang,f,22, ,22,-842203096 rn23 not befound 为什么23找不到呢 是什么原因请告我 帮我<em>改</em>一下rnrn 101,zhang,m,23, m,23,-855624910rn 102,wang,f,22, ,22,-842203096rn press any key to continuern rn
帮忙一下ip!
我刚装完SUSE Linux Enterprise 9,不会<em>改</em>ip了,请问再哪里<em>改</em>啊,教教小弟吧!
帮忙一下代码,谢谢啦!!
rnrnrn rnrnrn//说明:我想完成这样一个功能rn//:当我点击“进入”时,“进入”变成“恢复”,并且图层layerTool缓慢的隐藏起来rn//:当我点击“恢复”时,“恢复”变成“进入”,并且图层layerTool缓慢的出现出来rn(上面是我的<em>代码</em>,由于刚开始学,并且setTimeout不会用,所以编的很烂,见笑了)rn不能实现我说的效果,请您<em>改</em>一<em>改</em>,谢谢啦!rnrn还有,就是,javascript中有没有像语C言中的delay()似的函数??
分页的问题帮忙一下代码!谢谢
rnrnrnrn rn rn 产品展示rn rnrnrn rn rn rn rn rn rnrn rn rn rn rn rn 对不起,现在没有图像数据!rn rn rn rn < 4rn dim idrnid = rs("ID")rn %>rn rn ">rn rn rn rn rn 名称:rn 价格:rn rn rnrn rn rn rn rn 分页: rn 4 thenrnresponse.write "[1] ..."rnend ifrnif Pcount>currentpage+3 thenrnendpage=currentpage+3rnelsernendpage=Pcountrnend ifrnfor i=currentpage-3 to endpagernif not i< Pcount then rnresponse.write "... ["&Pcount&"]"rnend ifrn%> rn rn rn rn rn rn rn rn rn
帮忙一下代码 (c++学生系统)
[code=c]#include rn#include rnusing namespace std;rnrnclass Personrnprotected:rn string name; //姓名rn string sex; //性别rn string num; //学号rn double score; //成绩rn int age; //年龄rnpublic:rn Person(string na,string se,string nu,double sc,int ag); //构造函数rn Person(Person & a); //拷贝构造函数rn void copy(Person &a); //拷贝学生信息的函数rn void set(int i); //输入学生信息的函数rn int reset(); //修<em>改</em>学生信息的函数rn void Display(); //显示学生信息的函数rn friend void order(Person st[],int i); //排序学生成绩的函数rn friend void rank(Person &st); //评学生等级的函数rn ~Person()rn;rnrnPerson::Person(string na="Name",string se="Sex",string nu="Num",double sc=0.0,int ag=0)rn name=na;rn sex=se;rn num=nu;rn score=sc;rn age=ag;rnrnrnPerson::Person(Person & a) //拷贝构造函数rnrn name = a.name;rn sex = a.sex;rn num = a.num;rn score =a.score;rn age =a.age;rnrnrnvoid Person::copy(Person &a) //拷贝学生信息的函数rn name = a.name;rn sex = a.sex;rn num = a.num;rn score =a.score;rn age =a.age;rnrnrnvoid Person::set(int i) //输入学生信息的函数rn cout<<>name;rn cout<>sex;rn cout<>age;rn cout<>num;rn cout<>score;rnrnrnint Person::reset() //修<em>改</em>学生信息的函数rn int y;rn dorn cout<>y;rn if(y==1)rn cout<>name;rn else if(y==2)rn cout<>sex;rn else if(y==3)rn cout<>age;rn else if(y==4)rn cout<>num;rn else if(y==5)rn cout<>score;rn rn while(y!=6);rn return 0;rnrnrnvoid Person::Display() //显示学生信息的函数rn cout<<<<<<>n;rn if(n==1)rn cout<>x;rn student[x-1].reset();rn else if(n==3)rn order(student,10); //排序学生成绩rn rn while(n!=4);rn cout<
大虾帮忙一下代码,多谢
下面的<em>代码</em>是用C++写的rn请问怎么用<em>改</em>写成C# 啊?rn谢谢rnrnrnrn#includern//***********************************************************rn// 用于AD采集的参数结构rn#ifndef _USB2080_PARA_ADrntypedef struct _USB2080_PARA_AD // 板卡各参数值rnrn LONG ADMode; // AD采集方式(分组或分频)rn LONG ReadSizeWords; // 读取长度rn LONG FirstChannel; // 首通道rn LONG LastChannel; // 末通道rn LONG Frequency; // AD采集频率(Hz)rn LONG GroupInterval; // 分组采样时,相邻组的时间间隔(uS) rn LONG Gains; // 采集增益rn LONG TriggerSource; // 内外触发方式选择rn LONG TriggerType; // 电平触发/边沿触发rn LONG TriggerDir; // 正向/负向触发选择rn USB2080_PARA_AD, *PUSB2080_PARA_AD;rn#endif
帮忙一下
如下图所示,分别找出和为最大及和为最小的4个相邻的数。rn[img=https://img-bbs.csdn.net/upload/201512/24/1450950584_734128.jpg][/img]rn[code=c]#include rnusing namespace std;rnvoid maxandmin(int c[],int len)rnrn int i,max,min,low=0,hig=0;rn max=min=c[0];rn for (i=0;ic[i])rn rn low=i;rn min=c[i];rn rn rn cout<>n;rn cout<<>a[i];rn rn for (i=0;i
帮忙一下小代码
String str=JOptionPane.showInputDialog(null,"产品<em>代码</em>:","请输入产品<em>代码</em>",JOptionPane.QUESTION_MESSAGE);rnif(str==null)rnrn?//如何关闭JOptionPane?rnrnelsernrn ...............................//codern if(.....//str的判断)rn rn JOptionPane.showMessageDialog(null,"你输入的<em>代码</em>不存在,请检查输入是否正确或进入新产品入库!","出错了!",JOptionPane.WARNING_MESSAGE);rn ?//如何返回到第一句Sting.................rn rn elsern rn .........//codern rnrn问题在?处,<em>帮忙</em><em>改</em>一下,谢了! rn
帮忙一下代码!不知道怎么
//获得点的坐标rnint X=0;rnint Y=1;rn//获得点的个数 rnint number=ds.Tables[0].Rows.Count;rnPoint[] points=new Point[number];rn//将获得的点放进point[]数组中 rnfor(int i=number;X
急!!帮忙一下代码,进制转换来的
#includern#includernrnclass numrnrnpublic:rn char f1(char a);rn int f2();rn int f3();rn;rnrnint num::f1(char a)rn/*16进制转换成10进制*/rn int n=0;rn for(int i=0;a[i]!='\0';i++)rn rn if(a[i]>='0'&&a[i]='a'&&a[i]='A'&&a[i]= 0 && t < 10)rn rn b[k] = t + '0';rn rn else if(t >= 10 && t < 16)rn rn b[k] = 'A' + t - 10;rn rn len++;rn n = n / 16;rn rn for(int j = len - 1; j >= 0; j--)rn rn cout<
高手帮忙一下这清理代码
高手<em>帮忙</em><em>改</em>一下这清理<em>代码</em>rnrnrn@echo offrnecho 正在清除系统垃圾文件,请稍等......rndel /f /s /q %systemdrive%\*.tmprndel /f /s /q %systemdrive%\*._mprndel /f /s /q %systemdrive%\*.logrndel /f /s /q %systemdrive%\*.gidrndel /f /s /q %systemdrive%\*.chkrndel /f /s /q %systemdrive%\*.oldrndel /f /s /q %systemdrive%\recycled\*.*rndel /f /s /q %windir%\*.bakrndel /f /s /q %windir%\prefetch\*.*rnrd /s /q %windir%\temp & md %windir%\temprndel /f /q %userprofile%\cookies\*.*rndel /f /q %userprofile%\recent\*.*rndel /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"rndel /f /s /q "%userprofile%\Local Settings\Temp\*.*"rndel /f /s /q "%userprofile%\recent\*.*"rnecho 清除系统LJ完成!rnecho. & pausern上面这个是用.bat格式来运行清理的。 我想做到VB中,应该怎么<em>改</em>呢。做到VB后点一下清理按钮就可以的这种。谢谢了。
请高手帮忙一下代码,谢谢
请高人<em>帮忙</em>看一下下面的<em>代码</em>rn这段<em>代码</em>是用来转换中文的,可就是换转不成功,取出来的数据依旧是乱码rnConvertChinese convertChinese = new ConvertChinese();rnhead=convertChinese.toChinese(head);rn上面两句是在其他页面使用的时候引用的下面的文件rn我是新手,下载的别人的<em>代码</em>,请高手<em>帮忙</em>给<em>改</em>一下,谢谢了rnrn// Source File Name: ConvertChinese.javarnpackage com.ijipin.oa.util;rnrnimport com.ijipin.oa.share.CheckPartner;rnimport com.ijipin.tool.Encryption;rnimport java.io.PrintStream;rnimport java.util.Date;rnrn// Referenced classes of package com.ijipin.oa.util:rn// Formatrnrnpublic class ConvertChinese rnrn private static boolean _$1376 = false;rn private static boolean _$2499 = false;rn private static boolean _$1370 = false;rn private static String _$1371 = "tool==JIPIN20050323";rnrn public static String getVERSION_M() rn/* 26*/ return _$1371;rn rnrnrn public static String toChinese(String strvalue) rn/* 40*/ try rn/* 40*/ if (strvalue == null || strvalue.equals("")) rn/* 41*/ String s = "";rn/* 41*/ return s;rn rn/* 63*/ if (!_$1370) rn/* 64*/ _$1370 = CheckPartner.isSameVersion(_$1371);rn/* 65*/ if (!_$1370) rn/* 66*/ System.out.println("Version Error===".concat(String.valueOf(String.valueOf(_$1371.substring(0, 15)))));rn/* 67*/ String s1 = "";rn/* 67*/ return s1;rn rn rn/* 72*/ if (!isCheckValid()) rn/* 73*/ String s2 = strvalue;rn/* 73*/ return s2;rn rn/* 76*/ strvalue = new String(strvalue.getBytes("ISO-8859-1"), "gbk");rn/* 77*/ strvalue = strvalue.replace(',', '\uFF0C');rn/* 78*/ strvalue = strvalue.replace('\'', '\u2018');rn/* 80*/ if (strvalue.substring(0, 1).equals("\"")) rn/* 81*/ strvalue = "\u201C".concat(String.valueOf(String.valueOf(strvalue.substring(1, strvalue.length()))));rn rn/* 83*/ String s3 = strvalue;rn/* 83*/ return s3;rn rn/* 86*/ catch (Exception e) rn/* 87*/ String s4 = "";rn/* 87*/ return s4;rn rn rnrn public static String toUnicode(String strvalue) rn/* 98*/ try rn/* 98*/ if (strvalue == null || strvalue.equals("")) rn/* 99*/ String s = "";rn/* 99*/ return s;rn else rn/* 102*/ strvalue = new String(strvalue.getBytes("gbk"), "ISO-8859-1");rn/* 103*/ String s1 = strvalue;rn/* 103*/ return s1;rn rn rn/* 106*/ catch (Exception e) rn/* 107*/ String s2 = "";rn/* 107*/ return s2;rn rn rnrn public static boolean isCheckValid() rn/* 112*/ if (!_$1376) rn/* 113*/ Format format = new Format();rn/* 114*/ Date date = format.stringToDate(Encryption.getDecrypt("MjAwNi0wNy0yMw=="));rn/* 115*/ if ((new Date()).after(date)) rn/* 116*/ return false;rn rn/* 119*/ _$1376 = true;rn rn/* 122*/ return true;rn rnrn public static void main(String args[]) rn/* 126*/ System.out.println("hello");rn rnrnrn
帮忙一下存储过程
把where子句变成参数传进去rnrnCREATE procedure GetImageOrderByHotrn(@pagesize int,rn@pageindex int,rn@docount bit)rnasrnset nocount onrnif(@docount=1)rnselect count(Id) from ShineImage where validate = 1rnelsernbeginrndeclare @indextable table(id int identity(1,1),nid int)rndeclare @PageLowerBound intrndeclare @PageUpperBound intrnset @PageLowerBound=(@pageindex-1)*@pagesizernset @PageUpperBound=@PageLowerBound+@pagesizernset rowcount @PageUpperBoundrninsert into @indextable(nid) select Id from ShineImage where validate = 1 order by hits descrnselect O.* from ShineImage O,@indextable t where O.Id=t.nidrnand t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.idrnendrnset nocount offrnGOrn
帮忙一下!
#includern#includern#includerntypedef struct treern rn int data;rn struct tree *lchild;rn struct tree *rchild;rn TREE;rn typedef struct stackrn rn TREE *t;rn int flag;rn struct stack *link;rn STACK;rnrnvoid push(STACK **top,TREE *tree)rn rn STACK *p;rn p=(STACK *)malloc(sizeof(STACK));rn p->t=tree;rn p->link=*top;rn *top=p;rn rnrnvoid pop(STACK **top,TREE **tree)rn rn STACK *p;rn if(*top==NULL)rn *tree=NULL;rn elsern rn *tree=(*top)->t;rn p=*top;rn *top=(*top)->link;rn free(p);rn rn rnrnvoid SearchNode(TREE **tree,int key,TREE **pkpt,TREE **kpt)rn rn *pkpt=NULL;rn *kpt=*tree;rn while((*kpt)!=NULL)rn rn if((*kpt)->data==key)rn return;rn *pkpt=*kpt;rn if(keydata)rn *kpt=(*kpt)->lchild;rn elsern *kpt=(*kpt)->rchild;rn rn rnint InsertNode(TREE **tree,int key)rn rn TREE *p,*q,*r;rn SearchNode(*tree,key,&p,&q);rn if(q!=NULL)rn return 1;rn if((r=(TREE *)malloc(sizeof(TREE)))==NULL)rn return -1;rn r->data=key;rn r->lchild=r->rchild=NULL;rn if(p==NULL)rn *tree=r;rn else if(p->data>key)rn p->lchild=r;rn elsern p->rchild=r;rn return 0;rn rnint DeleteNode(TREE **tree,int key)rn rn TREE *p,*q,*r;rn SearchNode(*tree,key,&p,&q);rn if(q==NULL)rn if(q->lchild==NULL)rn *tree=q->rchild;rn elsern rn *tree=q->lchild;rn r=q->lchild;rn while(r->rchild!=NULL)rn rn r=r->rchild;rn rnrn rn else if(q->lchild==NULL)rn if(q==p->lchild)rn p->lchild=q->rchild;rn elsern p->rchild=q->rchild;rn elsern rn r=q->lchild;rn while(r->rchild!=NULL)rn r=r->rchild;rn r->rchild=q->rchild;rn if(q==p->lchild)rn p->lchild=q->lchild;rn elsern p->rchild=q->lchild;rn rn free(q);rn return 0;rn rnrnvoid OutputTree(TREE *tree)rn rn STACK *top;rn int deep=0,no=0,maxdeep=0;rn top=NULL;rn while(tree!=NULL||top!=NULL)rn rn while(tree!=NULL)rn rn push(&top,tree);rn top->flag=++deep;rn if(maxdeeplchild;rn rn if(top!=NULL)rn rn deep=top->flag;rn no++;rn pop(&top,&tree);gotoxy(no *4,deep +2);rn printf("%d",tree->data);rn fflush(stdout);rn tree=tree->rchild;rn rn rn gotoxy(1,maxdeep+3);rn printf("任意键继续\n");rn getch();rn rn#includern#includern#includernrnvoid main()rn rn TREE *t;rn int op=-1,i,ret;rn t=NULL;rn while(op!=0)rn rn printf("请选择操作,1:增加树结点 2:删出树结点 0:结束操作");rn fflush(stdin);rn scanf("%d",&op);rn switch(op)rn rn case 0:rn break;rn case 1:rn printf("请输入树结点元素:");rn scanf("%d",&i);rn switch(InsertNode(&t,i))rn rn case 0:rn clrscr();rn gotoxy(1,1);rn printf("成功,树结构为:\n");rn OutputTree(t);rn break;rn case 1:rn printf("该元素已存在\n");rn break;rn default:rn printf("内存操作失败\n");rn break;rn rn break;rn case 2:rn printf("请输入要删除元素的树结点元素:\n");rn scanf("%d",&i);rn if(DeleteNode(&t,i)==0)rn clrscr();rn gotoxy(1,1);rn printf("删除成功,树结构为:\n ");rn OutputTree(t);rn rn elsern printf("该键值树结点不存在\n");rn break;rn rn rn rnrn运行有两个错误:1 twoshu.c 58: 指针转换后指向其它类型在 InsertNode 函数中;此句指 SearchNode(*tree,key,&p,&q);rn 2 twoshu.c 76: 指针转换后指向其它类型在 DeleteNode 函数中此句指 SearchNode(*tree,key,&p,&q);
帮忙一下 js
想把超链接 <em>改</em>成 一点击 就出来个弹出框 。需要<em>改</em>js
谁能帮忙一下!!!
rnrnrnrnrn让两个按钮同时闪烁,一个闪烁另一个不闪烁
帮忙一下错
请好心人<em>帮忙</em><em>改</em>一下错rnrnWarning: chkinput::include(conn/conn.php) [chkinput.include]: failed to open stream: No such file or directory in D:\AppServ\www\xiaoyuan\admin\chkadmin.php on line 15rnrnWarning: chkinput::include() [function.include]: Failed opening 'conn/conn.php' for inclusion (include_path='.;C:\php5\pear') in D:\AppServ\www\xiaoyuan\admin\chkadmin.php on line 15rnrnWarning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\AppServ\www\xiaoyuan\admin\chkadmin.php on line 16rnrnWarning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\xiaoyuan\admin\chkadmin.php on line 17rnrnrnrn下面是chkadmin.php的<em>代码</em>rnname=$x;rn $this->pwd=$y;rn rnrn function checkinput()rn rn include("conn/conn.php");rn $sql=mysql_query("select * from tb_admin_user where name='".$this->name."'",$conn);rn $info=mysql_fetch_array($sql);rn if($info==false)rn rn echo " ";rn exit;rn rn elsern rn if($info[pwd]=='$pwd')rn header("location:index.php");rn rn elsern rn echo " ";rn exit;rn rnrn rn rn rnrnrn $obj=new chkinput(trim($_POST[name]),md5(trim($_POST[pwd])));rn $obj->checkinput();rnrn?>rnrnrnrn下面是 admin_user.php的<em>代码</em>rnrnrn rn rn rnrnrn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn 用户名:rn rn 密 码:rn rn rn rn rn rn rn rn rnrnrnrn
JAVA帮忙一下
test1.txt文本里有几行数如rn2;4;5;9;9;rn8;6;5;3;2;rn7;5;6;8;9;rn读取txt里的数 求出每一行数相加的和写到每行最后 运行结果 如下rn2;4;5;9;9;29;rn8;6;5;3;2;24;rn7;5;6;8;9;35;rnrn求正解 要求用vectorrn[code=Java][/code]rnpackage jiasuan;rnrnimport java.io.BufferedReader;rnimport java.io.File;rnimport java.io.FileReader;rnimport java.io.FileWriter;rnimport java.io.PrintWriter;rnimport java.util.*;rnpublic class VectorTest rnrn public VectorTest() rn rn public static void main (String[] args)throws Exceptionrn rn File fileName = new File("d:" + File.separator + "test1.txt") ;rn BufferedReader in=new BufferedReader(new FileReader(fileName));rn String str=" ";rn Vector list=new Vector();rn while((str=in.readLine())!=null)rn str=str.replaceAll("\\b","");rn rn int sum = 0;rn Scanner sc = new Scanner(fileName);rn while (sc.hasNextInt()) rn sum += sc.nextInt();rn rn sc.close();rn PrintWriter writer = new PrintWriter(new FileWriter(fileName,true));rn writer.print(sum+";");rn rn writer.close();rn rn rn rnrn
帮忙一下路径:
rnrn rnrnrnfloatads('http://ad.51job.com/phpAD/adtrace.php?ID=8338075' 特别是这条,我应该怎么<em>改</em>呢?rn'http://image.51job.com/im/careerpost/peixun/success/6565.gif'rn请问这两个路径我怎么<em>改</em>才可以在本地测试成功呢?rn
麻烦老师帮忙一下代码
Private Sub Command15_Click()rn Dim str1 As String, c As StringrnDim arr() As StringrnDim ii As Integer, hh As Integer, y As IntegerrnDim a(1 To 12) As StringrnDim count(7 To 12) As LongrnDim s As IntegerrnDim i As Long, j As Long, k As Long, m As LongrnDim h As StringrnrnFor ii = 0 To List2.ListIndexrnstr1 = List2.List(ii)rnarr = Split(str1, ",")rnrnFor i = 0 To 11rna(i + 1) = arr(i)rnNextrnFor y = 1 To MSFlexGrid1.Rows - 1rns = MSFlexGrid1.TextMatrix(y, 1)rnc = srnrnIf Len(c) = 3 And IsNumeric(c) And InStr(1, c, "-") = 0 And InStr(1, c, ".") = 0 And InStr(1, c, "E") = 0 ThenrnFor k = 1 To 3rnFor j = 7 To 12rnIf InStr(1, a(j), Mid(c, k, 1)) <> 0 Then count(j) = count(j) + 1rnNext jrnNext krnFor m = 7 To 12rnIf count(m) <> 0 Thenrnh = h & count(m) & a(m - 6)rnEnd IfrnNextrnEnd Ifrnrnrnhh = MSFlexGrid1.ColrnrnMSFlexGrid1.TextMatrix(y, hh + ii) = hrnrnErase countrnh = ""rnNextrnNextrnrn End Subrn这段<em>代码</em>不能辨认类似于s=078的,只要s开头是0的都不能辨认,该如何<em>改</em>呢
动态生成CheckBoxes,帮忙一下代码
import javax.microedition.midlet.*;rnimport javax.microedition.lcdui.*;rnrn/**rn * @author chengrn */rnpublic class CheckBoxes extends MIDlet implements CommandListener rn private Display display;rn private Form form;rn private Command exit;rn private Command process;rn private ChoiceGroup movies;rn private int movieIdex;rn private Command command;rn public CheckBoxes ()rn rn display = Display.getDisplay(this);rn movies = new ChoiceGroup("Select Movies You Like to See",Choice.MULTIPLE);rn movies.append("Action", null);rn movies.append("Romance", null);rn movies.append("Comedy", null);rn movies.append("Horror", null);rn exit = new Command("Exit ",Command.EXIT,1);rn process = new Command("Process",Command.SCREEN,2);rn form = new Form("Movies");rn movieIdex = form.append(movies);rn form.addCommand(exit);rn form.addCommand(process);rn form.setCommandListener(this);rn rn public void startApp() rn rn display.setCurrent( form);rn rnrn public void pauseApp() rn rnrn public void destroyApp(boolean unconditional) rn rnrn public void commandAction(Command c, Displayable d)rn rn if(command ==process)rn rn boolean picks[] =new boolean[movies.size()];rn StringItem messages[] = new StringItem[movies.size()];rn movies.getSelectedFlags(picks);rn for(int x=0; x
帮忙一下java贪吃蛇的代码
//主界面OK没问题rnimport javax.swing.*;rnimport java.awt.*;rnimport java.util.*;rnimport java.awt.event.*;rnrnpublic class bb extends JFramernrnrn JPanel jpTop=new JPanel();rn JButton jbn1=new JButton("开始");//游戏开始按钮rn JButton jbn2=new JButton("暂停"); //游戏暂停按钮rn JButton jbn3=new JButton("重置"); //游戏暂停按钮rn boolean isPause = false; //游戏暂停标志rn int score = 0; //当前得分rn JLabel jlb1 = new JLabel("得分:");rn JLabel jlbScroe = new JLabel("0");rn JLabel jlb2 = new JLabel("等级:");rn JLabel jlbGrade = new JLabel("0");rn ButtonGroup buttonGroup1 = new ButtonGroup();rn JRadioButton jbnLow = new JRadioButton("初级", true);rn JRadioButton jbnMid = new JRadioButton("中级");rn JRadioButton jbnHigh = new JRadioButton("高级");rn JPanel jpSouth = new JPanel();rn aa p=new aa();rnrn public bb()rn rn getContentPane().add(p,"Center");rn buttonGroup1.add(jbnLow);buttonGroup1.add(jbnMid);buttonGroup1.add(jbnHigh);rn jpTop.add(jbn1);jpTop.add(jbn2);jpTop.add(jbn3);jpTop.add(jbnLow);jpTop.add(jbnMid);jpTop.add(jbnHigh);rn getContentPane().add(jpTop,"North");rn jpSouth.add(jlb1);jpSouth.add(jlbScroe);jpSouth.add(jlb2);jpSouth.add(jlbGrade);rn getContentPane().add(jpSouth,"South");rn jbn1.addActionListener(new ActionListener()rn rn public void actionPerformed(ActionEvent e)rn rn p.requestFocus(true);rn (new Thread(p)).start();rn rn );rn jbn2.addActionListener(new ActionListener()rn rn public void actionPerformed(ActionEvent e)rn rn p.requestFocus(true);rn if (p.isPause == true)rn rn jbn2.setText("暂停");rn rn if (p.isPause == false)rn rn jbn2.setText("继续");rn rn p.isPause = !p.isPause;rn rn );rn jbn3.addActionListener(new ActionListener()rn rn public void actionPerformed(ActionEvent e)rn rn dispose();rn new bb();rn rn );rn jbnLow.addActionListener(new ActionListener()rn rn public void actionPerformed(ActionEvent e)rn rn p.speed=500;rn rn );rn jbnMid.addActionListener(new ActionListener()rn rn public void actionPerformed(ActionEvent e)rn rn p.speed=300;rn rn );rn jbnHigh.addActionListener(new ActionListener()rn rn public void actionPerformed(ActionEvent e)rn rn p.speed=100;rn rn );rn setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn setVisible(true);rn setSize(700,700);rn validate();rnrn rn public static void main(String args[])rn rn new bb();rnrn rnrnrn//一个点的设置OK 没问题rnpublic class Pointsrnrn int x,y;rn public Points(int x,int y)rn rn this.x=x;rn this.y=y;rn rn public int getX()rn rn return x;rn rn public int getY()rn rn return y;rn rn public void setX(int x)rn rn this.x=x;rn rn public void setY(int y)rn rn this.y=y;rn rnrnrn[color=#FF0000]//蛇动,食物创建,主要问题都在这里,我的蛇动的时候是整条一起动,不是一个点,食物也吃不到,[/color]rnimport javax.swing.*;rnimport java.awt.*;rnimport java.util.*;rnimport java.awt.event.*;rnimport java.lang.Math.*;rnrnpublic class aa extends JPanel implements Runnable,KeyListenerrnrn Points p=new Points(100,100);rn Points food=new Points(300,300);//食物rn int count;//蛇身体的节点数rn int score = 0;int top=0;//分数rn int speed=500;//速度rn boolean isPause=false;//判断是否停止rn ArrayList ls=new ArrayList();//蛇身rn int level = 0;//游戏等级rn Points up=new Points(80,80);Points down=new Points(80,80);rn Points left=new Points(80,560);Points right=new Points(560,80);rn int direction=0;//0 -right 1-left 2-down 3-uprn public aa()rn ls.add(p);rn makeFood();rn addKeyListener(this);rn rn public void paint(Graphics g)rn rn if(!isPause)rn rn move(direction);rn rn super.paintComponent(g);rnrn g.setColor(Color.BLACK);rn int x=up.getX();rn int y=up.getY();rn g.fillRect(x,y,482,2);rn x=down.getX();rn y=down.getY();rn g.fillRect(x,y,2,480);rn x=left.getX();rn y=left.getY();rn g.fillRect(x,y,482,2);rn x=right.getX();rn y=right.getY();rn g.fillRect(x,y,2,480);rnrn g.setColor(Color.BLACK);rn x=p.getX();rn y=p.getY();rn g.fillRect(x,y,10,10);rnrn x=p.getX()+11;rn y=p.getY();rn ls.add(new Points(x,y));rn g.fillRect(x,y,10,10);rnrnrn g.setColor(Color.RED);rn g.fillRect(food.x,food.y,10,10);rnrn rn public void keyPressed(KeyEvent e)rn rn //决定方向rn if(!isPause)rn rn if(e.getKeyCode()==KeyEvent.VK_DOWN && direction!=2 && direction!=3)rn direction=2;rn if(e.getKeyCode()==KeyEvent.VK_UP && direction!=3 && direction!=2)rn direction=3;rn if(e.getKeyCode()==KeyEvent.VK_RIGHT && direction!=0 && direction!=1)rn direction=0;rn if(e.getKeyCode()==KeyEvent.VK_LEFT && direction!=1 && direction!=0)rn direction=1;rn rnrn rn public void move(int d)rn //Points point1=(Points)ls.get(0);rn //Points p0 = new Points(point1.x,point1.y);rn int x=p.getX();rn int y=p.getY();rn if(d==0)rn rn x=x+10;rn //p0.x=p0.x+10;ls.add(0,p0);rn rn if(d==1)rn rn x=x-10;rn //p0.x=p0.x-10;ls.add(0,p0);rn rn if (d==2)rn rn y=y+10;rn //p0.y=p0.y+10;ls.add(0,p0);rn rn if(d==3)rn rn y=y-10;rn //p0.y=p0.y-10;ls.add(0,p0);rn rn p.setX(x);rn p.setY(y);rn rnrn private void makeFood()rn rn int x=40+(int)(Math.random()*30)*12;rn int y=10+(int)(Math.random()*30)*12;rn food=new Points(x,y);rn rnrn private boolean isEat()rn rn Points snakehead=(Points)ls.get(0);rn if(food.x==snakehead.x&&food.y==snakehead.y)rn rn count++;rn return true;rn rn elsern return false;rn rn public void keyReleased(KeyEvent e)rn public void keyTyped(KeyEvent e)rn public void run()rn rn while (true)rn rn //需要<em>改</em>变每个方块的位置rn Points point1=(Points)ls.get(0);rn Points p0 = new Points(point1.x,point1.y);rn switch (direction)rn rn case 0:p0.x=p0.x+10;ls.add(0,p0);break;rn case 1:p0.x=p0.x-10;ls.add(0,p0);break;rn case 2:p0.y=p0.y+10;ls.add(0,p0);break;rn case 3:p0.y=p0.y-10;ls.add(0,p0);break;rnrn rn //设一个成员变量,4个值,决定蛇移动的方向rn rn repaint();rn tryrn Thread.sleep(speed);rnrn catch(Exception ee)rnrn rn rnrn rnrnrnrn求各位高手,我实在是不会<em>改</em>了
帮忙一下 C++
高手们,<em>帮忙</em><em>改</em>一下;rn#include "stack.h"rn#include rn#includernint change(char theta)rnrn switch(theta)rn rn case '+':rn rn return 0;rn rn break;rn rn case '-':rn rn return 1;rnrn break;rn rn case '*':rn rn return 2;rn rn break;rn rn case '/':rn rn return 3;rn break;rnrn case '(':rnrn return 4;rnrn break;rnrn case ')':rnrn return 5;rnrn break;rnrn case '#':rnrn return 6;rnrn break;rnrn rnrn return 0;rnrnrnint Precede(char theta1,char theta2)rnrnrn int a[7][7]=3,3,1,1,1,3,3,3,3,1,1,1,3,3,3,3,3,3,1,3,3,3,3,3,3,1,3,3,1,1,1,1,1,2,0,3,3,3,3,0,3,3,1,1,1,1,1,0,2;rnrn return(a[change(theta1)][change(theta2)]);rnrnfloat Operate(float a,char theta,float b)rnrnrn switch(theta)rnrn rnrn case '+':rnrn return(a+b);rnrn break;rnrn case '-':rnrn return(a-b);rnrn break;rnrn case '*':rnrn return(a*b);rn break;rnrn case '/':rnrn return(a/b);rnrn break;rnrn rnrn return 0;rnrnrnint main()rnrnrnrn float number=0;rnrn char c,x;rnrnrn int dot=0;rnrn int mark=0;rnrn char theta;rnrn float a,b;rnrn stack *OPTR;rnrn stack *OPND;rnrn OPTR=InitStack ();rnrn OPND=InitStack ();rnrn fstream infile;rnrn fstream outfile;rnrn infile.open("input.txt",ios::in);rnrn if(!infile)rnrn rnrn cout<< (OPTR,'#');rnrn outfile<<<< (OPTR)!='#')rnrn rnrn while((c>='0'&&c<<
帮忙一下程序。
程序功能:实现java与oracle数据库的连接rn编译通过了,也没有任何错误。rn但运行结果是:errorrnrn另外:数据库运行正常,是什么原因呢?请值教rn程序<em>代码</em>如下:rnimport java.sql.*;rnpublic class oraclejdbc rn public static Connection conn;rn public static Statement stmt;rn public static ResultSet rs;rn public static void main(String[] args) rn tryrn rn Class.forName("oracle.jdbc.driver.OracleDriver");rn System.out.println("jkfkd");rn conn=DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.106:1521:hahamis","bysj","bysj");rn stmt=conn.createStatement();rn rs=stmt.executeQuery("select * from customer");rn while(rs.next())rn rn System.out.println(rs.getString("name"));rn rn rs.close();rn stmt.close();rn conn.close();rn rn catch(Exception e)rn rn System.out.println("Error");rn rn rnrnrnrn
帮我一下代码
网站LOGO位置不正确,上面有空的地方,图片变大就显示传位了,www.huolinhe.com 哪位高手<em>帮忙</em>修<em>改</em>一下rnrn rn rn rn rn rn rn rn 用户名:rn 密码:rn rn 忘记密码?rn 注册rn rn rn rn rn rn rn rn 站内搜索 | 网站地图 | 设为首页 | 加入收藏rn rn rnrn rn rn rnrn rn rn 首页 rn dir:category parentid="$catid" row="8" mod="1" type="top"rn code $childrenid=get_childrencatid(mydc:id);rn mydc:catnamern /dir:categoryrn rnrn rn rnrn rn rn rn 大家都在搜:hotkeywords('weight',6)rn rn
帮我一下代码!!
< ds.Tables[0].Rows.Count ; i++)rn%>rn rn rn这是C#的留言板,请问怎样把它<em>改</em>成VB的,这是在aspx页面里的<em>代码</em>怎样<em>改</em>.
帮忙一下代码
procedure Tform1.hsv2rgb(Hue:Thue;saturation,value:byte;var red,green,blue:byte);rnvarrn f,h,m,n:Double;rn a:integer;rn w,y,z:byte;rnbeginrn m:=saturation/255;rn if m=0 then //这里出错显示“left side cannot be assigned to”rn red:=green:=blue:=valuern elsern beginrn h:=hue/60;rn a:=hue div 60;rn f:=h-a; //这里显示“incompatible type:‘byte’and‘extended’rn w:=value*(1-m);//同上一句同样的错误rn y:=value*(1-m*f);//同上一句同样的错误rn rn z:=value*(1-m*(1-f));//同上一句同样的错误rn rn case a ofrn 0: red:=value,green:=k,blue:=m;rn 1: red:=y,green:=value,blue:=m;rn 2: red:=w,green:=value,blue:=k;rn 3: red:=w,green:=n,blue:=value;rn 4: red:=z,green:=m,blue:=value;rn 5: red:=value,green:=m,blue:=n;rn end;rnend;
帮忙一段代码…………
我想让所有的内容在一行显示 但是效果出来 还是进行了换行rnrnrn[code=HTML]rn rn rn 动态添加divrn rn rn rn rn rn rn rn rn 1rn rn 2rn 3rn 4rn 5rn 6rn 7rn 8rn rn rn rn rn rn rn rn [/code]
帮忙代码
我在C语言里画了一个动的图,但是clrscr();来清除以前画的,这样实现到是实现了动,但是我设制的背景也全给清除了,这样不好,还有我这用空语句廷时,不知还有没有更好的方法.请各位帮我<em>改</em>下.rn#include "graphics.h"rnmain().rnint driver,mode,x,k,d;rndriver=VGA;mode=VGAHI;rninitgraph(&driver,&mode,"");rnsetviewport(700,700,700,700,1);rnsetbkcolor(RED);rnsetcolor(4);rnfor(x=1;x<100;d++)rnrnrnclrscr();rncircle(100,x,10); rnrn
帮忙代码
用ajax动态添加多个div(class="txdiv"),里面有不同的id号和数据,当鼠标移动到其中的某个div,并在上面停留2秒钟以后,另外一个隐藏的div(id="message")显示出来,并在其中显示鼠标经过的div中的数据。当鼠标移出div(class="txdiv"),隐藏div(id="message")。rn[code=javascript]rn $(".txdiv").live("mouseover",function()rn rn $("#m_saytext").val("发悄悄话...").css("color":"#999","text-align":"left","font-size":"12px");rn $("#get_name").val($(this).attr("username"));rn $(".d1 img").attr("src",$(this).attr("photo"));rn $(".p-about").html($(this).attr("about"));rn setTimeout(function()$("#message").show();,1000);rn )rn[/code]
请大家帮忙一下的!
Option Explicit OnrnImports Microsoft.VisualBasic.Compatibility.VB6rnImports Microsoft.VisualBasicrnImports System.IOrnImports SystemrnImports System.TextrnPublic Class Form1rn Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal Destination As Object, ByVal Source As Object, ByVal Length As Long)rn Private Structure GUIDrn Public Data1 As Longrn Public Data2 As Integerrn Public Data3 As Integerrn Dim Data4() As Bytern Public Sub Initialize()rn ReDim Data4(7)rn End Subrn End Structurern Private Structure RASIPADDRrn Public a As Bytern Public b As Bytern Public c As Bytern Public d As Bytern End Structurern Private Structure RASENTRYrn Public dwSize As Longrn Public dwfOptions As Longrn Public dwCountryID As Longrn Public dwCountryCode As Longrn Public dwAlternateOffset As Longrn Public ipaddr As RASIPADDRrn Public ipaddrDns As RASIPADDRrn Public ipaddrDnsAlt As RASIPADDRrn Public ipaddrWins As RASIPADDRrn Public ipaddrWinsAlt As RASIPADDRrn Public dwFrameSize As Longrn Public dwfNetProtocols As Longrn Public dwFramingProtocol As Longrn Dim szAreaCode() As Bytern Dim szLocalPhoneNumber() As Bytern Dim szScript() As Bytern Dim szAutodialDll() As Bytern Dim szAutodialFunc() As Bytern Dim szDeviceType() As Bytern Dim szDeviceName() As Bytern Dim szX25PadType() As Bytern Dim szX25Address() As Bytern Dim szX25Facilities() As Bytern Dim szX25UserData() As Bytern Dim szPrerequisitePbk() As Bytern Dim szPrerequisiteEntry() As Bytern Dim szDnsSuffix() As Bytern Dim szCustomDialDll() As Bytern Public dwChannels As Longrn Public dwReserved1 As Longrn Public dwReserved2 As Longrn Public dwSubEntries As Longrn Public dwDialMode As Longrn Public dwDialExtraPercent As Longrn Public dwDialExtraSampleSeconds As Longrn Public dwHangUpExtraPercent As Longrn Public dwHangUpExtraSampleSeconds As Longrn Public dwIdleDisconnectSeconds As Longrn Public dwType As Longrn Public dwEncryptionType As Longrn Public dwCustomAuthKey As Longrn Public guidId As GUIDrn Public dwVpnStrategy As Longrn Public dwfOptions2 As Longrn Public dwfOptions3 As Longrn Public dwTcpWindowsize As Longrn Public dwRedialCount As Longrn Public dwRedialPause As Longrnrn Public Sub Initialize()rn ReDim szAreaCode(10)rn ReDim szLocalPhoneNumber(128)rn ReDim szScript(259)rn ReDim szAutodialDll(259)rn ReDim szAutodialFunc(259)rn ReDim szDeviceType(16)rn ReDim szDeviceName(128)rn ReDim szX25PadType(32)rn ReDim szX25Address(200)rn ReDim szX25Facilities(200)rn ReDim szX25UserData(200)rn ReDim szPrerequisitePbk(259)rn ReDim szPrerequisiteEntry(256)rn ReDim szDnsSuffix(255)rn ReDim szCustomDialDll(259)rn End Subrnrn End Structurern Private Structure RASCREDENTIALSrn Public dwSize As Longrn Public dwMask As Longrn Dim szUserName() As Bytern Dim szPassword() As Bytern Dim szDomain() As Bytern Public Sub Initialize()rn ReDim szUserName(256)rn ReDim szPassword(256)rn ReDim szDomain(15)rn End Subrn End Structurern Private Structure RASDIALPARAMS''''''''''''''''我想做自定义号码的modem电话号码拨号上网,就是类似windowsrn Dim szEntryName As String''''''''''''''''''自带的那个拨号。这段是一位高手老大指点的(再次感谢),请rn Dim szPhoneNumber As String''''''''''''''''大家帮我看看怎么修<em>改</em>后面的<em>代码</em>,实现自定义号码,modem拨号rn End Structure''''''''''''''''''''''''''''''''''上网rn Private Const ET_None As Long = 0 ' No encryptionrn Private Const ET_Require As Long = 1 ' Require Encryptionrn Private Const ET_RequireMax As Long = 2 ' Require max encryptionrn Private Const ET_Optional As Long = 3 ' Do encryption if possible. None Ok.rn Private Const VS_Default As Long = 0 ' default (PPTP for now)rn Private Const VS_PptpOnly As Long = 1 ' Only PPTP is attempted.rn Private Const VS_PptpFirst As Long = 2 ' PPTP is tried first.rn Private Const VS_L2tpOnly As Long = 3 ' Only L2TP is attempted.rn Private Const VS_L2tpFirst As Long = 4 ' L2TP is tried first.rn Private Const RASET_Phone As Long = 1 ' Phone lines: modem, ISDN, X.25, etcrn Private Const RASET_Vpn As Long = 2 ' Virtual private networkrn Private Const RASET_Direct As Long = 3 ' Direct connect: serial, parallelrn Private Const RASET_Internet As Long = 4 ' BaseCamp internetrn Private Const RASET_Broadband As Long = 5 ' Broadbandrn Private Declare Function RasSetEntryProperties Lib "rasapi32" Alias "RasSetEntryPropertiesA" (ByVal lpszPhonebook As String, ByVal lpszEntry As String, ByVal lpRasEntry As RASENTRY, ByVal dwEntryInfoSize As Long, ByVal lpbDeviceInfo As Long, ByVal dwDeviceInfoSize As Long) As Longrn Private Declare Function RasSetCredentials Lib "rasapi32" Alias "RasSetCredentialsA" (ByVal lpszPhonebook As String, ByVal lpszEntry As String, ByVal lpCredentials As RASCREDENTIALS, ByVal fClearCredentials As Long) As Longrn Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loadrn Dim sEntryName As String, sUsername As String, sPassword As Stringrnrn '创建PPPoErn sEntryName = "宽带连接"rn sUsername = "16900"rn sPassword = "16900"rnrn If Create_PPPoE_Connection(sEntryName, sUsername, sPassword) Thenrn MsgBox("连接建立成功!")rn Elsern MsgBox("连接建立失败!")rn End Ifrn End SubrnFunction Create_PPPoE_Connection(ByVal sEntryName As String, ByVal sUsername As String, ByVal sPassword As String) As Booleanrn Create_PPPoE_Connection = Falsern Dim re As New RASENTRY, rp As New RASDIALPARAMSrn Dim sDeviceName As String, sDeviceType As Stringrn sDeviceName = "Smart Link 56K Voice Modem"rn sDeviceType = "PPPoE"rn Dim instance As Encoding = Encoding.Unicodern Dim aa() As Bytern aa = instance.GetBytes(sDeviceName)rn Dim bb() As Bytern bb = instance.GetBytes(sDeviceType)rn re.Initialize()rn rp.szEntryName = "Smart Link 56K Voice Modem"rn rp.szPhoneNumber = "0,16900"rn With rern .dwSize = Len(re)rn .dwCountryCode = 86rn .dwCountryID = 86rn .dwDialExtraPercent = 75rn .dwDialExtraSampleSeconds = 120rn .dwDialMode = 1rn .dwEncryptionType = 3rn .dwfNetProtocols = 4rn .dwfOptions = 1024262928rn .dwfOptions2 = 367rn .dwFramingProtocol = 1rn .dwHangUpExtraPercent = 10rn .dwHangUpExtraSampleSeconds = 120rn .dwRedialCount = 3rn .dwRedialPause = 60rn .dwType = RASET_Broadbandrn CopyMemory(.szDeviceName, aa, Len(sDeviceName))rn CopyMemory(.szDeviceType, bb, Len(sDeviceType))rn End Withrn Dim rc As RASCREDENTIALSrn rc.Initialize()rn With rcrn .dwSize = Len(rc)rn .dwMask = 11rn CopyMemory(.szUserName, sUsername, Len(sUsername))rn CopyMemory(.szPassword, sPassword, Len(sPassword))rn End Withrn Dim rtn As Longrn If RasSetEntryProperties(rp.szPhoneNumber, sEntryName, re, Len(re), 0, 0) = 0 Thenrn If RasSetCredentials(rp.szPhoneNumber, sEntryName, rc, 0) = 0 Thenrn Create_PPPoE_Connection = Truern End Ifrn End Ifrn End Function
帮忙一下这个正则表达式
[b]正则表达式 :[/b]时间:(\d4-\d2-\d2)(.+?)rn[b]匹配的字符串:[/b]时间:2008-07-02tfhtrtryrt时间:2008-06-30ghjhewrewrwerewrewrewrewrewrnrn我想匹配第二个日期和中间的字符串,现在老是匹配第一个日期。各位高手踊跃发言啊!!
可不可以试着帮忙一下
#include rn#include rnrn# define null 0rn# define maxsize 100rnrntypedef struct node rnrn char data;rn struct node *lchild, *rchild;rnnode, *bitree;rnrnbitree Q[maxsize]; rnrnbitree creat()rnrn char ch;rn int front,rear;rn bitree root,s;rn root = null;rn front = 1;rn rear = 0;rn ch = getchar();rnrn while (ch != '#')rn rn s = null;rn if (ch != '@')rn rn s = (bitree)malloc(sizeof(node));rn s->data = ch;rn s->lchild = null;rn s->rchild = null;rn rnrn rear++;rn Q[rear] = s;rn if (rear == 1)rn rn root = s;rn rn else rn rn if(s && Q[front])rn if (rear%2 == 0)rn rn Q[front]->lchild = s; rn rn else rn rn Q[front] ->rchild = s; rn rnrn if (rear%2 == 1) rn rn front++; rn rn rnrn ch = getchar(); rn rnrn return root; rnrnrnvoid Porderf(bitree root)rnint top=0; bitree p, s[100];rnp=root;rnwhile (p||top)rnwhile (p!=null)rnprintf("%d\t",p->data);rns[top++]=p;rnp=p->lchild;rnrnif(top>0)rnp=s[--top];rnrnp=p->rchild;rnrnrnrnvoid main ()rnprintf("请输入字符串");rnbitree T=null;rnrnT=creat();rngetchar();rnprintf("先序遍历:");rnrnPorderf(T);rngetchar();rnrn
两数交换,帮忙一下
两数交换,<em>帮忙</em><em>改</em>一下!谢谢rnrnrn
哪位高手帮忙一下!
#includernfloat fun(int n,int x)rnrn float p;rn if(n=0) p=1.0;rn else if (n=1) p=float(x);rn else p=(2*n-1)*x*fun(n-1,x)-(n-1)*fun(n-2,x);rn p/=n;rn return (p);rnrnvoid main ()rnrnfloat y;rnint n; int x;rncout<>n;rncout<>x;rny=fun(n,x);rncout<
Huffman编码,帮忙一下
#includern#includern#include rn#includern#include "map"rn#includernusing namespace std;rnrnrnstruct HuffmanTreernrn int weight;rn int parent,lchild,rchild;rn;rntypedef map HuffmanCode;rnint n; //字符个数rnrnrnrnvoid GetInfor(map &Weight,int &n);rnvoid Select(HuffmanTree *HT,int i,int &S1,int &S2);rnvoid HuffmanCoding(HuffmanTree *&HT,HuffmanCode &HC,map Weight,int n);rnstring EnCoding(HuffmanCode HC,string word);rnstring DeCoding(HuffmanCode HC,string code);rnrnrnrnrnrnint main(int argc, char* argv[])rnrn HuffmanTree *HT;rn HuffmanCode HC;rn map Weight;rn string word,code;rn GetInfor(Weight,n);rn HuffmanCoding(HT,HC,Weight,n);rn cout<<>word;rn code=EnCoding(HC,word);rn cout<<>code;rn word=DeCoding(HC,code);rn cout<< &Weight)rnrn char c;rn n=0;rn while(cin>>c)rn rn ++Weight[c];rn n++;rn rn map::iterator Weightiter=Weight.begin();rn while(Weightiter!=Weight.end())rn rn cout<< Weight,int n)rnrn int m=2*n-1;rn map::iterator Weight_iter=Weight.begin();rn HT=(HuffmanTree *)malloc((m+1)*sizeof(HuffmanTree));rn HuffmanTree *p;rn int i;rn for(p=HT+1,i=1;iweight=(Weight_iter->second);rn p->lchild=p->rchild=p->parent=0;rn rn for(;ilchild=p->rchild=p->parent=p->weight=0;rn rn int S1,S2;rn for(i=n+1;ifirst)]=cd;rn cd.empty();rn rn ////rn map::iterator HC_iter=HC.begin();rn for(;HC_iter!=HC.end();HC_iter++)rn cout<first));rn break;rn rn rn rn return word;rn
求救,帮忙一下!谢谢!!!
sqlRoot=sqlroot&"and C.isElite=true and C.LinkUrl=" and C.BrowsePurview=" & Userlevel & order by C.OrderID"rnrn 提示这句 Microsoft OlEDB Provider for SQL Server 错误 ‘80040e14’rnrn 关键子‘and’附近有语法错误。rn
帮忙一下程序,感激不尽!!!!!
2.创建下图所示的类Shape,Circle,Square,并创建新类Shapes,创建Circle,Square的对象,并调用其方法,要求体现其多态行为。(所有<em>代码</em>均在一个文件中,文件名为Shapes.java)rnrnabstract Shapernabstract void draw();rnString what()rn以上分为两部分rn1,Circlernvoid draw();rnString what()rnrn2,Squarernvoid draw();rnString what()rnrn以下是解答,请高人们帮我<em>改</em>一<em>改</em>,基本上像是2个人写的就行,因为本人交作业急,又不是计算机专业,只好出次下策,大家谅解。rn/**java习题rn*homework 2rn*rn* @author 002733 常蓁rn* @version 1.0rn* Copyright 2002rn*/rnrn//Shapes.java 源程序:rnimport java.awt.*;rn/**rn*定义抽象类rn*/rnabstract class Shapernrn abstract void draw();rn String what()rn rn return null;rn rnrn/**rn*继承Shape类,重写其方法rn*/rnclass Circle extends Shapernrn /**rn *画一个圆,与Square的不同,体现多态rn */rn public void draw()rn rn Frame fr=new Frame("circle");rn Canvas can=new Canvas();rn fr.add(can);rn fr.setSize(200,200);rn fr.setVisible(true);rn dCircle(can);rn rn public void dCircle(Canvas c)rn rn c.setForeground(Color.red);rn c.getGraphics().fillOval(65,50,50,50);rn rn /**rn *与Square的不同,体现多态rn */rn public String what()rn rn return "This is a circle";rn rnrnrnclass Square extends Shapernrn /**rn *画一个方块,与Circle的不同,体现多态rn */rn public void draw()rn rn rn Frame fr=new Frame("square");rn Canvas can=new Canvas();rn fr.add(can);rn fr.setSize(200,200);rn fr.setVisible(true);rn dSquare(can);rn rn public void dSquare(Canvas c)rn rn c.setForeground(Color.red);rn c.getGraphics().fillRect(65,50,50,50);rn rn /**rn *输出与Circle不同,体现多态rn */rn public String what()rn rn return "This is a square";rn rnrnrnpublic class Shapesrnrn public static void main(String args[])rn rn /**rn *从命令行输入命令rn *circle就画一个圆,并输出this is a circlern *square就画一个方,并输出this is a squarern */rn String str=null;rn if(args[0].equals("circle"))rn rn Circle c=new Circle();rn c.draw();rn str=c.what();rn rn if(args[0].equals("square"))rn rn Square s=new Square();rn s.draw();rn str=s.what();rn rn System.out.println(str);rn rnrn
帮忙一下程序??
rnrnrnrn rn rnrn现在我有很多组数据需要多次调用start函数,如rnrn rn rn rn rn请问应该怎么<em>改</em>啊,希望能够完整的帮我<em>改</em>一下,因为我刚刚接触,不是很懂,谢谢了rn
帮忙一下吧。。。strcat的
#includernusing namespace std;rnrnclass Stringrnpublic:rn void strcat()rn char a[100],b[100],c[100];rn cin>>a;rn cin>>b;rn cout<<
有错误 帮忙一下
#includernvoid main()rnrndouble a;rna=3.1415;rnb=(int)a;rnprintf("%f\n",b);rnrn上面是<em>代码</em>,有一个错误,我用VC++6.0编译。大家<em>帮忙</em>修<em>改</em>一下。谢谢!
求高手帮忙一下!!!
import java.util.*;rnimport java.applet.*;rnimport java.awt.*;rnimport java.awt.event.*; rnrnpublic class Example86 extends Applet implements TextListenerrn TextArea text1,text2;rn public void init()rn text1=new TextArea(6,15);text2=new TextArea(6,15);rn add(text1);add(text2); text2.setEditable(false);rn text1.addTextListener(this) ;rn rnpublic void textValueChanged(TextEvent e)rn if(e.getSource()==text1)rn String s=text1.getText(); rnStringTokenizer fenxi=new StringTokenizer(s," ,'\n'");//空格、回车和逗号做分隔符。rn int n=fenxi.countTokens();rn String a[]=new String[n];rn for(int i=0;i<0)rn String t=a[j];a[j]=a[i];a[i]=t;rnrn rn rn text2.setText(null); //刷新显示。rn for(int i=0;i
请求大神帮忙一下
[img=https://img-bbs.csdn.net/upload/201510/21/1445408507_934915.png][/img][img=https://img-bbs.csdn.net/upload/201510/21/1445408614_234511.png][/img]
帮忙一下这段js
rn[code=javascript]rnwindow.onload=function()rn var a = document.getElementsByTagName("a");rn for(var i=0;i
帮忙一下下边的程序
document.write(" onload='javascript:ifrnrn(this.height>100)this.height=100'>");rnrn这是在网页的一个表格中显示图片,我怎样才能给这个图片加个链接呢?
帮忙一下,谢啦……
我下面的程序中的return功能怎么实现不了啊?(就是结束一项功能时不能返回到主页面再选择其他功能啊),应该是return语句有问题,请<em>帮忙</em><em>改</em>一下,谢啦!rn#includern#includern#includern#includern#includernusing namespace std;rnclass Studentrnrnprivate:rn char name[80];rn double score[3];rn double summary;rnpublic:rn int id;rn Student()rn void input()rn rn double sum=0;rn cout<>id;rn cout<>name;rn cout<<>score[i];rn sum+=score[i];rn summary=sum;rn rn bool operator summary v;rn Student s[100];rn while(true)rn rn cout<<<<<<<>x;rn if(x==1)rn system("cls");rn char p='y';rn int n=0;rn while(p=='y')rn s[n].input();rn v.push_back(*s);rn n++;rn cout<<>p;rn continue;rn rn if(p=='n')rn cout<<>d;rn while((s[i].id-d)!=0&&i!=v.size())rn i++;rn if(i==v.size())rn rn cout<<>q;rn continue;rn rn return;rn rn if(x==3)rn system("cls");rn char t;rn sort(v.begin(),v.end());rn for(int i=0;i!=v.size();i++)rn s[i].print();rn cout<>t;rn if(t=='r') return;rn rn if(x==0)rn cout<<
求人帮忙一下存储过程
以下oracle 存储过程如何<em>改</em>为sql server的rn[code=SQL]rnrnCREATE OR REPLACE rnPROCEDURE query_tmlId_proc ( areacity IN VARCHAR2, areacounty IN VARCHAR2, p_cursor OUT testpackage.test_cursor )rnASrnV_SQL varchar2(30000):= ' select ter.tml_id from ixterminal ter where ter.GROUP_ID inrn ( SELECT CG.ID FROM CINEMA_GROUP CG,CINEMA_GROUP_AREA CGA WHERE CG.ID = CGA.CINEMA_GROUP_ID AND CG.CATEGORY =1 AND AREA_PROVINCE='''||'湖南省'|| '''';rnrnbeginrnrnif areacity is not null then rnrn V_SQL:=V_SQL || ' AND CGA.AREA_CITY='''||areacity||'''';rnend if;rnrnrnif areacounty is not null then rnrn V_SQL:=V_SQL || 'AND CGA.AREA_COUNTY='''||areacounty||'''';rnend if;rnrnV_SQL:=V_SQL || ')';rnopen p_cursor for v_sql;rnend query_tmlId_proc;rnrn[/code]
帮忙把错误一下!
using System;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Web;rnusing System.Web.SessionState;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.HtmlControls;rnusing System.Configuration;rnusing System.Data.SqlClient;rnrnnamespace eshop.pagemodel.model1rnrn /// rn /// showWareByType 的摘要说明。rn /// rn public class showWareByType : System.Web.UI.Pagern rn protected System.Web.UI.WebControls.DataList dl_BookByType;rn protected static char typeID;rn protected static string strConn= ConfigurationSettings.AppSettings ["strConnection"]; rn rn private void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户<em>代码</em>以初始化页面rn //WareType字段在数据库里的值为“牛奶”“香蕉”等之类的汉字。rn ViewState["wareTypeID"]=Request.QueryString["WareType"];rn rn dl_BookByType.DataSource=GetWareMessage(char.Parse(ViewState["wareTypeID"].ToString()));rn dl_BookByType.DataBind();rn rnrn #region Web 窗体设计器生成的<em>代码</em>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 /// 设计器支持所需的方法 - 不要使用<em>代码</em>编辑器修<em>改</em>rn /// 此方法的内容。rn /// rn private void InitializeComponent()rn rn this.Load += new System.EventHandler(this.Page_Load);rn rn #endregionrnrn rn public SqlDataReader GetWareMessage(char wareTypeID)rn rn string strSQL;rn SqlDataReader result;rn SqlConnection myCn;rn SqlCommand myCm;rn tryrn rn myCn=new SqlConnection(strConn);rn strSQL="select * from Ware where Ware_ChildType="+wareTypeID;rn myCm=new SqlCommand(strSQL,myCn);rn myCn.Open ();rn result=myCm.ExecuteReader(CommandBehavior.CloseConnection);rn return result;rn rn catch(System.Data.SqlClient.SqlException er)rn rn throw new Exception(er.Message);rn rn rnrn rn rnrnrnrn这里报错:rn字符串的长度只能为一个字符。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及<em>代码</em>中导致错误的出处的详细信息。 rnrn异常详细信息: System.FormatException: 字符串的长度只能为一个字符。rnrn源错误: rnrnrn行 32: ViewState["wareTypeID"]=Request.QueryString["WareType"];rn行 33: rn行 34: dl_BookByType.DataSource=GetWareMessage(char.Parse(ViewState["wareTypeID"].ToString()));rn行 35: dl_BookByType.DataBind();rn行 36: /*tryrn rnrn源文件: e:\eshop\pagemodel\model1\showwarebytype.aspx.cs 行: 34 rnrn堆栈跟踪: rnrnrn[FormatException: 字符串的长度只能为一个字符。]rn System.Char.Parse(String s) +116rn eshop.pagemodel.model1.showWareByType.Page_Load(Object sender, EventArgs e) in e:\eshop\pagemodel\model1\showwarebytype.aspx.cs:34rn System.Web.UI.Control.OnLoad(EventArgs e) +67rn System.Web.UI.Control.LoadRecursive() +35rn System.Web.UI.Page.ProcessRequestMain() +731rnrn rn
帮忙一下错误
迷宫问题<em>代码</em>:rn[code=c]#include rn#include rn#include rn#include rn#define m 6rn#define n 8rnint maze[m+2][n+2];rntypedef struct rnint x,y;rnitem;rnitem move[8]=0,1,1,1,1,0,1,-1,0,-1,-1,-1,-1,0,-1,1;rntypedef structrnint x,y,d;rndatatype;rndatatype temp;rn#define FALSE 0rn#define TRUE 1rntypedef struct nodern int a,b,c;rn struct node *next;rnrnSeqStack;rnSeqStack * Init_SeqStack()rnrn SeqStack *top;rn top->next=NULL;rn return top;rnrnint Push_SeqStack(SeqStack *top,datatype temp)rnrn SeqStack *p;rn p=(SeqStack *)malloc(sizeof(SeqStack));rn if(p==NULL)rn return FALSE;rn p->a=temp.x;rn p->b=temp.y;rn p->c=temp.d;rn p->next=top->next;rn top->next=p;rn return TRUE;rnrnint IsEmpty(SeqStack *top)rnrn if(top->next==NULL)rn return TRUE;rn return FALSE;rnrnint Pop_SeqStack(SeqStack *top,datatype *s)rnrn SeqStack *p;rn if(IsEmpty(top))rn return FALSE;rn p=top->next;rn s->x=p->a;rn s->y=p->b;rn s->d=p->c;rn top->next=p->next;rn free(p);rn return TRUE;rnrn//迷宫rnint path(int maze[m][n],item move[8])rnrn SeqStack *s;rn int x,y,d,i,j;rn s=Init_SeqStack();rn temp.x=1;rn temp.y=1;rn temp.d=-1;rn Push_SeqStack(s,temp);rn while(!Empty_SeqStack(s))rn rn Pop_SeqStack(s,&temp);rn x=temp.x;rn y=temp.y;rn d=temp.d+1;rn while(d);rn return 0;rnrnrn[/code]rn/main.c|82|错误: expected expression before ‘’ token|rn/main.c|117|错误: expected expression before ‘]’ token|
帮忙一下,谢谢啦
源程序:rn/* ======================================== */rn/* 图形的遍历 */rn/* ======================================== */rn#include rn#define MAXQUEUE 70 /* 伫列的最大容量 */rn#includern#includern#includern#includern#includern#includernrnrnstruct node /* 图形顶点结构宣告 */rnrn int vertex; /* 顶点资料 */rn struct node *nextnode; /* 指下一顶点的指标 */rn;rntypedef struct node *graph; /* 图形的结构新型态 */rnstruct node head[61]; /* 图形顶点结构数组 */rnint visited[61]; /* 遍历记录数组 */rnrnint queue[MAXQUEUE]; /* 伫列的数组宣告 */rnint front = -1; /* 伫列的前端 */rnint rear = -1; /* 伫列的后端 */rnrn/* ---------------------------------------- */rn/* 建立图形 */rn/* ---------------------------------------- */rnvoid creategraph(int *node,int num)rnrn graph newnode; /* 新顶点指标 */rn graph ptr;rn int from; /* 边线的起点 */rn int to; /* 边线的终点 */rn int i;rnrn for ( i = 0; i < num; i++ ) /* 读取边线的回路 */rn rn from = node[i*2]; /* 边线的起点 */rn to = node[i*2+1]; /* 边线的终点 */rn /* 建立新顶点记忆体 */rn newnode = ( graph ) malloc(sizeof(struct node));rn newnode->vertex = to; /* 建立顶点内容 */rn newnode->nextnode = NULL; /* 设定指标初值 */rn ptr = &(head[from]); /* 顶点位置 */rn while ( ptr->nextnode != NULL ) /* 遍历至链表尾 */rn ptr = ptr->nextnode; /* 下一个顶点 */rn ptr->nextnode = newnode; /* 插入结尾 */rn rnrnrn/* ---------------------------------------- */rn/* 伫列资料的存入 */rn/* ---------------------------------------- */rnint enqueue(int value)rnrn if ( rear >= MAXQUEUE ) /* 检查伫列是否全满 */rn return -1; /* 无法存入 */rn rear++; /* 后端指标往前移 */rn queue[rear] = value; /* 存入伫列 */rnrnrn/* ---------------------------------------- */rn/* 伫列资料的取出 */rn/* ---------------------------------------- */rnint dequeue()rnrn if ( front == rear ) /* 检查伫列是否是空 */rn return -1; /* 无法取出 */rn front++; /* 前端指标往前移 */rn return queue[front]; /* 伫列取出 */rnrnrn/* ---------------------------------------- */rn/* 图形的广度优先搜寻法 */rn/* ---------------------------------------- */rnvoid bfs(int current)rnrn graph ptr;rnrn /* 处理第一个顶点 */rn enqueue(current); /* 将顶点存入伫列 */rn visited[current] = 1; /* 记录已遍历过 */rn printf("[%d] ",current); /* 印出遍历顶点值 */rn while ( front != rear ) /* 伫列是否是空的 */rn rn current = dequeue(); /* 将顶点从伫列取出 */rn ptr = head[current].nextnode; /* 顶点位置 */rn while ( ptr != NULL ) /* 遍历至链表尾 */rn rn if ( visited[ptr->vertex] == 0 ) /* 如过没遍历过 */rn rn enqueue(ptr->vertex); /* 递回遍历呼叫 */rn visited[ptr->vertex] = 1; /* 记录已遍历过 */rn /* 印出遍历顶点值 */rn printf("[%d] ",ptr->vertex);rn rn ptr = ptr->nextnode; /* 下一个顶点 */rn rn rnrnrn/* ---------------------------------------- */rn/* 图形的深度优先搜寻法 */rn/* ---------------------------------------- */rnvoid dfs(int current)rnrn graph ptr;rnrn visited[current] = 1; /* 记录已遍历过 */rn printf("[%d] ",current); /* 印出遍历顶点值 */rn ptr = head[current].nextnode; /* 顶点位置 */rn while ( ptr != NULL ) /* 遍历至链表尾 */rn rn if ( visited[ptr->vertex] == 0 ) /* 如过没遍历过 */rn dfs(ptr->vertex); /* 递回遍历呼叫 */rn ptr = ptr->nextnode; /* 下一个顶点 */rn rnrnrn rn
帮忙一下这个过程.
rn<em>帮忙</em><em>改</em>一下这个过程:rnrn要求:当v_cn值为0时,则sales表的cn值为系统缺省值。rn当v_cn值不为0时,则sales表的cn值为v_cn。rnrnrnrnrnCREATE OR REPLACE PROCEDURE sales_insert (rn v_ctid IN NUMBER,rn v_ctno IN NUMBER,rn v_customer IN VARCHAR2,rn v_ctmold IN VARCHAR2,rn v_model IN VARCHAR2,rn v_item IN VARCHAR2,rn v_edate IN DATE,rn v_eunit IN VARCHAR2,rn v_eucontract IN VARCHAR2,rn v_cn IN NUMBER,rn v_hk IN NUMBER,rn v_hk_er IN NUMBER,rn v_us IN NUMBER,rn v_us_er IN NUMBERrn)rnISrnBEGINrn UPDATE salesrn SET ctno = v_ctno,rn customer = v_customer,rn ctmold = v_ctmold,rn model = v_model,rn item = v_item,rn edate = v_edate,rn eunit = v_eunit,rn eucontract = v_eucontract,rn cn = v_cn,rn hk = v_hk,rn hk_er = v_hk_er,rn us = v_us,rn us_er = v_us_errn WHERE ctid = v_ctid;rnrn IF SQL%NOTFOUNDrn THENrn INSERT INTO salesrn (ctid, ctno, customer, ctmold, model,rn item, edate, eunit, eucontract, cn, hk,rn hk_er, us, us_errn )rn VALUES (test_seq.NEXTVAL, v_ctno, v_customer, v_ctmold, v_model,rn v_item, v_edate, v_eunit, v_eucontract, v_cn, v_hk,rn v_hk_er, v_us, v_us_errn );rn END IF;rnrn COMMIT;rnEND sales_insert;rn/rn
>>请帮我一下代码?<<
我想根据条件,在GRID显示合条件的记录??rnrnthisform.GRid1.RecordSource =''rnIF !USED('proinfo')rn USE proinforn ENDIFrn rnselect proinfornrninarea=ALLTRIM(thisform.text1.Value)rnrnif proinfo.pro_agent != inarearn go toprn messagebox('没有记录存在,请重请查找',48,'信息窗口')rn thisform.GRid1.RecordSource='proinfo'rn Thisform.text1.Value=''rn Thisform.text1.SetFocus rnelsernrn thisform.GRid1.RecordSource='proinfo'rn thisform.GRid1.refreshrnrnendifrnrn谢谢!rn
sos!帮帮忙一下代码
......rnprocedure Tform1.hsvtorgb(Hue:Thue;saturation,value:byte;var red,green,blue:byte);rnvarrn f,h,m,n:Double;rn a:integer;rn w,y,z:byte;rnbeginrn m:=saturation/255;rn if m=0 then //出错显示“left side cannot be assigned to”rn red:=green:=blue:=valuern elsern beginrn h:=hue/60;rn a:=hue div 60;rn f:=h-a;rn w:=value*(byte)(1-m);//出错显示’incompatibletype:‘byte’and‘extendede’下来两句同样的错误rn y:=value*(1-m*f);rn z:=value*(1-m*(1-f));rn case a ofrn 0: red:=value,green:=k,blue:=m;rn 1: red:=y,green:=value,blue:=m;rn 2: red:=w,green:=value,blue:=k;rn 3: red:=w,green:=n,blue:=value;rn 4: red:=z,green:=m,blue:=value;rn 5: red:=value,green:=m,blue:=n;rn end;rnend;rn......
帮我一下连接池代码
帮我把下面的连接池<em>代码</em><em>改</em>一下,rn我想在连接数达到maxConn时,再从连接池获取连接时,就把正在使用的第一个连接(使用最长的那个)拿去用。rnrnpackage com.aaa.db;rnrnrnimport java.io.*;rnimport java.sql.*;rnimport java.util.*;rnimport java.util.Date;rnrn/**rn* 管理类DBConnectionManager支持对一个或多个由属性文件定义的数据库连接rn* 池的访问.客户程序可以调用getInstance()方法访问本类的唯一实例.rn*/rnpublic class DBConnectionManager rn static private DBConnectionManager instance; // 唯一实例rn static private int clients;rnrn private Vector drivers = new Vector();rn private PrintWriter log;rn private Hashtable pools = new Hashtable();rn /**rn * 返回唯一实例.如果是第一次调用此方法,则创建实例rn *rn * @return DBConnectionManager 唯一实例rn */rn static synchronized public DBConnectionManager getInstance() rn if (instance == null) rn instance = new DBConnectionManager();rn rn clients++;rn return instance;rn rnrn /**rn * 建构函数私有以防止其它对象创建本类实例rn */rn private DBConnectionManager() rn init();rn rnrn /**rn * 将连接对象返回给由名字指定的连接池rn *rn * @param name 在属性文件中定义的连接池名字rn * @param con 连接对象rn */rn public void freeConnection(String name, Connection con) rn DBConnectionPool pool = (DBConnectionPool) pools.get(name);rn if (pool != null) rn if (con!=null)rn tryrn rn pool.freeConnection(con);rn System.out.println("Free Conn:" + con.toString());rn System.out.println("Current Free Connection in pool " + name + ":" +rn getFrees(name));rn System.out.println("Current Inuse Connection in pool " + name + ":" +rn getInuses(name));rn catch(NullPointerException ex)rn rn System.out.println("UCBBS System Free Conn ERROR!");rn rn rn rn rnrn /**rn * 获得一个可用的(空闲的)连接.如果没有可用连接,且已有连接数小于最大连接数rn * 限制,则创建并返回新连接rn *rn * @param name 在属性文件中定义的连接池名字rn * @return Connection 可用连接或nullrn */rn public Connection getConnection(String name) rn DBConnectionPool pool = (DBConnectionPool) pools.get(name);rn if (pool != null) rn return pool.getConnection();rn rn return null;rn rnrn /**rn * 获得一个可用连接.若没有可用连接,且已有连接数小于最大连接数限制,rn * 则创建并返回新连接.否则,在指定的时间内等待其它线程释放连接.rn *rn * @param name 连接池名字rn * @param time 以毫秒计的等待时间rn * @return Connection 可用连接或nullrn */rn public Connection getConnection(String name, long time) rn DBConnectionPool pool = (DBConnectionPool) pools.get(name);rn if (pool != null) rn return pool.getConnection(time);rn rn return null;rn rn /**rn * 将文本信息写入日志文件rn */rn private void log(String msg) rn log.println(new Date() + ": " + msg);rn rn /**rn * 将文本信息与异常写入日志文件rn */rn private void log(Throwable e, String msg) rn log.println(new Date() + ": " + msg);rn e.printStackTrace(log);rn rnrn /**rn *重至某个连接池rn */rn public void resetPool(String name) rn DBConnectionPool pool = (DBConnectionPool) pools.get(name);rn if (pool != null) rn pool.release() ;rn rn rnrn /**rn *得到现有的空连接数rn */rn public int getFrees(String name)rn DBConnectionPool pool = (DBConnectionPool) pools.get(name);rn if (pool != null) rn return pool.getFrees() ;rn rn return -1 ;rn rnrn /**rn *得到当前正在使用的连接数rn */rn public int getInuses(String name)rn DBConnectionPool pool = (DBConnectionPool) pools.get(name);rn if (pool != null) rn return pool.getInuses() ;rn rn return -1 ;rn rnrn /**rn * 关闭所有连接,撤销驱动程序的注册rn */rn public synchronized void release() rn // 等待直到最后一个客户程序调用rn if (--clients != 0) rn return;rn rn Enumeration allPools = pools.elements();rn while (allPools.hasMoreElements()) rn DBConnectionPool pool = (DBConnectionPool) allPools.nextElement();rn pool.release();rn rn Enumeration allDrivers = drivers.elements();rn while (allDrivers.hasMoreElements()) rn Driver driver = (Driver) allDrivers.nextElement();rn try rn DriverManager.deregisterDriver(driver);rn log("撤销JDBC驱动程序 " + driver.getClass().getName()+"的注册");rn rn catch (SQLException e) rn log(e, "无法撤销下列JDBC驱动程序的注册: " + driver.getClass().getName());rn rn rn rnrn
帮我一下这个代码。。
[code=text]rnresponse.Write("[")rnIF Not rstur.Bof And Not rstur.Eof Thenrni=1rnDo Until rstur.EOF OR i=harbatta+1rnresponse.Write("""id"":"""&rstur("id")&""",""title"":"""&rstur("name")&""",""updatetime"":"""&FormatDate(rstur("add"),3)&""",")rnrstur.movenextrni=i+1rnlooprnresponse.Write("]")rn[/code]rnrn显示这样。。 但是ajax 错误。。。。rn[code=text]rn["id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25","id":"245","title":"标题","updatetime":"09-25",]rn[/code]rnrn[size=18px]怎么去掉最后的 ] 前面的 , 帮我。。[/size] rnrn
求简单一下代码
[code=JScript]rn(function()var a=document.getElementsByTagName("script");rnvar scriptfile=a[a.length-1];rnif(scriptfile.parentNode!=document.body)rn if(scriptfile.parentNode.style.display=="none")rn scriptfile.parentNode.style.display="";rn rnrn)();rnif(typeof iCast_Rotator!='function')iCast_Rotator=function(o,l,w)var f;this.o=o;this.j=l;this.v=this.o==1?l:w;this.id=iCast_Rotator.id++;this.m='iCast_Rotator_'+this.id;this.n=[];this.L=new Date();this.e=0;var D=false;for(var i=0;iM&&this.L>K)I=F%this.o+1;J=this.m+'_'+I;iCast_Rotator.P(J,this.L.getTime(),1440);this.e=I;return I;elsethis.e=0;return 0;;iCast_Rotator.id=1;iCast_Rotator.B=function(N)var c=document.cookie.split("; ");for(var i=0;i
如何优化一下代码
1、问题:数据库中有个表(其中Price表示单价,Material_Count表示数量)rnPrice Material_Countrn50.00 100rn10.00 100rn1.00 10000rn500.00 100rn1.00 500rn10.00 500rn5.00 500rn5.00 500rn5.00 500rn2.00 200rn200.00 100rn200.00 400rn20.00 400rn2、希望通过SQL语句得到如下结果:rn单价 数量 金额 占比 累计占比rn200.00 400 80000.00 0.4268 0.4268rn500.00 100 50000.00 0.2668 0.6936rn200.00 100 20000.00 0.1067 0.8003rn1.00 10000 10000.00 0.0533 0.8536rn20.00 400 8000.00 0.0426 0.8962rn50.00 100 5000.00 0.0266 0.9228rn10.00 500 5000.00 0.0266 0.9494rn5.00 500 2500.00 0.0133 0.9627rn5.00 500 2500.00 0.0133 0.976rn5.00 500 2500.00 0.0133 0.9893rn10.00 100 1000.00 0.0053 0.9946rn1.00 500 500.00 0.0026 0.9972rn2.00 200 400.00 0.0021 0.9993rn(金额=单价*数量; 占比=金额/SUM(金额); 累计占比=占比的累计求和)rnrn3、本人写的SQL语句 大家觉得有没有<em>改</em>进之处:rnwith T asrn(rn SELECT Price,rn Material_Count,rn Price*Material_Count AS TotalPrice,rn SUM(Price*Material_Count) OVER() AS Total,rn Price*Material_Count/SUM(Price*Material_Count) OVER() AS Share,rn ROW_NUMBER() OVER(ORDER BY Price*Material_Count DESC) AS ROWrn FROM [Order] rn)rnSELECT Price,rn Material_Count,rn TotalPrice,rn Share,rn (select SUM(Share) from T b where b.ROW<=a.ROW) as CumrnFROM T a rnrn
大家帮我一下代码
功能是做一个排行榜,如果标题长度大于10就取子串,后面加…rn我写的这个怎么去不准阿,而且都加…rnrn10 thenrnresponse.Write left(rs("softName"),10)&"…"rnelse response.Write rs("softName")rnend ifrn%>rnrn谢谢各位啦
帮忙一句vb代码
<em>帮忙</em>把下面这句<em>代码</em>在功能不变的基础上<em>改</em>得简单一些,<em>代码</em>很长,其实就是select r.ryxm,k.wcrq,k.gzr1 as a,k.wcr1 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh 这一句变了点后不断union rnrnrn viewstate("style") = "select * from (select r.ryxm,k.wcrq,k.gzr1 as a,k.wcr1 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.gzr2 as a,k.wcr2 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.gzr3 as a,k.wcr3 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.gzr4 as a,k.wcr4 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.gzr5 as a,k.wcr5 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.gzr6 as a,k.wcr6 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.gzr7 as a,k.wcr7 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.gzr8 as a,k.wcr8 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.gzr9 as a,k.wcr9 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.gzr10 as a,k.wcr10 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.qtr1 as a,k.qtw1 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.qtr2 as a,k.qtw2 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.qtr3 as a,k.qtw3 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.qtr4 as a,k.qtw4 as b from ryqkb as r,khrjb as k where r.rybh = k.rybh union select r.ryxm,k.wcrq,k.qtr5 as a,k.qtw5 as b from ryqkb as r,khrjb as k) as bb where not a is null "rn
帮忙一段代码,谢谢
我在DataGrid中每天行记录中都加了一个System.Web.UI.WebControls.Button,绑定数据集后,当我一按记录中的按纽,就只显示当条记录,我是下面这样写的,但是实现不了,请问要怎样<em>改</em>一下,谢谢! rnrn//网页加载时的<em>代码</em>rnprotected void Page_Load(object sender, EventArgs e)rn rn string FSQLStr = " select * from T_NoteBook ";rn System.Data.SqlClient.SqlDataAdapter FsqlDataAdapter = new System.Data.SqlClient.SqlDataAdapter(FSQLStr, Fconnection);rn FsqlDataAdapter.Fill(FDataSet,"T_NoteBook");rn DataGrid1.DataSource = FDataSet.Tables["T_NoteBook"].DefaultView;rn DataGrid1.DataKeyField = "FID";rn DataGrid1.DataBind();rn rnrn//出错<em>代码</em>rnprotected void del_Click(object sender, EventArgs e)rn rn FDataSet.Reset(); rn //主要就是下面这条错了,但是我不知道要怎么样才能获到当前记录的DataKeys值。rn System.Web.UI.WebControls.DataGridCommandEventArgs E1 = (System.Web.UI.WebControls.DataGridCommandEventArgs)e;rn string FID = (string)(DataGrid1.DataKeys[E1.Item.ItemIndex]);rn string sqlstr = " select * from T_NoteBook where FID = " + FID; rn System.Data.SqlClient.SqlDataAdapter FsqlDataAdapter = new System.Data.SqlClient.SqlDataAdapter(sqlstr, Fconnection);rn FsqlDataAdapter.Fill(FDataSet, "T_NoteBook");rn DataGrid1.DataSource = FDataSet.Tables["T_NoteBook"].DefaultView;rn DataGrid1.DataKeyField = "FID";rn DataGrid1.DataBind();rn rnrn不好意思,我只有97分了:)
请大家帮忙一下如下代码,很简单的
Me.sltType.Items.Add(iLoop)rnMe.sltType.Items.Item(iLoop).Text = Trim(dsResult.Rows(iLoop).Item(0))rnMe.sltType.Items.Item(iLoop).Value = Trim(dsResult.Rows(iLoop).Item(1))rnrn以上是vb.net中的<em>代码</em>,现在要将其<em>改</em>为c#<em>代码</em>,请问该如何实现呢,rnsltType的定义是rnprotected System.Web.UI.HtmlControls.HtmlSelect sltType;
高分求助:大虾么请帮忙一下代码
rnrnrnrnrn rnrn 管理rnrnrnrn rnrnrnrn
MATLAB 自适应中值 代码 有误 高手帮忙一下
[color=#008080]<em>代码</em>有误,不能运行,哪位高手<em>帮忙</em><em>改</em>正一下[/color]rnrn<em>代码</em>:rnimage=imread('C:\Documents and Settings\Administrator\桌面\13.jpg');rnsubplot(1,2,1),imshow(image),title('有噪声索引图');rn%开始循环rnfor i=3:2:Smaxrn Zmin=ordfilt2(image,1,ones(i,i),'symmetric');rn Zmax=ordfilt2(image,i*i,ones(i,i),'symmetric');rn Zmed=medfilt2(image,[i,i],'symmetric');rn prolevelB=(Zmed>Zmin)&(Zmax>Zmed)&...~been;rn zb=(g>Zmin)&(Zmax>g);rn outZxy=prolevelB&zb;rn outZmed=prolevelB&~zb;rn f(outZxy)=image(outZxy);rn f(outZmed)=image(outZmed);rnbeen=been|prolevelB;rnif all(been(:))rn break;rn end;rnend;rnsubplot(1,2,2),imshow(image),title('自适应滤波后'); rnrnrn运行后rn[color=#FF0000]??? zb=(g>Zmin)&(Zmax>g);rn |rnError: Assignment statements do not produce results. (Use == to testrnfor equality.) [/color]
js弹出层位置问题,希望高手帮忙一下代码
<em>代码</em>如下:rn rn 收信人: rnrn rn rn 通讯录rn rn rn rn rn rn rn rn 确定rn rn rn 取消rn rn rnrn rnrn如何设置可以使得弹出层的位置位于浏览器中间?最好可以设置成qq邮箱点击收信人时弹出的弹出框一样,请高手帮我<em>改</em>一下<em>代码</em>。我用的是mvc3页面,页面没有之类的标签
一段用于套打的代码,哪位帮忙一下。
package com.jfzx.util;rnrnimport java.awt.print.*;rnimport java.awt.*;rnrnpublic class PrintTest implements Printable rn rn private String[] value = null;// "001", "002", "003";rn private int[][] position = null;// 10, 50 , 30, 70 , 50, 90 ;rn rn /**rn * implements Printablern */rn public int print(Graphics g, PageFormat pf, int pageIndex) rn /*位置2*/rn System.out.println(pageIndex);rn //只打一页rn if (pageIndex > 0) rn return Printable.NO_SUCH_PAGE;rn rnrn Graphics2D g2d = (Graphics2D) g;rn for (int i = 0; i < value.length; i++) rn String str = value[i];rn int[] temp = position[i];rn int x = temp[0];rn int y = temp[1];rnrn g2d.drawString(str, x, y);rn rn return Printable.PAGE_EXISTS;rn rn rn /*public static void main(String[] args) rn PrinterJob pj = PrinterJob.getPrinterJob();rn PageFormat pf = PrinterJob.getPrinterJob().defaultPage();rn Paper paper = pf.getPaper();rnrn //假设rn double pageWidth = 640;rn double pageHeight = 480;rn paper.setSize(pageWidth, pageHeight);rn paper.setImageableArea(0, 0, pageWidth, pageHeight);rn pf.setPaper(paper);rnrn pj.setPrintable(new PrintTest(), pf);rn if (pj.printDialog()) rn try rn /*位置1*/rn pj.print();rn catch (PrinterException e) rn e.printStackTrace();rn rn rn */rn rn public void printReport()rn rn PrinterJob pj = PrinterJob.getPrinterJob();rn PageFormat pf = PrinterJob.getPrinterJob().defaultPage();rn Paper paper = pf.getPaper();rn rn //Set Paper Sizern double pageWidth = 480;rn double pageHeight = 640;rn paper.setSize(pageWidth,pageHeight);rn rn paper.setImageableArea(0, 0, pageWidth, pageHeight);rn pf.setPaper(paper);rn rn pj.setPrintable(new PrintTest(), pf);rn rn if (pj.printDialog()) rn try rn pj.print();rn catch (PrinterException e) rn e.printStackTrace();rn rn rn rn rn /**rn * @return 返回 position。rn */rn public int[][] getPosition() rn return position;rn rn /**rn * @param position 要设置的 position。rn */rn public void setPosition(int[][] position) rn this.position = position;rn rn /**rn * @return 返回 value。rn */rn public String[] getValue() rn return value;rn rn /**rn * @param value 要设置的 value。rn */rn public void setValue(String[] value) rn this.value = value;rn rnrnrn问题:<em>代码</em>是别人给的例子,要<em>改</em>为从网页提交中得到数据,把value和position属性初始为null,加了set方法。但在页面上set数据后,在<em>代码</em>中/*位置1*/处out.print能打出东西,但在/*位置2*/处就为null了,并且报NullPointerException。为什么会变为null呢?在网页上该怎么调用?
这段代码有问题,请帮忙一下,谢谢。
主要是AJAX部分的AJAX请求有问题?rnrn[code=HTML]rn Matchrn rnrnrnrnajax部分:rnrn [/code]
请教,谁能帮忙一下下面这段代码 addnew -> Insert Into
自己很少用Insert Into,哪位大哥能<em>帮忙</em>把这段<em>代码</em><em>改</em>成 Insert Into 方法的 ,小弟先谢谢了rnrnsql = "select * from TempImageTable where user_id=" & user_idrnset rootRs = conn.execute(sql)rndo while not rootRs.Bof and not rootRs.Eofrnrnset nextRs = Server.CreateObject("ADODB.recordSet")rnsql = "SELECT * FROM ImageTable"rnnextRs.open sql,conn ,1,3rnnextRs.AddNewrnnextRs("file_type") = rootRs("file_type")rnnextRs("file_size") = rootRs("file_size")rnnextRs("file_content").AppendChunk rootRs("file_content").GetChunk(clng(rootRs("file_size")))rnnextRs("link_id") = article_idrnnextRs("create_time") = this_timernnextRs.UpdaternrnrootRs.MoveNextrnlooprnconn.execute "delete from TempImageTable where user_id=" & user_idrnrn
帮忙一下,这段代码在DOCTYPE模式下运行
如果不加DOCTYPE标签,可以运行,加上后无法正常随窗口滚动。。。rnrn[code=JScript]var specialcode=" 在线客服 在线客服"; rnrndocument.write(specialcode); rnlastScrollX=0;rnrnfunction cfsclw() rn diffY=document.documentElement.scrollTop; rn percent=.1*(diffY-lastScrollX); rnrn if(percent>0)rn percent=Math.ceil(percent); rn rn elsern percent=Math.floor(percent);rn document.getElementById("qqkf").style.top+=parseInt(percent);rn lastScrollX=lastScrollX+parseInt(percent);rn rnrnwindow.setInterval("cfsclw()",1000);[/code]
delphi 高手帮忙一下代码(DBGRID数据导入Excel)
[color=#FF0000]该程序用的是spSkinStringGrid,我想<em>改</em>成用DBGrid的[/color]unit Unit1;rnrninterfacernrnusesrn Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,rn Dialogs, Excel2000, OleServer, SkinCtrls, SkinGrids, StdCtrls, ExcelXP;rnrntypern TForm1 = class(TForm)rn Button1: TButton;rn spSkinStringGrid1: TspSkinStringGrid;rn ExcelApplication1: TExcelApplication;rn ExcelWorkbook1: TExcelWorkbook;rn ExcelWorksheet1: TExcelWorksheet;rn SaveDialog1: TSaveDialog;rn procedure Button1Click(Sender: TObject);rn procedure FormShow(Sender: TObject);rn privatern procedure toexcel(grid:TspSkinStringGrid;excelapp:TExcelApplication;excelbook:TExcelWorkbook;excelsheet:TExcelWorksheet;save:TSaveDialog);rn publicrn Public declarations rn end;rnrnvarrn Form1: TForm1;rnrnimplementationrnrn$R *.dfmrnrnprocedure TForm1.Button1Click(Sender: TObject);rnbeginrntoexcel(spSkinStringGrid1,ExcelApplication1,ExcelWorkbook1,ExcelWorksheet1,SaveDialog1);rnrnend;rnrnrnprocedure TForm1.toexcel(grid:TspSkinStringGrid;excelapp:TExcelApplication;excelbook:TExcelWorkbook;excelsheet:TExcelWorksheet;save:TSaveDialog);rnvarrnrn i,j,row,nall:integer; //定义变量,i用以储存记录的数目, j是记录的列数 row是EXCEL的行数 nall是记录的总数rnrnbeginrn if save.Execute then // 打开保存窗口,让用户选择保存的文件名rnrnbegin //inintial excel 初始化EXCELrnrn ExcelApp.Connect;rnrn ExcelApp.Workbooks.Add(Null,0);rnrn ExcelBook.ConnectTo(ExcelApp.Workbooks[1]);rnrn ExcelSheet.ConnectTo(ExcelBook.Sheets[1] as _WorkSheet);rnrn beginrnrn nall:=spSkinStringGrid1.RowCount; //保存记录的数量rnrn row:=0;rn for j:=0 to Grid.ColCount-1 do //初始化行,定位在第一 行rn beginrn Excelsheet.Cells.item[1, j+1] := Grid.Cells[j,0];rn end;rn for i:=0 to nall-1 do // total rows 正规记录,从第一条记录一直到最后循环rnrn //if i=nall then exit;rn beginrn for j:=0 to Grid.ColCount-1 do // column逐列导出动作rn beginrn ExcelSheet.Cells.Item[row+2,j+1]:=Grid.Cells[j,row+1];rn end;rn row:=row+1;rn end;rnrn end;rn //以下是导出完毕后的动作,rnrn ExcelBook.SaveCopyAs(Save.FileName+'.xls'); //加后缀名,确保最后是EXCEL文件rnrn ExcelBook.Close(false);rnrn ExcelApp.Disconnect; //断开与EXCEL的连接rnrn Screen.Cursor:=crDefault; //指针随记录而动rnrn showmessage('成功导出 '+inttostr(nall-1)+' 条数据!');rnrnend;rnrnend;rnrnprocedure TForm1.FormShow(Sender: TObject);rnbeginrn spSkinStringGrid1.Cells[0,0]:='学号';rn spSkinStringGrid1.Cells[1,0]:='姓名';rn spSkinStringGrid1.Cells[2,0]:='性别';rn spSkinStringGrid1.Cells[3,0]:='年龄';rn spSkinStringGrid1.Cells[0,1]:='1234';rn spSkinStringGrid1.Cells[0,2]:='123';rn spSkinStringGrid1.Cells[0,3]:='12';rn spSkinStringGrid1.Cells[0,4]:='1';rn spSkinStringGrid1.Cells[1,1]:='张三';rn spSkinStringGrid1.Cells[1,2]:='李四';rn spSkinStringGrid1.Cells[1,3]:='王五';rn spSkinStringGrid1.Cells[1,4]:='赵六';rn spSkinStringGrid1.Cells[2,1]:='男';rn spSkinStringGrid1.Cells[2,2]:='男';rn spSkinStringGrid1.Cells[2,3]:='男';rn spSkinStringGrid1.Cells[2,4]:='男';rn spSkinStringGrid1.Cells[3,1]:='22';rn spSkinStringGrid1.Cells[3,2]:='22';rn spSkinStringGrid1.Cells[3,3]:='22';rn spSkinStringGrid1.Cells[3,4]:='22';rnrnend;rnrnend.
java 宠物猫,有自己的代码帮忙一下,谢谢!!
下面是我自己写的,怎么体重增加的都是21点?<em>改</em>不出来,<em>帮忙</em><em>改</em><em>改</em>,十分感谢!!!rnrnimport java.util.Random;rnimport java.util.Scanner;rnrnrnpublic class Cat1 rn private String name;rn String change;rn int food;rn int foodAll;rn int waterAll;rn int water;rn int weight;rn int sportsTime;rn int count;//老鼠的数量 rn public String getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rn public Cat1(String name)rn this.name=name;rn rn //做老鼠rn Scanner input=new Scanner(System.in);rn public void catchMouse(String t)rn System.out.println("小猫是否抓到小老鼠(y/n)");rn //System.out.println("请输入小猫咪抓到老鼠的数量:");rn foodAll=foodAll+6*count;rn waterAll=waterAll+6*count;rn String want=input.next();rn if(want.equals("y"))rn System.out.println("请输入小猫咪抓到老鼠的数量:");rn count=input.nextInt();rn System.out.println("该死的猫,我们"+count+"只可爱的小老鼠又被你抓到了!!悲剧啊!!");rn elsern System.out.println("我是神探宠物猫,小老鼠这次就放你一马!!");rn rn rn rn //玩猜数字游戏rn public int productRandomNumber() rn Random random=new Random(); rn System.out.println("产生0-100随机数");rn int randomNumber=random.nextInt(100);rn System.out.println(randomNumber);rn return randomNumber;rn rn public int guessNumber()rn int randomNumber=productRandomNumber();rn rn System.out.println("请输入你的猜测:");rn int guessNumber=input.nextInt();rn int count=0;rn rn rn while(guessNumber!=randomNumber)rn if(guessNumber>randomNumber)rn System.out.println("你猜大了,再猜");rn guessNumber=input.nextInt();rn rn if(guessNumber=0)rn change= "\t"+"\n\t 一天以后,猫体重增加了"+weight+"点!";rn elsern change= "\t"+"\n\t 一天以后,猫体重减少了"+weight+"点!"; rn rn return change;rn rn //说话rn public void talk()rn System.out.println("主人你好!!猫以食为天,该吃饭了!!");rn rn public static void main(String[] args) rn Cat1 cat=new Cat1("maomi");rn cat.talk();rn System.out.println("自助早餐\n");rnrn cat.eat("7:00",4,6);rn cat.sleep("7:00~11:00",4);rn System.out.println("午餐\n");rn cat.eat("11:00",6,4);rn cat.sport("11:00~13:00",2);rn cat.playGuessNumberGame();rn cat.sleep("13:00~17:00",4);rn cat.sport("17:00~18:00",1);rn System.out.println("晚餐\n");rn cat.eat("18:00",10,10);rn cat.sport("18:00~19:00",1);rn cat.sleep("19:00~1:00",4);rn cat.catchMouse("1:00~2:00");rn cat.sport("1:00~2:00",1);rn cat.sleep("2:00~6:00",4);rnrn System.out.println(cat.weightChange());rn rn rnrn rnrn
帮忙看看这写代码哪里错了?帮忙一下?
帮<em>帮忙</em>看看这写<em>代码</em>哪里错了?<em>帮忙</em><em>改</em>一下?rnDim nodX As NodernDim cn As New ADODB.ConnectionrnDim rs As New ADODB.RecordsetrnDim sql As Stringrnsql = "select * from bm"rncn.Open Module1.ddrnrs.Open sql, cn, 1, 3rnSet nodX = TreeView1.Nodes.Add(, , "key0", "显示", 1)rn i = 1rn Do While Not rs.EOFrnSet nodX = TreeView1.Nodes.Add("key0", tvwChild, "key001" & CStr(i), rs.Fields("bm").Value, 2)rn i = i + 1rn Looprn我这是一个树,我想让子节点显示的是数据库中“bm”表中“bm”字段中的内容。rn请各位VB高手帮<em>帮忙</em>,帮小弟<em>改</em>一下。
如何显示多张图片,高手帮忙一下代码
HDC hdc; rnHBITMAP hbm; rnBITMAP bmp; rnPAINTSTRUCT ps; rnrnhdc = BeginPaint(hWnd, &ps); rnrnhbm=(HBITMAP)LoadImage(NULL,"pic.bmp",IMAGE_BITMAP, 0 ,0,LR_LOADFROMFILE); rnhdc = CreateCompatibleDC(ps.hdc); rnSelectObject(hdc,hbm); rnGetObject(hbm,sizeof(BITMAP),&bmp); rnBitBlt(ps.hdc,0,0,bmp.bmWidth,bmp.bmHeight,hdc,0,0,SRCCOPY); rnEndPaint(hWnd, &ps); rn//我试了半天,也该了半天还是不行,希望哪位高手<em>帮忙</em>搞一下下啊!!能显示多张图片立即给分rn哭死了!![img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/42.gif][/img]
各位大哥看看我的这段代码,帮忙一下!!
这是我做的家庭监控系统的部分<em>代码</em>,谁<em>帮忙</em><em>改</em>一下rn现在比较的是320*240像素的图片,我现在想把320*240像素的图片分割成12块进行每一块的比较,不知那位大哥<em>帮忙</em><em>改</em>一下,小弟不胜感激!rnrn//计算距离rn int pfh = 0; //平方和rn p1 = buf1;rn p2 = buf2;rn for (i=0; i 5000000 )rn rn printf("%d\n",pfh);rn rn elsern rn rn rn/*rn //显示部分数据rn printf("The first line of bitmap is :\n");rn p1 = buf1;rn p2 = buf2;rn //for(j=0; j 0 )rn rn// fprintf( fpResult, "%s\t%d\n", opt_file.name, pfh );rn fprintf( fpResult, "%s\t%d\n", file1, pfh );rn rn strcpy ( file1, opt_file.name );rn rn rn _findclose(result_val);rnrn fclose(fpResult);rn // To be completed.rn return 1;rnrnrnint main()rnrn Init("Jpg2Bitmap.dll");rn cout << "Begin" << endl;rn dir_travel_current_dir ( "*.jpg" );rn cout << "Completed." << endl;rn return 1;rnrnrn
VB中的查找代码,求高人帮忙一下!
一下一段用VB作的小区物业管理系统中“查找”部分的<em>代码</em>,rn但是却不能运行rn求高人指点一下,小女子深表感谢rnrnPrivate Sub Command5_Click()rnIf Text1.Locked = True Or Text2.Locked = True Or Text3.Locked = True Or Text4.Locked = True Or Text5.Locked = True Thenrn Text1.Locked = Falsern Text2.Locked = Falsern Text3.Locked = Falsern Text4.Locked = Falsern Text5.Locked = Falsern MsgBox "请输入查找编号"rn Text1.Text = ""rn Text2.Text = ""rn Text3.Text = ""rn Text4.Text = ""rn Text5.Text = ""rn Text1.SetFocusrn Elsern Dim arn a = "投诉编号=" & "'" & Text1.Text & "'"rn Data1.Recordset.FindFirst arn If Data1.Recordset.NoMatch Thenrn MsgBox "没有此记录"rn Elsern Text1.Locked = Truern Text2.Locked = Truern Text3.Locked = Truern Text4.Locked = Truern Text5.Locked = Truern End IfrnEnd IfrnEnd Sub
请帮我一下这段代码,请帮忙
下面这个函数,我用onclick=selectRow()可以选中当前列,没有问题。请<em>帮忙</em><em>改</em>第二个函数。rn (一)rnfunction selectRow()rn rn if(table!=null && oldrowno!=null)rn rn table.rows(oldrowno).style.backgroundColor=oldColor;rn rn if(event.srcElement.tagName.toLowerCase()=='td')rn rn if(table==null)rn rn table=event.srcElement.parentNode.parentNode;rn rn currowno=event.srcElement.parentNode.rowIndex;rn rn CurrowRow=event.srcElement.parentNode;rn oldrowno=currowno;rn rn rn if(event.srcElement.tagName.toLowerCase()=='tr')rn rn if(table==null)rn rn table=event.srcElement.parentNode;rn rn currowno=event.srcElement.rowIndex;rn CurrowRow=event.srcElement;rn oldrowno=currowno;rn rn if(CurrowRow!=null)rn rn oldColor=CurrowRow.style.backgroundColor;rn CurrowRow.style.backgroundColor=newColor;rn rn rnrnrn(二)以下这个函数,可以用上下键在记录间上下移动,但是只是显示移动,[color=#FF0000]没有选中突出显示的行[/color],请<em>帮忙</em><em>改</em>一下,怎么样在上下移动的同时,选中当前行。就是用上下键移动时,突出显示的行达到(一)上面这个函数的效果。rn function ChangePage(KeyCode,url)rn rn rn if (KeyCode == 38)rn rn if(currowno>1)rn rnrn if(table!=null && currowno>1 && oldrowno!=null)rn rn table.rows(oldrowno).style.backgroundColor=oldColor;rn rn currowno--;rn if(table!=null && currowno>0)rn rn oldColor=table.rows(currowno).style.backgroundColor;rn table.rows(currowno).style.backgroundColor=newColor;rn rn oldrowno=currowno;rn rn rn rn if (KeyCode == 40 )rn rn if(currowno
数据结构与算法--栈&队列 很好的哦 欢迎下载
数据结构与算法--栈&队列 很好的哦 欢迎下载 相关下载链接:[url=//download.csdn.net/download/streetskg/2772341?utm_source=bbsseo]//download.csdn.net/download/streetskg/2772341?utm_source=bbsseo[/url]
WDK8官网原版(1)下载
鉴于微软下载速度巨慢,前一位同志太黑,故打包上传,内有使用说明,希望大家喜欢!! 相关下载链接:[url=//download.csdn.net/download/tony_0620/5099981?utm_source=bbsseo]//download.csdn.net/download/tony_0620/5099981?utm_source=bbsseo[/url]
flash 水波菜单下载
flash 水纹理菜单,模仿水纹理波动,且CPU负载经过优化,基本不会超过30%,带FLA源文件,带代码注视。 相关下载链接:[url=//download.csdn.net/download/tripbird/5325469?utm_source=bbsseo]//download.csdn.net/download/tripbird/5325469?utm_source=bbsseo[/url]
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件
我们是很有底线的