linux bash脚本看看哪错了 20C

代码:
#!/bin/bash

FFMPEG_BIN="ffmpeg-4.2.2/ffmpeg"
MUSIC_PATH="music"

if [[ -d ${MUSIC_PATH} ]]; then
echo "MUSIC_PATH exists."
flac_files=find ${MUSIC_PATH} -name "FLAC1_*.flac"
if [[ -z "${flac_files}" ]]; then
echo "No flac files in directory ${MUSIC_PATH}"
exit
fi
echo "Start to convert flac format to mp3 format"
for input_file in ${flac_files}
do
output_file=${input_file/flac/mp3}
echo -e "\n${input_file} ==> ${output_file}"
${FFMPEG_BIN} -i "$input_file" -ab 320k -map_metadata 0 "${output_file}"
done
else
echo "MUSIC_PATH doesn't exist."
fi


输出结果:
MUSIC_PATH exists.
No flac files in directory music

大佬们看看哪错了上面一部分代码可以执行主要是下面一部分执行不了。或者重新帮忙写段代码(谢谢!)
问题是:

用vim写个bash脚本,判断某个文件是否存在,如果存在,调用ffmpeg将文件夹下以FLAC1_ 开头的扩展名为.flac的文件转换为mp3格式

10个回答

在线急等如果有用马上采纳给C币

music路径问题吧,试试./music

xcgh
xcgh find ${MUSIC_PATH} -name "FLAC1_*.flac"这个命令替换完执行一下,看看是否好使
大约一年之前 回复
qq_41711757
qq_41711757 试过了不是路径的问题改了之后还算一样
大约一年之前 回复

终端命令上只有这个
MUSIC_PATH exists.
No flac files in directory music

直接在终端测试一下这个语句啊,
find ${MUSIC_PATH} -name "FLAC1_*.flac"

看看这个语句的输出,这个path先手动写好,如果直接执行都没有结果就是这句有问题了

sunsloth
sunsloth 回复qq_41711757: flac_files=find ${MUSIC_PATH} -name "FLAC1_*.flac"这一句没有执行,需要改为flac_files=·find ${MUSIC_PATH} -name "FLAC1_*.flac"· ,执行后赋值给变量就可以了,测试成功。前后的符号是tab键上边那个。
大约一年之前 回复
sunsloth
sunsloth 回复qq_41711757: flac_files=find ${MUSIC_PATH} -name "FLAC1_*.flac"
大约一年之前 回复
qq_41711757
qq_41711757 输出结果是./key/FLAC1_1.flac
大约一年之前 回复

find ${MUSIC_PATH} -name "FLAC1_*.flac" 改为·find ${MUSIC_PATH} -name "FLAC1_*.flac"·

图片说明

qq_41711757
qq_41711757 这是详细代码你们看看
大约一年之前 回复

#!/bin/bash

MUSIC_PATH="/opt/test"

if [[ -d ${MUSIC_PATH} ]]; then
echo "MUSIC_PATH exists."
flac_files=find ${MUSIC_PATH} -name "file*"
if [[ -z "${flac_files}" ]]; then
echo "null"
fi
fi

输出结果
[root@localhost test]# sh test.sh
MUSIC_PATH exists.
[root@localhost test]# vi test.sh

sunsloth
sunsloth 回复qq_41711757: MUSIC_PATH exists. No flac files in directory music,你这个输出就证明进了这个分支了,这就有问题了,走不到后边的。还有就是你的输出结果怎么可能是./key/FLAC1_1.flac这个呢。。。你这个sh文件放在什么目录。。。
大约一年之前 回复
qq_41711757
qq_41711757 主要是后面的转换mp3格式前面的因该是对的有输出就是后面那个没输出
大约一年之前 回复

把flac_files=find ${MUSIC_PATH} -name "FLAC1_*.flac"改成flac_files=$(find ${MUSIC_PATH} -name "FLAC1_*.flac")或者flac_files=find ${MUSIC_PATH} -name "FLAC1_*.flac",这样才是执行find命令取文件查找结果,否则是执行music -name "FLAC1_*.flac"命令,同时把flac_files=find也作为参数传给这个命令

反引号没显示出来:
图片说明

xjw_87
xjw_87 回复qq_41711757: 那你脚本原本应该没问题的,确定flac文件是在music目录下?试试MUSIC_PATH="key"呢?
大约一年之前 回复
qq_41711757
qq_41711757 改了之后还是以前的那个结果
大约一年之前 回复

