这3行和tabs.query相关的代码到底哪出了问题。。

想实现一个功能:打开新tab时,检测当前有没有百度的tab,如果有(为了测试方便,该百度的tab一开始就存在了),那就关闭掉该tab。这功能一开始我是做成了,但后来不知道发神经修改了哪里,导致出了BUG。后来为了测试方便,我把“关闭掉tab”的语句改成了"window.alert(tb.length)",看看有没有值传到tb上,结果tb.length输出为0,意味着并没有搜到百度的tab(但是前面说了,该百度tab我是提前打开了的,理应能匹配的到)

chrome.tabs.onCreated.addListener(function(tab) {

chrome.tabs.query({url:"https://www.baidu.com/"},function(tb){alert(tb.length)});

});


至于json的文件,我是一直没动过的,应该没什么问题,不过一起发上来吧:
"manifest_version": 2,
"name": "demo",
"version": "1.0.0",
"description": "简单的Chrome扩展demo",
"permissions": ["storage"],
"permissions": ["tabs"],
"permissions": [ "activeTab"],

"background":
{
"scripts": ["background.js"],
"persistent": false
}

1个回答

配置文件出错了啊,json对象出现多个相同的属性,只有最后一个生效,所以 你的permissions只对当前激活的tab有效,无权限访问所有tabs,整合一起就行了