find那句不是单引号,是上句号,键盘最左边的波浪线的那个键盘。
示例代码如下图:
图片说明
运行结果
MUSIC_PATH exists.
music/FLAC1_1.flac music/FLAC1_2.flac

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
帮忙看看哪错了,
using System;rnusing System.Collections;rnusing System.Configuration;rnusing System.Data;rnusing System.Linq;rnusing System.Web;rnusing System.Web.Security;rnusing System.Web.UI;rnusing System.Web.UI.HtmlControls;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.WebControls.WebParts;rnusing System.Data.SqlClient;rnusing System.Xml.Linq;rnrnnamespace Jingcairnrn public partial class _Default : System.Web.UI.Pagern rnrn protected void Page_Load(object sender, EventArgs e)rn rn if (Session["Username"] == null)rn rn Response.Redirect("login.aspx");rn return;rn rn elsern rn SqlConnection con = new SqlConnection("server=127.0.0.1;database=Toupiao;uid=sa;pwd=sa");rn con.Open();rn int username = int.Parse(Request.QueryString["username"].ToString());rn SqlDataAdapter sd2 = new SqlDataAdapter("select * from Usermain where Username='" + username + "' ", con);rn DataSet ds2 = new DataSet();rn sd2.Fill(ds2);rn TextBox2.Text = Session["Username"].ToString();rn TextBox3.Text = ds2.Tables[0].Rows[0]["Gold"].ToString();rn rnrn rnrn protected void Button1_Click(object sender, EventArgs e)rn rnrn rn rnrnrn现在提示int username = int.Parse(Request.QueryString["username"].ToString());rn未将对象引用到实例
帮我看看哪错了
SortList 0rnFunction SortList(SortID)rnset rs=conn.execute("select * from SortSet where Layer="&SortID&" order by id asc")rnwhile not rs.eofrnSortID=rs("id")rn %>rn > rn <%= rs("id") %>rn <%= rs("SortName") %>rn <%= rs("SortPath") %>rn <%= rs("Trem") %>rn ">修改 rn ">删除rn rn<% rnSortList SortIDrnrs.movenextrnwendrnEnd Functionrnrn这段代码有什么问题 应该怎么改正rn我用的是2003 SQL SERVER 2000 前天装了个VS.net 昨天还好使呢 今天不知道怎么了就不行了 总是提示rnrnADODB.Recordset 错误 '800a0bcd' rnBOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。rn
看看哪错了
[code=C/C++]rn报时程序,时间到则晃8次鼠标rnvoid CDailyDlg::OnTimer(UINT_PTR nIDEvent)rnrn switch (nIDEvent)rn rn case 1://LClickrn break;rn case 2://Timern KillTimer(2);rn POINT pt;GetCursorPos(&pt);rn for(int i=0;i<8;i++)rn SetCursorPos(pt.x,pt.y); Sleep(500); SetCursorPos( pt.x+30<=1024?pt.x+30:pt.x-30, pt.y);rn SetDlgItemText(IDC_BtnTime,"time");rn break;rn rn CDialogEx::OnTimer(nIDEvent);rnrn[/code]rn没有报语法错误,但是时间到了后鼠标仅移动了一次
帮忙看看哪错了
#include rn#include rnrnusing namespace std; rnint main(int argc, char *argv[]) rn int i,j; rn const int m=3; rn const int n=3; rn double a[m*n]=rn 1,2,3,rn 4,5,6,rn 7,8,9,rn ; rn double b[n*m]; rn for(i=0;i
帮我看看哪错了???
我用下面的程序读c:\1.dll的资源rnrnDim ArnA = LoadLibrary("C:\1.dll")rnDim CC As StringrnCC = String(255, " ")rnLoadString A, 1, CC, 255rnMsgBox CCrnrn可CC返回空rn快帮帮我,谢谢!!!!!!!!
给我看看 哪错了
![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/1.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/1.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/1.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/1.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/1.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/1.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/1.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/1.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/1.gif)![图片](https://img-ask.csdn.net/upload/201512/27/1451184057_370619.jpeg)
帮看看哪错了
#include rn#include rnrntypedef struct _t rn rn int num;rn char * aa;rnrnt;rnvoid test()rnrn char * c;rn c=(char *) malloc (1000*sizeof(char));rn t *pM=(t * )malloc (sizeof(c)*sizeof(t));rn strcpy(pM->aa,"test");rn pM->num=1;rnrnrnmain()rnrn test();rn return 0;rn
帮忙看看哪错了!
请帮我看看哪里错了,我JS是白痴! 呵呵,我想判断姓名是汉字 和 身份证号码是15位或18位! 下面的代码分开可以用,但我不会整合! 帮我改一下!rnrn非常感谢提供代码的两位兄弟。谢谢了!rnrn rn rnrn rn 姓 名:rnrnrn *rnrnrn rn 身份证号码:rnrn rnrn*rnrn rn
帮忙看看哪错了?
#include rnvoid swap(int *x,int *y)rnint t;rn t=*x;rn *x=*y;rn *y=t;rnrnvoid inv(int *x,int *y,int *z)rnif(*x<*y) swap(*x,*y);rn if(*y<*z) swap(*y,*z);rn if(*x<*y) swap(*x,*y);rnrnvoid main()rnint a,b,c,*p1=&a,*p2=&b;*p3=&c;rnscanf ("%d,%d,%d",p1,p2,p3);rnprintf("a=%d,b=%d,c=%d\n",a,b,c);rninv(a,b,c);rnprintf("max=%d,,mid=%d,min=%d\n",*p3,*p2,*p1);rnrncannot convert parameter 1 from 'int' to 'int *'rn这是什么??rn该怎么改呢?rnps:最近我在学指针rnrn
帮忙看看哪错了?
String ed1;rn String ed2;rn if ((Edit1->Text!="")&&(Edit2->Text!=""))rn rn ed1=Trim(Edit1->Text);rn ed2=Trim(Edit2->Text);rn LoginForm->ADOQuery1->Close();rn LoginForm->ADOQuery1->SQL->Clear();rn //关键可能是这个地方>>>rn LoginForm->ADOQuery1->SQL->Add("select * from login_table where ((login_name="+ed1+")&&(login_password="+ed2+"))");rn LoginForm->ADOQuery1->Open();rn //以上<<<<<<RecordCount!=0)rn rn MessageBox(LoginForm->Handle,"登录成功!欢迎使用学生管理信息系统!","信息提示",MB_OK+MB_ICONINFORMATION+MB_SYSTEMMODAL);rn LoginForm->Close();rn LoginForm->ModalResult = 8;rn rn elsern MessageBox(LoginForm->Handle,"用户名或密码错误!请重新输入!","信息提示",MB_OK+MB_ICONINFORMATION+MB_SYSTEMMODAL);rnrn rn rn elsern MessageBox(LoginForm->Handle,"用户名和密码均不能为空!","信息提示",MB_OK+MB_ICONINFORMATION+MB_SYSTEMMODAL);rnrn编译的时候没有错误,为什么一运行的时候就出错了呢?rn
帮忙看看哪错了。
Printer.CurrentX = 500rn Printer.CurrentY = ROWSETrn Printer.Print "1111111111111111111111111111111111"rn Printer.EndDocrn lret = OpenPrinter(Printer.DeviceName, mhPrinter, pDef)rn lret = GetJob(mhPrinter, 1, 1, PJOB, 2000, 2000)rnrn各类型已定义。可以运行,mhPrinter 已有数据返回,LRET 返回0,PJOB 返回0 ,没有获得PJOB的信息。rnrn怎样才可获得有信息的返回?rnrnPJOB 是 BYTE 类型。如何取得其中的STATUS信息?rnrn
帮看看哪错了!!!!
[code=HTML] rn邮箱: rnrnrn [/code]
帮我看看哪错了?
HKEY hkey;rn char *ch;rn DWORD cbdata;rn RegOpenKey(HKEY_CURRENT_USER,"SoftWare\\hidewindow",&hkey);rn RegQueryValueEx(hkey,"title",NULL,REG_SZ,(unsigned char*)ch,&cbdata);rn RegCloseKey(hkey);rn rnrn错误:rn:\char26\hidedrives\hidedrivesDlg.cpp(129) : error C2664: 'RegQueryValueExA' : cannot convert parameter 4 from 'const int' to 'unsigned long *'rn Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
帮忙看看哪错了,
CountSQL="select count(*) from (" & sql & ")"rn CountRS.Open CountSQL,conn,1,3 rn CountRecord = CountRS("count(*)")rn n=CountRecord / 12rn response.write n
看看 哪错了
我想做的是,把一个字符串,从第n个开始输出![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/12.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/12.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/12.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/12.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/12.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/12.gif)![图片](https://img-ask.csdn.net/upload/201512/21/1450688687_743375.jpg)
看看哪出错了
写一个C或者C++程序完成字符串的转换,如把2008转换为1个2,2个0,1个8,即122018;my2009转换为1m1y122019rnrnrnrnrnrn#include "stdio.h"rn#include"string.h"rnchar * fun(char *p)rnrn char *s,t;rn int i=0,j=0;rnrn for(i=1;*p!='\0';p++,j++)rn rn t=*p;rn for(i=0;*p==t;p++)rn rn i++;rn rn *(s+(j++))=i;rn *(s+j)=*(--p);rn rn *(s+j)='\0';rn return s;rnrnrnvoid main()rnrn char *a;rn scanf("%s",a);rn printf("%s",fun(a));rnrnrn
哪错了哪错了哪错了哪错了 抓狂
switch(cmd) /* 入力信号種別は? */rn case SIG_KIND_SETUP_REQ :rn setup_req(trk_p); /* セットアップ要求処理 */rn break ;rn case SIG_KIND_SETUP_KAN :rn setup_kan(trk_p); /* セットアップ完了処理 */rn break ;rn rnrnSIG_KIND_SETUP_REQ 是常量
大侠们看看哪错了
protected void Button1_Click(object sender, System.EventArgs e)rn rn[color=#FF0000]string username=Session["username"].ToString ();rn if(username.ToString ().Trim ().Length ==0)rn rn Response.Redirect (" ");rn [/color]rn elsern rnrnrn这是一个点击预订按钮,点击时判断登陆与否,再执行是否能预订,但总是报错啊!
帮忙看看存储过程哪错了
alter proc AllSelectrn@cz varchar(50),rn@czzl varchar(50),rn@th varchar(50),rn@xmmc varchar(50),rn@zl varchar(50),rn@mxsjwcrq smalldatetime,rn@mxzl varchar(50),rn@mxzzdw varchar(50),rn@gysjlb varchar(50),rn@zjsjwcrq smalldatetime,rn@tozjsjwcrq smalldatetime,rn@tomxsjwcrq smalldatetimernasrnrnrndeclare @strWhere varchar(500)rnset @strWhere ='select N.*,I.* from NewProductTrialManufacturing N inner join ImageCode I on N.th=I.th where 1=1'rnif (@cz != '') rnbegin rn print '1'rn set @strWhere = @strWhere+' and N.cz ='+''''+@cz+''''rnendrnif @czzl <>'无'rn set @strWhere= @strWhere+' and N.czzl ='+''''+@czzl+''''rnif @th <>''rn set @strWhere = @strWhere+' and N.th ='+''''+@th+''''rnif @xmmc <>''rn set @strWhere = @strWhere+' andI. xmmc='+''''+@xmmc+''''rnif @zl <>'无'rn set @strWhere = @strWhere+' and I.zl='+''''+@zl+''''rnif @mxsjwcrq <>''rn set @strWhere = @strWhere+' and N.mxsjwcrq between '+''''+@mxsjwcrq+''''+ 'and '+''''+@tomxsjwcrq+''''rnif @mxzl <>'无'rn set @strWhere = @strWhere+' and N.mxzl='+''''+@mxzl+''''rnif @mxzzdw <>'无'rn set @strWhere = @strWhere+' and N.mxzzdw='+''''+@mxzzdw+ ''''rnif @gysjlb <>'无'rn set @strWhere = @strWhere+' and N.gysjlb='+''''+@gysjlb+''''rnif @tozjsjwcrq <>''rn beginrn set @strWhere = @strWhere+' and I.zjsjwcrq between '+''''+@zjsjwcrq+''''+ 'and '+''''+@tozjsjwcrq+''''rn endrnrnprint @strWherernexec(@strWhere)rnGOrnrn为什么提示rn从字符串转换为 smalldatetime 数据类型时发生语法错误。
大家帮忙看看哪错了
//这个程序是学生信息管理的一个程序,要求用数组和链表分别实现,rn//但在用数组给链表赋值时,感觉没赋到起,请高手看看哪不对!,谢谢rnrn#includern#includern#includern#includern#define N 3rn#define MAXXH 12rn#define MAXXM 10rnstruct studentrn char xuehao[MAXXH];rn char xingming[MAXXM];rn float yuwen;rn float shuxue;rn float yingyu;rn float zongfen;rn stu[40];rntypedef struct Studentrn char Xuehao[MAXXH];rn char Xingming[MAXXM];rn float Yuwen;rn float Shuxue;rn float Yingyu;rn float Zongfen;rn struct Student *next;rn linklist;rnvoid createarray()rnrn int i;rn float x,y,z;rn printf("please input the message of student!\n");rn for(i=0;iXuehao,stu[i].xuehao);rn strcpy(L->Xingming,stu[i].xingming);rn L->Yuwen=stu[i].yuwen;rn L->Shuxue=stu[i].shuxue;rn L->Yingyu=stu[i].yingyu;rn L->next=lk;rn lk=L;rn i++;rn rn L=lk;rn while(L!=NULL)rn rn L->Zongfen=L->Yuwen+L->Shuxue+L->Yingyu;rn L=L->next;rn rnrnvoid arraysort()rnrn int i,j;rn int flag=1;rn struct student temp;rn for(i=0;flag&&i=i;j--)rn if(stu[j].zongfen>stu[j-1].zongfen)rn rn flag=1;rn temp=stu[j];rn stu[j-1]=stu[j];rn stu[j]=temp;rn rnrnvoid sort(linklist *lk)/*用链表实现为升序排序*/rnrn linklist *aa,*bb,*cc;rn int flag=1;rn bb=lk;rn while(flag&&bb)rn rn flag=0;rn aa=bb;rn while(aa->next)rn rn cc=aa->next;rn if(aa->Zongfen>cc->Zongfen)rn rn flag=1;rn bb=aa;rn aa=cc;rn cc=bb;rn rn aa=aa->next;rn rn bb=bb->next;rn rnrnvoid linksort(linklist *lk)/*将升序排列的链表就地逆置,以实现将总分实现以降序排列*/rnrn linklist *aa,*bb,*cc;rn sort(lk);rn aa=lk;rn cc=aa->next;rn while(cc)rn rn bb=cc->next;rn cc->next=aa;rn aa=cc;rn cc=bb;rn rn lk->next=NULL;rn lk=aa;rnrnint arraysearchxh(char xh[])rnrn int i,j,k;rn for(i=0;iXuehao[i]==xh[i])rn rn k++;rn if(k==MAXXH)rn return 1;rn continue;rn rn elsern break;rn L=L->next;rn rn return 0;rnrnint linksearchxm(linklist *lk,char xm[])rnrn int i,k=0;rn linklist *L;rn L=lk;rn while(L!=NULL)rn rn for(i=0;iXuehao[i]==xm[i])rn rn k++;rn if(k==MAXXM)rn return 1;rn continue;rn rn elsern break;rn L=L->next;rn rn return 0;rnrnvoid disp_array()rnrn int i;rn for(i=0;iXuehao,L->Xingming,L->Yuwen,L->Shuxue,L->Yingyu,L->Zongfen);rn printf("\n");rn L=L->next;rn rnrnvoid main()rnrn linklist head;rn char ch;rn char hh[MAXXH],mm[MAXXM];rn createarray();rn printf("the disp student message!\n");rn disp_array();rn createlink(&head);rn disp_link(&head);rn dorn rn printf("please choose the array work or link work:\n");rn printf("a or A is array work!\n");rn printf("l or L is link work!\n");rn printf("e or E is exit!\n");rn scanf("%c",&ch);rn switch(ch)rn rn case 'a':rn case 'A':rn arraysort();rn disp_array();rn printf("please input xuehao or xingming of searching: \n");rn gets(hh);gets(mm);rn if(arraysearchxh(hh))rn printf("the xuehao of searching is succeed!\n");rn elsern printf("the xuehao of searching is not succeed!\n");rn if(arraysearchxm(mm))rn printf("the xingming of searching is succeed!\n");rn elsern printf("the xingming of searching is not succeed!\n");rn break;rn case 'l':rn case 'L':rn linksort(&head);rn disp_array(&head);rn printf("please input xuehao or xingming of searching: \n");rn scanf("%s%s",hh,mm);rn if(linksearchxh(&head,hh))rn printf("the xuehao of searching is succeed!\n");rn elsern printf("the xuehao of searching is not succeed!\n");rn if(linksearchxm(&head,mm))rn printf("the xingming of searching is succeed!\n");rn elsern printf("the xingming of searching is not succeed!\n");rn break;rn rn while(ch!='E'&&ch!='e');rnrnZ
帮忙看看哪错了,谢谢
想用递归删除目录:rnrn#! usr/bin/perlrnrnuse strict;rnrnsub delete_tree rn my($nextname,$where);rn $where = $_[0];rn print "dirr $where\n";rn while (defined($nextname = glob("$where/*"))) rn if (-d $nextname) rn delete_tree($nextname);rn else rn unlink($nextname);rn print "deleting $nextname...";rn rn rn rmdir($where);rnrnrndelete_tree('c:/a_Temp');rnrn运行后产生死循环,请帮忙排错。rnrn另有没有函数可以直接删除非空目录?谢谢了。
帮忙看看哪错了 急急
#include rn#include rnrnusing namespace std;rnstruct itmrnrn int a;rn int m;rn struct itm *next;rn;rnitm node;rnint sum=0;rnint x;rnvoid insert(itm *&first,itm *second)rnrn first->next->next->next->next=second;rnrnint Tsum(itm *first)rnrn while(first!=NULL)rn rn for(int i=0;i<=first->m-1;i++)rn x*=x; rn sum=sum+first->a*x;rn first->m=first->next->m;rn first->a=first->next->a;rn first=first->next;rn rn return sum;rn rnint main(int argc, char *argv[])rn rn itm *first=NULL;rn itm *second=NULL;rn first=new itm;rn first->next=new itm;rn first->next->next=new itm;rn first->next->next->next=new itm;rn first->next->next->next->next=NULL;rn first->a=6;rn first->next->a=-4;rn first->next->next->a=2;rn first->next->next->next->a=7;rn first->m=5;rn first->next->m=3;rn first->next->next->m=1;rn first->next->next->next->m=0;rn second=new itm;rn second->next=new itm;rn second->next->next=new itm;rn second->a=7;rn second->next->a=8;rn second->next->next->a=3;rn second->m=4;rn second->next->m=3;rn second->next->next->m=1;rn second->next->next->next=NULL;rn cout<<"请输入x的值:"<
帮忙看看代码哪错了.
import java.awt.BorderLayout;rn rnimport javax.swing.JButton;rnimport javax.swing.JPanel;rn rnpublic class ddd extends JPanelrn rn private JPanel ctrlPanel = new JPanel();rn rn public ddd()rn rn this.add(ctrlPanel,BorderLayout.SOUTH);rn rn public void setCtrlPanel(JPanel ctrlPanel) rn this.ctrlPanel = ctrlPanel;rn rn rn public JPanel getCtrlPanel()rn rn return ctrlPanel;rn rn rnrn rnclass CommonPanel extends JPanelrnrn private JButton addBtn = new JButton("添加");rn private JButton updateBtn = new JButton("修改");rn private JButton delBtn = new JButton("删除");rn private JButton cancelBtn = new JButton("取消");rn rn public CommonPanel()rn rn add(addBtn);rn add(updateBtn);rn add(delBtn);rn add(cancelBtn);rn rnrn rnimport javax.swing.JButton;rnimport javax.swing.JFrame;rnimport javax.swing.JPanel;rn rnpublic class ee extends dddrn private JButton addBtn = new JButton("添加");rn private JButton updateBtn = new JButton("修改");rn private JButton delBtn = new JButton("删除");rn private JButton cancelBtn = new JButton("取消");rn rn ee()rn rn// JPanel p3 = this.getCtrlPanel();rn// p3.add(addBtn);rn// p3.add(updateBtn);rn// p3.add(delBtn);rn// p3.add(cancelBtn);rn rn JPanel p3 = new CommonPanel();rn rn this.setCtrlPanel(p3);rn rn rn rn rn /**rn * @param argsrn */rn public static void main(String[] args) rn // TODO 自动生成方法存根rn JFrame ff = new JFrame();rn ff.setSize(500,400);rn rn ee e1 = new ee();rn ff.add(e1);rn ff.setVisible(true);rn rn rnrnrn rnrnrn我用setCtrlPanel方法改变了this.ctrlPanel 的引用,为什么界面不会出现那4 个按钮。 rn
帮我看看哪错了,怎么改?
代码如下: rn FileInfo ourFile = new FileInfo(@"f:\boot.txt");rn ourFile.CopyTo(@"f:\boot.bak"); rnrn总是报错:找不到文件“f:\boot.txt”rn我该如何改进才能看到在f盘中创建的文件rnrnrn
帮看看哪错了,谢谢
FILE *p;rn p=fopen("a.txt","r");rn char buffer[30];rnrn if(p!=NULL)rn rn cout<<"打开了!"<
大神看看哪错了,两天了
[code=php]rn$sql = "INSERT INTO patient (order,name,age,sex,tel,qq,disease,media_from,area,ordertime,teshuyaoqiu,content,ordertag,beizhu,zixun_id) VALUES('$order','$name','$age','$tel','$qq','$disease','$media_from','$area','$ordertime','$teshuyaoqiu','$content','$ordertag','$beizhu','$zixun_id')";rnrnif (mysql_query ( $sql, $conn )) rn exit ( '添加成功!点击此处 首页' );rn else rn echo '抱歉!添加数据失败:', mysql_error (), ' ';rn echo '点击此处 返回 重试';rnrnrn[/code]rnrn运行结果:rn抱歉!添加数据失败:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order,name,age,sex,tel,qq,disease,media_from,area,ordertime,teshuyaoqiu,content,' at line 1rn点击此处 返回 重试
谁能帮我看看,哪错了
一、ASP.NET的Web Servicernrnusing System;rnusing System.Collections;rnusing System.Linq;rnusing System.Web;rnusing System.Web.Services;rnusing System.Web.Services.Protocols;rnusing System.Xml.Linq;rnrn/// rn///Mybank 的摘要说明rn/// rn[WebService(Namespace = "http://tempuri.org/")]rn[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]rn//若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。 rn// [System.Web.Script.Services.ScriptService]rnpublic class Mybank : System.Web.Services.WebService rnrn public Mybank () rnrn //如果使用设计的组件,请取消注释以下行 rn //InitializeComponent(); rn rnrn [WebMethod]rn public string HelloWorld(string name) rn return "Hello World,"+name;rn rn rnrnrn==================================================================================================rn二、Java调用rn rnimport org.apache.axis.client.Call;rnimport org.apache.axis.client.Service;rnimport javax.xml.namespace.QName; rnrnpublic class testrnrn public String getResult() rn String ret = null;rn String endpoint = "http://localhost/MyBank/Mybank.asmx";rn Service service = new Service();rn Call call;rn try rn call = (Call) service.createCall();rn call.setTargetEndpointAddress(new java.net.URL(endpoint));rn call.setOperationName(new QName("http://tempuri.org/", "HelloWorld"));rn call.addParameter(new QName("http://tempuri.org/", "name"),rn org.apache.axis.encoding.XMLType.XSD_STRING,rn javax.xml.rpc.ParameterMode.IN);rn call.setUseSOAPAction(true);rn call.setReturnType(org.apache.axis.encoding.XMLType.SOAP_STRING);rn call.setSOAPActionURI("http://tempuri.org/HelloWorld");rn ret = (String) call.invoke(new Object[] "tiger" );rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn return ret;rn rn
看看这段代码哪错了?
rnrn rnrnrn JavaScript语言的Math对象rn rn 张三rn rn rn rn rnrnrn
帮看看这个哪错了
create or replace procedure test000(I_FUNDCODE varchar2(10),I_PROVINCE varchar2(10),RT_CURSOR out sys_refcursor) isrnbeginrnopen RT_CURSOR for select PV.NAME, PS.FUNDNAME,rn count(case when ct.age between 1 and 20 then 1 else null end) "1~20岁",rn count(case when ct.age between 21 and 40 then 1 else null end) "21~40岁",rn count(case when ct.age > 41 then 1 else null end) "41岁以上",rn sum(ts.curshare)rn from CUSTOMERS ct, PROVINCE pv, TA_SHARE ts, PRODUCTS1 psrn where pv.id = ct.provincern and ct.taaccoid = TS.TAACCOIDrn and TS.FUNDCODE = I_FUNDCODErn and pv.name=I_PROVINCErn group by PV.NAME, PS.FUNDNAMErn order by 1, 2;rnend;
大家帮我看看哪错了
我编了一段代码想实现输出以下字符rn *rn ***rn *****rn *******rn我写的代码如下:rn DATA SEGMENTrn DA1 DB 0AHrn DA2 DB 20Hrn DATA ENDSrn CODE SEGMENTrn ASSUME CS:CODE,DS:DATArn START: MOV AX,DATArn MOV DS,AXrn MOV CX,7rn MOV SI,1rnrn LOOP2: SUB CX,1rn SHL CX,1rn LOOP3:rn MOV DL,DA2rn INT 21Hrn LOOP LOOP3rnrn PUSH CXrn MOV CX,SIrn LOOP4: MOV DX,'*'rn MOV AH,02Hrn INT 21Hrn INC DLrn LOOP LOOP4rn MOV DL,DA1rn INT 21Hrn POP CXrn ADD SI,2rn LOOP LOOP2rn MOV AH,4CHrn INT 21Hrn CODE ENDSrn END STARTrn请各位该人指点哪错了?rn
帮忙看看这是哪错了。
rncar.h 文件的内容如下:rn#ifndef CAR_H_rn#define CAR_H_rnrn#include rnusing namespace std;rnrnstruct colorrnrn char red;rn char blue;rn char greed;rn;rnrnclass carrnrnprivate:rn char id[32+1];rn string name;rn color clr;rnpublic:rn void print();rn void getColor(color &ref_clr);rn void setColor(color _clr);rn void setname(string s);rn void getname(string &ref_name);rn rnrn;rnrnrn#endif /*CAR_H_*/rnrnrnrntest4.cpp 文件内容如下:rnrn#include "car.h"rn#include rnusing namespace std;rnrnrnrnint main()rnrn car c ;rn c.setname("zhangsan");rn string GetName;rn c.getname(&GetName);rn cout<
帮下忙看看哪错了
ADODB.Recordset 错误 '800a0e79' rnrn对象打开时,不允许操作。 rn为什么不对阿??rnrn错误行如下rnrs.open"select NAME,PASSWORD from BOOK1 where NAME='"&NAME&"'",conn,1,1rnrn注:rnrs= Server.CreateObject ("ADODB.Recordset")
帮我看看程序哪错了?
rnrnrn rn ZZZrn Deorgern Gndrewrn rn rn XXXrn Deorgern Andrewrn rn rn CCCrn Deorgern Amdrewrn rn rn YYYrn Errn Gigrn Frankrn rnrnrnrnrn rn rn rn rn rn </head>rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn为什么有时候出现想要的结果,有时候不可以?rn实际输出rnCCC Amdrew Deorge rnXXX Andrew Deorge rnZZZ Deorge Gndrew rnYYY Er Frank Gig rn想要结果(每个book按照各自最小的author排序,如XXX-Andrew,CCC-Amdrew,etc)rnXXX Andrew Deorge rnCCC Amdrew Deorge rnZZZ Deorge Gndrew rnYYY Er Frank Gigrn当所有author中只有一个等于Deorge时,结果正确.但如果如上,有多个Deorge,就出错了.大侠帮帮忙
初学asp.net 看看哪错了?
<%rn'链接accessrndim ds as new dataset '建立 dataset 对象rndim dtable as datatable rndim coldrow as datarowcollectionrndim drow as datarowrndim inti as integerrndim sqldb as new sqlConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("haha.mdb")&";User Id=;Password=;") rnsqldb.Open() rndim sqld as new sqldataadapter("select * from haha",sqldb)rnsqld.fill(ds,"tttt")rndtable=ds.tables("tttt")rncoldrow=dtable.rowsrnfor inti=0 to coldrow.count-1rn drow=coldrow.item(inti)rn labcontent.text=labcontent.text & "编号" &drow("id")rn labcontent.text=labcontent.text & "内容" &drow("count")rnnextrndtable.acceptchangesrndg.datasource=ds.tables("tttt").defaultviewrndg.databindrnrn%>rn rn rn rn
帮我看看哪错了 画矩形的
Private Sub UserForm_Initialize()rnDim SideWidth As IntegerrnDim SideHeight As IntegerrnSideWidth = 10rnSideHeight = 100rnX1 = 100: Y1 = 100rnX2 = 200: Y2 = 200rnX2 = X1 + SideWidth: Y2 = Y1rnX3 = X1 + SideWidth: Y3 = Y1 + SideHeightrnX4 = X1: Y4 = Y1 + SideHeightrnDrawStyle = 0: DrawWidth = 2rnLine (X1, Y1)-(X2, Y2)rnLine -(X3,Y3)rnLine -(X4,Y4)rnLine -(X1,Y1)rnEnd Subrnrnrnrn运行后说错误 rnline方法找不到rnrnrnrn在vba下rn
您看看哪错了,谢谢
呵呵,您别笑话,自学,还是第一次。rn我现在做了两个界面,一个主界面,代码如下:rn----------------------------------------------------------rnDim conn As New ADODB.ConnectionrnDim rs As New ADODB.Recordsetrn----------------------------------------------------------rnPrivate Sub book_in_Click()rn frmbookin.ShowrnEnd SubrnrnPublic Sub Form_Load()rn conn.ConnectionString = "Driver=sql server;server=wxfjx;uid=sa;pwd=;database=book"rn conn.Openrn '连接数据库rn frmMain.Caption = "图书馆管理系统"rn frmMain.Top = (Screen.Height - frmMain.Height) / 2rn frmMain.Left = (Screen.Width - frmMain.Width) / 2 '窗口居中rnEnd Subrn---------------------------------------------------------rn然后又做了一个界面,按钮点击进去rn代码如下:rn------------------------------------------------------------------rnPrivate Sub cmd_exit_Click()rn Unload MernEnd Subrnrn--------------------------------------------------------------------rnPrivate Sub cmd_save_Click()rn Dim rs As New ADODB.Recordsetrn Dim sql As Stringrn rn If ((Text_isbn.Text = "") And (Text_bname.Text = "") And (Text_author.Text = "") And (Text_total.Text = "")) Thenrn Beeprn MsgBox " 请将各项数据填写完整!", 48, "警告!"rnrn Elsern sql = "select * from book where isbn='" & Text_isbn.Text & "'"rn rs.Open sql, conn, adOpenKeyset, adLockPessimisticrn rn If rs.EOF Thenrn rs.AddNewrn rs.Fields(0) = Trim(Text_isbn.Text)rn rs.Fields(1) = Trim(Text_bname.Text)rn rs.Fields(2) = Trim(Text_author.Text)rn rs.Fields(3) = 0rn rs.Fields(4) = Trim(Text_price.Text)rn rs.Fields(5) = Trim(Text_total.Text)rn rn rs.Updatern MsgBox "0000000"rn rs.Closern End Ifrn End IfrnEnd Subrn------------------------------------------------------------rnPrivate Sub Form_Load()rn frmbookin.Top = (Screen.Height - frmbookin.Height) / 2rn frmbookin.Left = (Screen.Width - frmbookin.Width) / 2rn Label_isbn.Caption = "国际标准编号:"rn Label_bname.Caption = "书名:"rn Label_author.Caption = "作者:"rn Label_price.Caption = "价格:"rn Label_total.Caption = "总数:"rn Text_isbn.Text = ""rn Text_bname.Text = ""rn Text_author.Text = ""rn Text_price.Text = ""rn Text_total.Text = ""rn cmd_save.Caption = "保存"rn cmd_cancle.Caption = "取消"rn cmd_exit.Caption = "退出"rn Frame1.Caption = "图书信息"rn Frame2.Caption = "图书列表"rnEnd Subrnrn运行后提示:实时错误3001 参数类型不正确 或不在可以接受的范围之内,或与其他参数冲突。rn然后 rs.Open sql, conn, adOpenKeyset, adLockPessimistic 提示出来rnrn谢谢了!!
相关热词 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天 c#字典序排序 c# 截屏取色 c#中的哪些属于托管机制