{
    "manifest_version": 2,
    "name": "demo",
    "version": "1.0.0",
    "description": "简单的Chrome扩展demo",
    "permissions": ["storage","tabs","activeTab"],

    "background":
    {
        "scripts": ["background.js"],
        "persistent": false
    }
}
vainquit
vainquit 啊啊啊啊啊啊啊啊啊啊啊!!!确实是这里出了问题!!!!幸亏我来CSDN问不然给我一万年我都没想到要在json找原因,十分感谢
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
到底哪出了问题
我在运行别人已做好的一个员工信息管理网站时,主页面可以打开,数据库的信息也可以显示。点击添加信息的按钮本应另打开一个窗口,却出现IE自己关闭,火狐发出浏览器崩溃报告的情况,用VS2010自带的WEB浏览器也不行。但网站放到别人同样配置的电脑上却一切正常。我用的是VS2010+MSSQL2005。我怀疑是不是VS或MSSQL出了问题。各位大侠以前遇到过吗?
这到底出了什么
各位仁兄,我有一点Java的基础,现初学EJB。rn 以前我用Jcreator2.5+J2SE1.4很好用,但因为要学EJB需要J2EE所以我又安装了J2EE1.4,但在Jcreator中输入“javax.”时后面没有出现“ejb...”的提示,我只好手动输入,在编译时,出错,好像是没有找到“ejb...”的包的提示信息,编译没有通过。我又在Jcreator中的JDK路径设在J2EE的目录,再次编译,这次好用,但没出现class文件,这到底是为什么呢?rn 还有我发现J2EE1.4中带有一系列的工具,就连布署等工具都有,请问各位,J2EE1.4中的工具都有什么具体的实用功能。rn如有回答,万分感谢!!!
这到底哪错了?????
int i;rnchar **p;rnp = (char**)malloc(10);rnfor(i = 0;i < 10;i++)rnrn p[i] = (char*)malloc(5);rnrnrnfor(i = 0;i < 10;i++)rnrn free(p[i]);rnrnrnfree(p);rnrn运行到最后一句free(p);出错,为什么
请帮我看下到底哪出了问题
document.write(' rn');rn我通过调用rn rn不行,直接放到html里头可以,这是个关闭弹窗代码
xml,到底哪出了语法问题
以下是本人写的一个XML文件,去掉DTD定义,可以执行.应该是DTD那段定义,不合语法,本人实在是没找出问题点.各位大虾,帮小妹看看,先谢了!rnrnrnrnrnrn rn rn rn rn rn ]>rnrn rn rn rn rn
这程序到底哪错了!
test.jsprn<%@ page contentType="text/html;charset=GB2312" import="java.sql.*,java.io.Serializable,java.util.*" %>rnrnrn rn 论坛1-WZXrnrnrnrnrn<%rnString message = "agc";rn%>rn<%=message%>rnrn<%rntryrnrnConnection conn=connBean.setConnection("db2");rnString sql="select * from user";rnResultSet rs=connBean.setResultSet(sql);rn%>rn<%rnrs.afterLast();rnwhile(rs.previous())rnrn%>rn<%=rs.getString("user_name") %>rn<%rnrn%>rn<%rnrs.close();rnconn.close();rnrncatch(Exception e)rnrnout.println(e.getMessage());rnrn%>rnrnrnrnconn.javarnpackage db;rnimport java.sql.*;rnimport java.lang.*;rnpublic class connrnrnprivate Connection conn=null;rnprivate Statement stm=null;rnprivate ResultSet rs=null;rnpublic conn()rnrnrnrnpublic Connection setConnection(String db)rnrnString dbs="jdbc:odbc:"+db;rntryrnrnClass.forName("sun.jdbc.odbc.JdbcOdbcDriver");rnconn=DriverManager.getConnection(dbs);rnrncatch(Exception e)rnreturn conn;rnrnrnpublic ResultSet setResultSet(String sql)rnrntryrnrnstm=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);rnrs=stm.executeQuery(sql);rnrncatch(Exception e)rnreturn rs;rnrnrnrnrn这程序一运行就会显示null ,我有点搞不懂,我的表里是有数据的,还有数据源名称,无论我改成什么好象都无所谓。rnrn环境jdk1.4.2_11+tomcat5.0.28+winxp sp2
我这到底哪错了?链表问题
下面是部分代码:rnrntypedef struct Nodernrn int data;rn struct Node * pNext;rnNODE, *PNODE;rnrnPNODE create_list(void)rnrn int len, i;rn int val;rn PNODE pHead = (PNODE)malloc(sizeof(NODE));rn if (pHead = NULL)rn rn printf("\nÄÚ´æ·ÖÅäʧ°Ü!³ÌÐòÖÕÖ¹!\n");rn exit(-1);rn rn PNODE Ptail = pHead;rn Ptail->pNext = NULL;rn printf("请输入您需要产生的节点数: len = ");rn scanf("%d", &len);rn rn rn for (i = 0; i < len; i++)rn rn PNODE Pnew = (PNODE)malloc(sizeof(NODE));rn if (Pnew == NULL)rn rn printf("\n分配内存失败!\n");rn exit(-1);rn rn printf("\n请输入第%d个节点的数值 : ", i + 1);rn scanf("%d", &val);rn rn Pnew->data = val;rn Ptail->pNext = Pnew;rn Pnew->pNext = NULL;rn Ptail = Pnew;rn rn rn return pHead;rnrnrnint main(void)rnrn PNODE pHead = NULL;rn pHead = create_list();rn return 0;rnrnrnrnrnrnvc6.0真蛋疼,不报错,我还运行不下去,求指点
这代码 哪错了?
这是我在网上复制的 贴到自己的VS里 最后2行出错 说 什么....没有找到合适的方法XX的 怎么解决啊 ? 谢谢rnrnrn在Form1下放一个pictruebox1; rn定义 rn private TcpListener tcp =null; rn private Socket socket = null; rn private NetworkStream ns = null; rn private StreamReader sr = null; rn private StreamWriter sw = null; rn private Thread tcpThread = null; rn//写一个监控接收数据的方法 rnpublic void getRemote() rn rn IPAddress ip = IPAddress.Parse("192.168.1.3"); rn tcp = new TcpListener(ip,9420); rn tcp.Start(); rn socket = tcp.AcceptSocket(); rn ns = new NetworkStream(socket); rn sr = new StreamReader(ns); rn sw = new StreamWriter(ns); rn if (socket.Connected) rn rnrn try rn rn while (true) rn rn rn byte[] b = new byte[1024*256]; //设置接收的大小 rn int i = this.socket.Receive(b);//接收 rn //把byte[]转化成内存流,在把内存流转化成Image, rn System.Drawing.Image myimage = System.Drawing.Image.FromStream(new MemoryStream(b)); rn showScreen.Image = myimage; //显示 rn rn rn rn catch (Exception ex) rn rn this.tcp.Stop(); rn MessageBox.Show("捕捉屏幕出错!server"+ex.Message); rn rn rn rn//在加载事件中启动线程 rn tcpThread = new Thread(new ThreadStart(getRemote)); rn tcpThread.Start(); rn
这代码错哪了?
[code=Java]import java.awt.Canvas;rnimport java.awt.Color;rnimport java.awt.FlowLayout;rnimport java.awt.Frame;rnimport java.awt.Graphics;rnimport java.awt.Label;rnrnpublic class CanvasExample extends Framern CanvasExample Cansl;rn Label message=new Label("Welcome to IBM Displayed Using");rn rn CanvasExample()rn CanvasExample Cansl=new CanvasExample();rn setLayout(new FlowLayout());rn setTitle("Canvas Example");rn rn setBackground(Color.orange);rn rn add(Cansl);rn add(message);rn setSize(300,100);rn setVisible(true);rn rn rn public static void main(String[] args)rn CanvasExample testCAV=new CanvasExample();rn rnrn[/code]rn不明白哪里错了,分不多,高人来看看吧。。。
到底哪里出了问题?????
我编写了一个小的Applet的程序来计算一个球体的体积,编译通过,但运行的时候,输入数字并回车后报错,找了很久找不到问题所在,求达人帮忙看看,程序代码如下:rnimport java.applet.Applet;rnimport java.awt.*;rnrnpublic class SphereTest extends Appletrnrn Label label1;rn TextField tf1;rn rn public void init()rn rn label1= new Label("请输入球体的半径:");rn tf1=new TextField(10);rn add(label1);rn add(tf1); rn rn public boolean action(Event e,Object o)rn rn Double val=new Double(toString());rn double radius=val.doubleValue();rn showStatus("Volume is "+Double.toString(sphereVolum(radius)));rn rn return true;rn rn public double sphereVolum(double radius)rn rn double volume;rn volume=(4/3)*Math.PI*Math.pow(radius,3);rn return volume;rn rnrnrn错误提示为:rnrn java.lang.NumberFormatException:For input string:"SphereTest[pane 10.0.0.250x150,layout=java.awt.FlowLayout]"rn at java.lang.NumberFormatException.forInputStringrn at java.lang.FloatingDecimal.readJavaFormatStringrn at java.lang.Double.valueOfrn at java.lang.Double.rn at SphereTet.actionrn at java.awt.Component.handleEventrn at java.awt.Component.postEventrn at java.awt.Component.postEventrn at java.awt.Component.dispatchEventImplrn at java.awt.Component.dispatchEventrn at java.awt.EventQueue.dispatchEventrn at java.awt.EventDispatchThread.pumpOneEventForHierarchyrn at java.awt.EventDispatchThread.pumpEventForHierarchyrn at java.awt.EventDispatchThread.pumpEventsrn at java.awt.EventDispatchThread.runrn
到底那里出了问题?
小地初学asp,win2k,下面这段代码,不知那里出了问题:rn<%SET RS=Server.CreateObject("ADODB.Recordset")rnRS.OPEN"Select E_mail FROM Table1","DSN=ASPdb1"rnWHILE NOT RS.EOF %>rn<%=RS("E_mail")%>rn<%RS.MoveNext%>rn rn<%WEND%>rnrnE_mail是table1中的一个字段,在odbc中已配置了系统dnsrnASPdb1,该文件在虚拟目录MYASP下,在IE中用//127.0.0.1/MYASPrn下浏览,不报错,但看不到结果,不知是什么原因?rn不知调试ASP有没有调试工具,比如可以支持断点,或单步调试?rn
到底哪里出了问题?
#include "Neptune.h" #include "Platinum.h" #include #include #include #include #include /* definations of sa_family structre,htons,INADDR_ANY,... */ #include /* name ip format */ #include /*g
到底哪里出了问题??
Project ConsumeApp.exe raise exeception class EOleException with message 'ERROR:parser error at or near "form"'.process stopped;rn到底是哪里出问题了?rn各位大虾请教!!!
是哪出了问题?
#includernrn#define YES 1rn#define NO 2rnrnint htoi(char s[])rnrn int hexdigit;rn int i;rn int inhex;rn int n;rnrn i = 0;rn if (s[i] == '0')rn rn ++i;rn if (s[i] == 'x' || s[i] == 'X')rn rn ++i;rn rn rn n = 0;rn inhex = YES;rn for (; inhex == YES; ++i)rn rn if (s[i] >= '0' && s[i] <= '9')rn rn hexdigit = s[i] - '0';rn rn else if (s[i] >= 'a' && s[i] <= 'f')rn rn hexdigit = s[i] - 'a' + 10;rn rn else if (s[i] >= 'A' && s[i] <= 'F')rn rn hexdigit = s[i] - 'A' + 10;rn rn elsern rn inhex = NO;rn rn if (inhex == YES)rn rn n = 16 * n + hexdigit;rn rn rn return n;rnrnrnint main(void)rnrn int n;rn char str[5] = "OX24";rnrn n = htoi(str);rn printf("string = %s integer = %d\n", str, n);rn return 0;rnrnrn此题目要求是把由十六进制数字组成的字符串(包含可选的前缀0X或0x)转换为与之等价rn的整型值。字符串中包含的数字包括0~9,a~f,A~F。rn我输入OX24,但得到的结果确是0. 调试观看了内存的变化,本应在判断0X后,i=2,但是现在i=0,请问是哪出了问题呢?谢谢rn
谁帮我看看 这代码到底出了什么错
package mars.Ac1;rnrnimport android.app.Activity;rnimport android.content.DialogInterface;rnimport android.content.DialogInterface.OnClickListener;rnimport android.content.Intent;rnimport android.os.Bundle;rnimport android.view.View;rnpackage mars.Ac1;rnrnimport android.app.Activity;rnimport android.content.DialogInterface;rnimport android.content.DialogInterface.OnClickListener;rnimport android.content.Intent;rnimport android.os.Bundle;rnimport android.view.View;rnimport android.widget.Button;rnrnpublic class Ac1 extends Activity rn /** Called when the activity is first created. */rn private Button myButton=null;rn @Overridern public void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.main);rn myButton=(Button)findViewById(R.id.myButton);rn [color=#FF0000] myButton.setOnClickListener( ew MyButtonListener());[/color] rn [color=#FF0000]class MyButtonListener implements OnClickListener[/color]rn public void onClick(View c) rn // TODO Auto-generated method stubrn Intent intent=new Intent();rn intent.setClass(Ac1.this, OtherAc.class);rn Ac1.this.startActivity(intent);rn rn rn rnrn rn rnrn红色部分老是现实错误
哪出了问题?
当到我到首页的时候,列出相应的菜单,把首页超连接给成当前的地址(schoolhome.do?method=logining&id=1(请求方式)),当在首页的时候,确成了在 WEB-INF 的目录下.rn请高手指点!!!谢谢!!!
帮忙看看这段代码哪出了问题?
代码如下:rn rnrnrn上面代码,当我选择了页面里的checkbox后执行,出现"选择成功"的提示,但是在不选择chexbox时执行,确没有提示,请问是哪出了问题?
这运行怎么会这样?到底哪错了?
![图片说明](https://img-ask.csdn.net/upload/201511/07/1446903910_561168.jpg)
3行代码 基础问题
[code=c]signed char a=0xe0;rnunsigned int b=a;rn rnunsigned char c=a;[/code]rnrn如果ac是char类型 a!=c 如果是int类型 ==rn为什么
到底哪的问题??
[code=C#]rn//谁能给分析下 那里出问题了.rn#include rn#include rnrnrnstruct CStrDatarnrn int nDataLength; rn int nAllocLength; rn //return data buffer,想当与与data buffer = 实际分配的起始地址+ sizof( CStrData )rn char* data()rn return (char*)(this+1); rn;rnrnclass CStrrnrnpublic:rn CStr();rn CStr( char * str);rn CStr( CStr & obj );rn ~CStr();rnprivate:rn void AllocBuffer( int nlen ) ;rn void Init();rn CStrData* GetCStrData() const;rn void ReleaseBuffer();rn int GetReferenceCount();rn int GetDataLength() const;rnrnpublic:rnrn operator char * () const return ( char * ) m_pchData ; rn CStr& operator = ( const CStr& stringSrc );rn char & operator []( const int & index );rn int GetLen() const;rn int GetAllocLength() const;rn char * GetBuffer();rnprotected:rn char * m_pchData;rnrn;rnrnbool operator == ( CStr & CStrObj1, CStr & CStrObj2 );rnusing namespace std;rnrnCStr::CStr()rnrn Init();rnrnrnCStr::CStr( char * str )rnrn int len = strlen( str ) + 1 ;rn Init();rn AllocBuffer( len );rn strcpy( GetBuffer(), (char *)str);rnrnrnCStr::CStr( CStr & obj )rnrn char * ObjBuffer = obj.GetBuffer();rn Init();rn AllocBuffer( obj.GetLen()+1 );rn strcpy( GetBuffer(),(char *)ObjBuffer);rn *GetCStrData() = *obj.GetCStrData();rnrnrnCStr::~CStr()rnrn ReleaseBuffer();rnrnrnvoid CStr::ReleaseBuffer()rnrn int i = 0;rn if( m_pchData )rn rn m_pchData = ( char * )GetCStrData();rn delete[] m_pchData;rn rn m_pchData = NULL;rnrnrnchar * CStr::GetBuffer()rnrn return m_pchData;rnrnrnvoid CStr::Init()rnrn m_pchData = NULL;rn //ReleaseBuffer();rn rnrn//分配CStrData和data buffer 的内存rnvoid CStr::AllocBuffer( int nLen )rnrn if( nLen == 0 )rn Init();rn else rn rn CStrData* pData;rn if( nLen <= 64 )rn rn pData = ( CStrData* )rn new char[ sizeof(CStrData) + ( 64 )*sizeof( char )];rn pData->nAllocLength = 64;rn rn else if( nLen <= 128 )rn rn pData = ( CStrData* )new rn char[ sizeof(CStrData) + ( 128 )*sizeof( char )];rn pData->nAllocLength = 128;rn rn else if( nLen <= 256 )rn rn pData = ( CStrData* )new rn char[ sizeof(CStrData) + ( 256 )*sizeof( char )];rn pData->nAllocLength = 256;rn rn else if( nLen <= 512 )rn rn pData = ( CStrData* )new rn char[ sizeof(CStrData) + ( 512 )*sizeof( char )];rn pData->nAllocLength = 512;rn rn elsern rn pData = ( CStrData* )new rn char[ sizeof(CStrData) + ( nLen )*sizeof( char )];rn pData->nAllocLength = nLen;rn rn pData->data()[nLen] = '\0';rn pData->nDataLength = nLen;rn m_pchData = pData->data();rn rnrnrnCStrData* CStr::GetCStrData() constrnrn return ( CStrData* ) m_pchData - 1 ;rnrnrnint CStr::GetReferenceCount()rnrn return ( ( CStrData* ) m_pchData - 1 )->nDataLength;rnrnrnint CStr::GetDataLength() constrnrn return( ( CStrData* ) m_pchData - 1 )->nDataLength;rnrnrnint CStr::GetAllocLength() constrnrn return m_pchData ? ( ( CStrData* ) m_pchData - 1 )->nAllocLength : 0;rnrnrnint CStr::GetLen() constrnrn return GetDataLength()- 1;rnrnrnchar & CStr::operator [] ( const int & index )rnrn return m_pchData[ index ];rnrnrnbool operator == ( CStr & CStrObj1, CStr & CStrObj2 )rnrn if( CStrObj1.GetLen() == CStrObj2.GetLen() )rn rn if ( !strcmp( CStrObj1.GetBuffer(), CStrObj2.GetBuffer() ) )rn return true;rn elsern return false;rn rn elsern return false;rnrnrnCStr& CStr::operator=( const CStr& stringSrc )rnrn if( GetAllocLength() != stringSrc.GetAllocLength() )rn rn ReleaseBuffer();rn //???????????????????????????rn //改写成AllocBuffer( stringSrc.GetAllocLength() ); rn //或者是64的倍数就报错?????AllocBuffer( 64*n );rn ////???????????????????????????rn AllocBuffer( 64 ); rn *GetCStrData() = *stringSrc.GetCStrData(); rn rn strcpy( GetBuffer(), stringSrc.m_pchData );rn return *this;rnrnrnvoid main()rnrn CStr str1(" word");rn CStr str3;rn str3 = "hello ";rnrnrnrnrn[/code]
请大家看看下面这3行代码的问题
string fileName=this.openFileDialog1.FileName;rnsReader=new StreamReader(fileName,System.Text.Encoding.Unicode)this.richTextBox1.Text=sReader.ReadToEnd();rnrn为什么我在RichTextBox中看到的都是乱码呢?
到底哪出了问题? 谁来帮帮我啊,郁闷啊
以下程序究竟哪出了问题,谁来帮帮我,谢了!rn#include rn#include rn#include rn#include rnclass Workerrn public:rn char name[20];rn int id;rn float wage;rn rn istream& operator>>(istream& istr, Worker& x) rn rn istr>>x.name>>x.id>>x.wage;rn return istr;rn rn ostream& operator<<(ostream& ostr, Worker& x)rn rn ostr<>worker;rn cout<>' has too many parametersrn2. error C2333: '>>' : error in function declaration; skipping function bodyrn3. error C2804: binary 'operator <<' has too many parametersrn4. error C2333: '<<' : error in function declaration; skipping function bodyrn5. error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class Worker' (or there is no acceptable conversion)rn6. error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class Worker' (or there is no acceptable conversion)rnError executing cl.exe.rn
自定义菜单:这代码错哪了?
![图片说明](https://img-ask.csdn.net/upload/201601/13/1452682850_455595.jpg)n![图片说明](https://img-ask.csdn.net/upload/201601/13/1452682874_321633.jpg)n![图片说明](https://img-ask.csdn.net/upload/201601/13/1452682886_123654.jpg)n![图片说明](https://img-ask.csdn.net/upload/201601/13/1452682901_760967.jpg)n![图片说明](https://img-ask.csdn.net/upload/201601/13/1452682917_265393.jpg)n![图片说明](https://img-ask.csdn.net/upload/201601/13/1452682929_625733.jpg)n
我这代码错哪了????
[code=java]import java.awt.Button;rnimport java.awt.CardLayout;rnimport java.awt.Frame;rnrnrnpublic class NewCardLayoutrnrn public static void main(String[] args)rn rn Frame f=new Frame();rn f.setLayout(new CardLayout());rn f.add(new Button("按钮一"),"card1");rn f.add(new Button("按钮二"),"card2");rn f.add(new Button("按钮三"),"card3");rn f.setBounds(100,100,250,250);rn f.setVisible(1);rn rn [/code]rnrnrn[img=https://img-bbs.csdn.net/upload/201608/10/1470784548_44569.jpg][/img]
这万年历的代码错哪了?
nn```n #includenusing namespace std;n#includenint daysofmonth[13]=0,31,28,31,30,31,30,31,31,30,31,30,31;nint Isleap_year(int year)nn if((year%4==0&&year%100!=0)||year%400==0)n return 1;n elsen return 0;nnint get_days(int y,int m,int d)nn int i,count=d; //公年元年1月1日是星期1n for(i=1;i>year;n cout<<"======================= The calender of year "<b[j])n break;n cout<b[j],n<=8-m+1;n++)n cout<<" ";n if(a[j]>b[j]&&m!=8)n cout<<" ";n n cout<
火星人来了!!这到底出了啥问题呀
#include conio.hrn#include unistd.hrn#include stdlib.hrn#include dmotor.hrn#include dsensor.hrn#include tm.hrnrntid_t task1, task2;rnrn[color=#FF0000]int mythread_1(int argc, char argv[])[/color] rnint i;rnwhile (1)rnfor(i=0; i50; i++)rnif(random() % 2 == 0)rn motor_a_dir(fwd);rn motor_a_speed(100); move forwardsrn motor_c_dir(fwd);rn motor_c_speed(100);rn sleep(2);rnrnelsern motor_a_dir(rev);rn motor_a_speed(80);rn motor_c_dir(rev); move backwardsrn motor_c_speed(80);rn sleep(2);rn end forrn end whilern end mythread_1rnrnrnrnrn[color=#FF0000]int mythread_2(int argc, char argv[]) [/color]rnwhile (1) rn if (touch_1)rn cputs(Damn it);rn motor_a_dir(rev);rn motor_a_speed(80);rn motor_c_dir(rev); move backwardsrn motor_c_speed(80);rn sleep(1);rn rn // end whilern end mythread_2rnrnrnint main() rn //seed the radom number generatorrnsrandom(get_system_up_time());rnrn// start the two children threads goingrntask1 = execi(&mythread_1, 0, 0, PRIO_NORMAL, DEFAULT_STACK_SIZE);rntask2 = execi(&mythread_2, 0, 0, PRIO_NORMAL, DEFAULT_STACK_SIZE);rnrnmsleep(10000);rnwhile (!shutdown_requested()) rn detects if the OFF button is pressedrn msleep(100);rnrnkill(task1);rnkill(task2);rnrnmotor_a_dir(off);rnmotor_c_dir(off);rnreturn 0;rnrnrnrn诊断如下:rnerror: a function-definition is not allowed here before"" toke( 红十字部分)rnrn因为在学C++所以只能放在这里了rnrn为什么????
求解3行代码!
new(a_SendMsg);rn a_SendMsg^:=Read_SendMsg(stream);rn Msg_Body:=a_SendMsg;rn请问这3行代码应该怎样理解?
3行代码。。。
/*输出成绩*/rnvoid PrScore(void)rn rn char str[10];rn setfillstyle(SOLID_FILL,YELLOW);rn bar(50,15,220,35);rn setcolor(6);rn settextstyle(0,0,2);rn sprintf(str,"score:%d",score);rn outtextxy(55,20,str);rnrn请问最后3行代码是什么意思?以及他的用法。。
不知道哪出了问题,求解。。
#include "stdio.h"rn#define size 7rnvoid change(int a[],int size);rnvoid print(int a[],int size);rnvoid mian()rnrn int i,score[size];rn printf("please input %d rank:",size);rn for(i=0;i
这段程序哪出了问题?
for(int i...)rnrnchar _PXSQL[20]; rnsprintf(_PXSQL, "update emp set INDEX = %d", 20);rnthis->_OraDB->ExecuteSQL(_PXSQL);rnthis->_OraDset->Update();rnrnrnrn目的是想修改emp表中当前记录的index字段值为20。index是number类型的。程序的this->_OraDB->ExecuteSQL(_PXSQL);并没有出错,但是在下次循环时出错了。rn
我这段代码到底出了什么错?
function fixquotes(str) '把一个单引号变成两个单引号rnfixquotes=replace(str,"'","''")rnend functionrnrnrnrnfunction addfiles(path)rn set fileobject=server.createobject("scripting.filesystemobject")rn set folder=fileobject.getfolder(path)rn isfile=1rn rn for each thing in folder.filesrn sql="addfilms "rn set file=fileobject.getfile(thing)rn sql=sql+"'"+fixquotes(file.name)+"'"+"," rn sql=sql+"'"+fixquotes(thing)+"'"+"," '这里出错了rn rn if path=m_path then '是第一层目录rn sql=sql+"'"+fixquotes(m_type)+"'"+","rn elsern sql=sql+"'"+fixquotes(fileobject.getfolder(path).name)+"'"+","rn end ifrn rn sql=sql&file.size&","rn sql=sql&isfilern con.execute(sql)rn nextrn rn isfile=0rn for each thing in folder.subfoldersrn sql="addfilms "rn set file=fileobject.getfolder(thing)rn sql=sql+"'"+fixquotes(file.name)+"'"+","rn sql=sql+"'"+fixquoets(thing)+"'"+","rn rn if path=m_path then '是第一层目录rn sql=sql+"'"+fixquotes(m_type)+"'"+","rn elsern sql=sql+"'"+fixquotes(fileobject.getfolder(path).name)+"'"+","rn end ifrn rn sql=sql&file.size&","rn sql=sql&isfilern con.execute(sql)rn rn addfiles(thing)rn nextrnend functionrnrn出错提示为:rn错误类型:rnMicrosoft VBScript 运行时错误 (0x800A000D)rn/films/addfilmsresult.asp, 第 57 行rnrn
请问——这段代码到底那里出了错?
情况:数据库了有数据 user是字段名,我的调试环境是w2000,vbscriptrn提示:aaa=rs("curvalue")这句有错。(有时还说user=Request.QueryString("user") )很急,希望得到答案。谢谢。rnrn<% rnSet conn = Server.CreateObject("ADODB.Connection") rndbpath=server.MapPath("count.mdb") rnconn.open "driver=Microsoft Access Driver (*.mdb);dbq=" & DbPath rnuser=Request.QueryString("user") rnrn'计数值加1 rnsql="update counttable set curvalue=curvalue+1 where user='" & user & "'" rnrnset rs=conn.Execute(sql)rnsql="select curvalue from counttable where user='" & user & "'" rnset rs=conn.Execute(sql)rn'定义chgimg函数,将计数值用图形表示 rnrnfunction chgimg(curvalue) rns=curvaluernfor i=1 to len(s) rn'请注意,在正式使用计数器时,图片的路径一定要使用实际路径 rng=g & "" rnnext rnchgimg=g rnend function rn'调用chgimg函数(传入计数器值) rnaaa=rs("curvalue")rn'toimg=chgimg(rs("curvalue")) rntoimg=chgimg(aaa)rnrntoimg="document.write(" & "'" & toimg & "')" rnrn''输出 rnResponse.Write(toimg) rnrs.close rnset rs=nothing rnconn.Close rnset conn=nothing rn%>
margin 到底出了什么问题?
在下面的文件中使用 margin 出了奇怪的问题:rnrnrnrnrn rn rn rn rnrnrn rn rn abcrn rnrnrnrnrn将上面 body 标签改为: 时,文件的左右上下都没有空白处。rnrn而引用 style.css 文件时,在 ... 之间加入 后,四周却有了空白。rnrnstyle.css 文件内容如下:rn rnrn这倒底是什么原因,搞不明白。rn望高手指教!!!rnrn
看到底出了什么问题?
ListView显示适配器内容的问题。rn1、整个过程若都写在UI里,正常。代码如下:rn[code=java]@Overridern protected void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.main_layout);rn initData();//初始化数据rn ma = new MyAdapter(MainActivity.this, list);rn listView.setAdapter(ma);rn [/code]rnrn2、加一个菜单,开子线程,消息传递至UI,不正常。代码如下:rn[code=java]@Overridern protected void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.main_layout);rn initData();//初始化数据rn [/code]rnrnUI里接收消息并处理rn[code=java]private Handler hander = new Handler() rn public void handleMessage(android.os.Message msg) rn switch (msg.what) rn case SUCCESS:rn Log.d("TTAAGG","适配器运行测试i");rn ma = new MyAdapter(MainActivity.this, list);rn listView.setAdapter(ma);rn break;rn default:rn break;rn rn ;rn ;[/code]rnrn[code=java] @Ovpublic boolean onOptionsItemSelected(Menuerridern Item item) rn switch (item.getItemId()) rn case R.id.item1_add:rn new Thread(new Runnable() rn public void run() rn hander.sendEmptyMessage(SUCCESS);rn rn ).start();rn break;rn case R.id.item2_clear:rn list.clear();rn ma.notifyDataSetChanged();rn break;rn case R.id.item3_exit:rn flag = false;rn this.finish();rn break;rn rn return super.onOptionsItemSelected(item);rn [/code]rnrn请教这到底是什么原因呢?
IE6.0到底出了什么问题?
IE6.0到底出了什么问题?rn================rn我装windows 2000severrn装VS.Net,offiec 2000都正常,rn可是装了visio 2000以后,出问题了!rn======================rnIE6.0无法显示网页字体的颜色,只能显示黑色,rn字体大小,和关于对话框都得很难看!rnrnrnrnrnrn
到底出了没?
如果出了有没有中文教程下载。
到底出了什么错?
HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperExceptionrn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:856)rnrnrnroot cause rnrnjava.lang.NullPointerExceptionrn org.apache.jsp.code.index_jsp._jspService(index_jsp.java:88)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:856)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:856)rnrnrnnote The full stack trace of the root cause is available in the Tomcat logs.rnrnrntomcat 的信息窗口提示:rnsql.executequery:invalid authorization specification:access denied for user:'s kyyj@127.0.0.1'(using password:yse)rn
到底出了什么问题?
rnrn 管理-添加新闻rnrnrn<%rnif request.form("submit") = 1 thenrn '此文件建立ADODB.Connection对象connrn set rsNews = Server.CreateObject("ADODB.RecordSet")rn rsNews.open "SELECT * FROM News",conn,adOpenDynamic,adLockOptimisticrn 'rsNews.AddNewrn 'rsNews("title") = Cstr(request.form("title"))rn 'rsNews("source") = Cstr(request.form("source"))rn 'rsNews("content") = Cstr(request.form("content"))rn 'rsNews("type") = Cint(request.form("typeid"))rn 'rsNews.Updatarn response.write "添加成功!"rn response.Redirect "xxx.asp" rn rsNews.closern set rsNews = nothingrn '此文件关闭connrnelsern%>rn rn标题: rn来源: rn类型: 新闻 公告 rn内容: rnrnrnrnrn<% rnend ifrn%>rnrnrnrnrnrn运行后,提示错误为rnADODB.Recordset error '800a0bb9' rnrnArguments are of the wrong type, are out of acceptable range, or are in conflict with one another. rnrn/AddNews.asp, line 11 rnrn为何原因?大家救救我吧!
主板到底出了什么问题?
我的主板可以通电,CPU风扇和显示风扇都转动的.rnCPU,内存没问题在别的主板上可以用,开机就是什么也检测不到.rn不知道主板出了什么问题:(
到底出了什么问题
class personrnrn int age;rnlong number;rnchar *name;rnpublic;rnperson()name=0;age=0;number=0;rnfriend istream & operator(istream &,person&);rnvoid print()rnrncout<<"name: "<>a.name;rnis>>a.age;rnis>>a.number;rnreturn is;rnrnvoid main()rnrnperson man;rnis>>man;rnman.print();rnrn开始时提示is没有定义,将is改为cin后编译通过rn但当输入 luhuayi 22 2973270 时rn输出结果为rn name:rn age: 22rn number:2973270rn Null pointer assignmentrn为什么会这样呢?哪个地方出错了 我用的编译器是tc 3.0rn
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表