一直报错,有没有大佬帮忙看看

package admin;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.UIManager;

@SuppressWarnings("serial")
public class Addstu extends JPanel implements ActionListener{
JTextField sn,sna,sde,scl,sse,sag ;
JButton 录入;
public Addstu() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}catch(Exception e) {
System.out.println("不能设置外观: "+e);}
sn = new JTextField(12);
sna = new JTextField(12);
sde = new JTextField(12);
scl = new JTextField(12);
sse = new JTextField(12);
sag = new JTextField(12);
录入 = new JButton("录入");
录入.addActionListener(this);
//盒子布局,分水平和垂直
Box box1 = Box.createHorizontalBox();//横放box
Box box2 = Box.createHorizontalBox();
Box box3 = Box.createHorizontalBox();
Box box4 = Box.createHorizontalBox();
Box box5 = Box.createHorizontalBox();
Box box6 = Box.createHorizontalBox();
Box box7 = Box.createHorizontalBox();
box1.add(new JLabel("学号:"/*,JLabel.CENTER*/));
box1.add(sn);
box2.add(new JLabel("姓名:"/*,JLabel.CENTER*/));
box2.add(sna);
box3.add(new JLabel("专业:"/*,JLabel.CENTER*/));
box3.add(sde);
box4.add(new JLabel("班级:"/*,JLabel.CENTER*/));
box4.add(scl);
box5.add(new JLabel("性别:"/*,JLabel.CENTER*/));
box5.add(sse);
box6.add(new JLabel("年龄:"/*,JLabel.CENTER*/));
box6.add(sag);
box7.add(录入);
Box boxH = Box.createVerticalBox();//垂直方式布局
boxH.add(box1);
boxH.add(box2);
boxH.add(box3);
boxH.add(box4);
boxH.add(box5);
boxH.add(box6);
boxH.add(box7);
boxH.add(Box.createVerticalGlue());
JPanel messPanel = new JPanel();
messPanel.add(boxH);
setLayout(new BorderLayout());
add(messPanel,BorderLayout.CENTER);
validate();
}
//这是一个事件监听器,可以处理类似单击鼠标时触发的事件 ActionEvent就是一个事件类,传入的e就是该事件的对象

public void actionPerformed(ActionEvent c) {
// TODO Auto-generated method stub
Object obj = c.getSource();

if(obj== 录入) {
    if(sn.getText().equals("")||sna.getText().equals("")||sde.getText().equals("")||scl.getText().equals("")||sse.getText().equals("")||sag.getText().equals(""))   
        {JOptionPane.showMessageDialog(this, "学生信息请填满再录入");}
    Connection dbConn1 = CONN();
    Statement stmt = null;
    ResultSet rs1= null;
    String sql ,sql1;
    sql1 = "select * from stu1 where sno='"+sn.getText()+"'";
    sql = "inster into stu1 values('"+sn.getText()+"','"+sna.getText()+"','"+sde.getText()+"','"+scl.getText()+"','"+sse.getText()+"','"+sag.getText()+"')";
    try {       
        stmt=dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    rs1 =stmt.executeQuery(sql1);
    if(rs1.next()) {
        JOptionPane.showMessageDialog(this, "该学号已存在,无法添加");
    }
    else {
        stmt.executeUpdate(sql);
   JOptionPane.showMessageDialog(this, "添加成功");
    }
    rs1.close();
    stmt.close();
    }catch(SQLException e) {
        System.out.println("SQL Exception occur.Message is:"+e.getMessage());
    }
}

}

public static Connection CONN() {
// TODO Auto-generated method stub
Connection dbconn = null;
String driverName = "com.mysql.jdbc.Driver";

// URL指向要访问的数据库名student         
String dburl = "jdbc:mysql://127.0.0.1:3306/student?useSSL=false";

// MySQL配置时的用户名           
String user = "root";             
// MySQL配置时的密码      
String password = "yuguangliang@521";

try {             // 加载驱动程序           
    Class.forName(driverName);

 // 连续数据库       
    Connection conn = DriverManager.getConnection(dburl, user, password);
     if(!conn.isClosed())      

         System.out.println("Succeeded connecting to the Database!");
}catch(Exception e) {
     e.printStackTrace();
    }
return dbconn;  

}
}


Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at 数据库设计/admin.Addstu.actionPerformed(Addstu.java:90)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.desktop/java.awt.Component.processEvent(Unknown Source)
at java.desktop/java.awt.Container.processEvent(Unknown Source)
at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue.access$600(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

1个回答

图片说明
其实这边也说明了,因为你代码我无法运行,所以只能告诉你,这是个空指针异常,方法传给你的值或者你从某个对象中取出来的值是null,然后你用这个null去进行判断,截取,计算等等操作就会报错,而且也告诉你这90行,就证明在90行代码附近出现问题,我不知道你90行前后是什么代码。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
有没有大佬帮我看看,
总是出栈后gettop就成空白了=.=求大神指点,万分感谢程序本身没有语法错误,qu'x#include "stdafx.h"using namespace std;void ShowStackMenu(){    cout << "\n";    cout << "  ************《线性表》*************\n";    cout << ..
各位大佬帮忙看看
[img=https://img-bbs.csdn.net/upload/201804/11/1523447552_779822.jpg][/img] 这是什么意思 而且不定时的会弹出来 只要app在后台运行就会弹出 有时候看新闻 打游戏都会弹出 求大佬帮忙看看
大佬们帮忙看看。
/* 登录系统; 可注册密码。可修改密码;*/rnrn#includern#include rn#include rn#includern void dengluxitong();rnint main()rnrn dengluxitong(10);rn rn return 0;rn rn rn rn void dengluxitong(int n) rn rn rn while(1) rn rn rn char (*p)[10]=malloc(sizeof(char[10])*n);rn rn FILE *fp=NULL;rn int a=0,i=0;rn do rn a=0,i=0;rn printf("1.登录\n2.注册\n3.修改密码\n");rn scanf("%d",&a);rn fflush(stdin);rn rn if(a<1||a>3)rn printf("\n无效的序号!"); Sleep(1000); rn rn system("cls");rn rn while(a<1||a>3);rn rn rn switch(a)rn rn case 3: while(1) rn rn printf("账号:");rn scanf("%s",p[0]);rn printf("原密码:");rn scanf("%s",p[1]);rn printf("新密码:");rn scanf("%s",p[2]);rn rn fp=NULL;rn fp=fopen("Sl.txt","r+");rn rn if(fp==NULL)rn printf("文件打开失败!"); return ;rn rn for(i=4;i=n) rn printf("此账号不存在!"); Sleep(1000); system("cls"); continue; //因达到循环次数上限导致循环结束的 表明并没有此账号 (如果有此账号 将会break 直接结束循环 ) rnrn rn rn if(strcmp(p[1],p[i+1])==0) //账号后面就是该账号的密码 ;判断密码如果无误 就对密码进行更换 rn strcpy(p[i+1],p[2]); system("cls"); break; //用新密码将原密码替换掉 rn elsern printf("原密码错误!"); Sleep(1000); system("cls");rn rn rn rn rn for(i=4;i=n)rn printf("此账号不存在!"); Sleep(1000); system("cls"); free(p); continue;rn rn rn rn if(strcmp(p[1],p[i+1])==0 ) //核对输入密码是否与存入密码相符; rn printf("登录成功!"); Sleep(1000); system("cls"); free(p); return ;rn elsern printf("密码错误!"); Sleep(1000); system("cls"); rn rn fclose(fp); rn rn rn rn rn rn rn rn rn rn free(p);rn rn rn rn rnrn[img=https://img-bbs.csdn.net/upload/201801/27/1517015534_474100.png][/img] 注册账号发现文件写入那么多(如图) 就写不进去了。 再写入的时候没有提示,就是账号信息并没有在文件中。 能写入多少似乎和我的数组大小有关。rnrn rn但是当我使用a 再次打开一次文件后再读写就没问题了rn[img=https://img-bbs.csdn.net/upload/201801/27/1517016097_821747.png][/img]rn
求大佬帮忙看看
错误信息:rnClientAbortException: java.net.SocketException: Software caused connection abort: socket write errorrn at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)rn at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)rn at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349)rn at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:381)rn at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370)rn at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)rn at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)rn at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282)rn at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)rn at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)rn at java.io.OutputStreamWriter.write(OutputStreamWriter.java:220)rn at java.io.Writer.write(Writer.java:157)rn at org.springframework.util.StreamUtils.copy(StreamUtils.java:118)rn at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter.java:106)rn at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter.java:41)rn at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:227)rn at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:247)rn at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:174)rn at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:113)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: java.net.SocketException: Software caused connection abort: socket write errorrn at java.net.SocketOutputStream.socketWrite0(Native Method)rn at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)rn at java.net.SocketOutputStream.write(SocketOutputStream.java:155)rn at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:764)rn at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118)rn at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:570)rn at org.apache.coyote.Response.doWrite(Response.java:560)rn at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:353)rn ... 45 morern十一月 16, 2017 4:29:10 下午 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet MVC DispatcherServlet threw exceptionrnjava.lang.NullPointerExceptionrn at com.zhwy.exception.MyExceptionHandler.resolveException(MyExceptionHandler.java:54)rn at org.springframework.web.servlet.DispatcherServlet.processHandlerException(DispatcherServlet.java:1222)rn at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1034)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:745)rn
求帮忙看看,怎么一直报错
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="cityTest.aspx.cs" Inherits="DTcms.Web.admin.city.cityTest" %>rnrnrnrnrnrn 城市rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rnrnrn
有没有大佬帮忙写个JAVA方法
业务场景如图:rn[img=https://img-bbs.csdn.net/upload/201808/08/1533714129_830835.png][/img]rn左侧为客户需求的数量,每一天一个数量rn中间为ERP系统实际能够供给的数量,rn右侧为根据ERP系统和需求合并时候的数量,,rn假如ERP系统的数量能满足客户需求,则写客户需求的数量,如果不能满足,则写实际能提供多少数量,并且在后续的日期里,要补上这部分没能提供的数量rn之前没要求写备注的时候,我写了个简单的方法就能满足需求,,rn但是运行了一段时间,有人怀疑数量计算的不准确,于是让我加上备注这一列..如图右侧备注那一列.rn我内心是拒绝的,,但是又没办法反驳,现在心里已经有几个方法了,但是改动量都比较大,所以在论坛上求助下各位..rn附我之前的简单方法..rn[code=java]rn public static void main(String[] args) rn int arr1[]=100,80,200,0,400,0,100,300; //需求数按日期排列rn int arr2[]=300,0,300,0,0,0,500,0; //回复数按日期排列并且合并rn //String arrInfo[]="1","2","3","4","5";rn CollcetionUtil cu=new CollcetionUtil();rn System.out.println("需求数="+Arrays.toString(arr1));rn System.out.println("实际数="+Arrays.toString(arr2));rn System.out.println("回复数="+Arrays.toString(cu.MergeArray(arr1,arr2)));rn rn public int[] MergeArray(int[] arr1, int[] arr2) rn rn int[] arr3=new int[arr1.length];rn for(int i=0;i=arr1[i])rn arr3[i]=arr1[i];rn if(i
C++求助。。一直报异常。。求大佬帮忙看看
本人想做一个个人账户信息管理系统,用的是文件的读写去实现功能,整体思路就是我自己想用两个.dat文件一个存用户,另一个存用户信息,第一个文件来实现登录注册(模拟登录注册),第二个文件里面每一个信息里面都有用户名字,方便后面查找每个用户对应信息,现在就是我能实现写入到文件里面,还有读到程序里面进行输出,但是每次都会报一个异常(附图)..自己看了好久都不知道到底是哪里出了问题,希望各位大佬能指点一下迷津。。rn--------------------------------------------------------------------------------------------------------------------------------------------rn代码:rn#includern#includern#includern#includern#includernrnusing namespace std;rnrnstruct User//用户结构体rnrn unsigned int flag;//权值rn string name;//用户名rn string password;//用户密码rn;rnrnstruct User2rnrn string name2;rn string Aname;//用户个人账户名称rn string Apassword;rn;rnrnclass UserAccountrnrnprivate:rnrn// fstream file;//建立用户文件;rn// fstream file2;//建立用户信息薄问文件rnrn string a1;//用作后面获取到登录用户的用户名rnrn ifstream infile;//用作写rn ofstream outfile;//用作读rnrn ifstream infile2;//用作写(表2)rn ofstream outfile2;//用作读(表2)rnrn void Login();rn void Register();rn void AddDate();rn void Show();rn void UpDate();rnrnpublic:rnrn UserAccount();rn// virtual~UserAccount() file.close(); rnrn void Run();//实现登录注册界面rn void Run2();rn;rn//------------------------------------------------------------------------rnUserAccount::UserAccount()//创造用户信息文件rnrn ifstream iFile("UserAccount.dat");rnrn if (iFile.fail())rn rn ofstream oFile("UserAccount.dat");rn if (oFile.fail()) throw("打开文件失败.");rn oFile.close();rn rn elsern rn iFile.close();rn rn// file.open("UserAccount.dat", ios::in | ios::out | ios::binary | ios::app);rn ifstream infile("UserAccount.dat", ios::in | ios::binary | ios::app);rn ofstream outfile("UserAccount.dat", ios::out | ios::binary | ios::app);rn //---------------------------------------------------------------------------------rn ifstream iFile2("UserAccount2.dat");//表2的实例化rn rn if (iFile2.fail())rn rn ofstream oFile2("UserAccount2.dat");rn if (oFile2.fail()) throw("打开文件失败.");rn oFile2.close();rn rn elsern rn iFile2.close();rn rn// file2.open("UserAccount2.dat", ios::in | ios::out | ios::binary | ios::app);rn ifstream infile2("UserAccount2.dat", ios::in | ios::binary | ios::app);rn ofstream outfile2("UserAccount2.dat", ios::out | ios::binary | ios::app);rnrn//------------------------------------------------------------------------------rnvoid UserAccount::Login()//登录界面rnrn User acc;rn User acc1;rn cout << "欢迎使用本系统!" << endl;rn cout << "用户名:";rn cin >> acc.name;rn cout << "密码:";rn cin >> acc.password;rn int flag = 0;rn infile.seekg(0);rn infile.open("UserAccount.dat", ios::in | ios::binary | ios::app);rn infile.read((char*)& acc1, sizeof(User));rn while (!infile.eof())rn rn if (acc.name == acc1.name && acc.password == acc1.password)rn rn flag = 1;rn break;rn rn infile.read((char*)& acc1, sizeof(User));rn rn if (flag)rn rn if (acc1.flag == 10)//权值为10则是管理员;rn rn a1= acc.name;//获取到当前登录的用户名;rn cout << "欢迎您!"<<"尊敬的管理员" <> acc.name;//输入用户名称rn cout << "输入用户密码:";rn cin >> acc.password;//输入用户密码rn if (acc.name == "张鑫益")rn rn acc.flag = 10;//给到最高权值rn rn elsern rn acc.flag = rand() % 10;rn rn infile.seekg(0);rn int fla = 1;//默认没有注册rn infile.open("UserAccount.dat", ios::binary | ios::app);rn infile.read((char*)& acc1, sizeof(User));//进行查找是否有用户名重名rn while (!infile.eof())rn rn if (acc.name == acc1.name)rn rn fla = 0;rn break;rn rn infile.read((char*)& acc1, sizeof(User));//继续查找rn rn if (fla)rn rn cout << "恭喜您!注册成功!" << endl;rn infile.close();rn infile.clear();rn outfile.open("UserAccount.dat",ios::out |ios::binary | ios::app);rn outfile.write((char*)& acc, sizeof(User));rn outfile.close();rn rn Run();rn return ;rn rnrn elsern rn cout << "对不起,该用户名已被注册!请重新输入哦!" << endl;rn infile.close();//重新输入的时候要对流进行刷新rn infile.clear();rn outfile.close();rnrn Register();rn return;rn rnrn//--------------------------------------------------------------------------rnvoid UserAccount::Run()rnrn int select;rn dorn rn cout << "欢迎使用本系统!" << endl;rn cout << "1.登录 2.注册" << endl;rn cout << " 3.退出 " << endl;rn cin >> select;rn while (cin.get() != '\n');rn switch (select)rn rn case 1:rn tryrn rn Login(); rn rn catch (exception e)rn rn cout << "----";rn rn break;rn case 2:rn tryrn rn Register(); rn rn catch (exception e)rn rn cout << "----";rn rn break;rn rn while (select != 3);rn rnrn//--------------------------------------------------------------------------rnvoid UserAccount::AddDate()rnrn User2 aac;rn aac.name2 = a1;rn outfile2.open("UserAccount2.dat", ios::out | ios::binary | ios::app);rn cout << "请输入需要记录的账户名称:";rn cin >> aac.Aname;rn cout << "请输入对应账户的账户密码:";rn cin >> aac.Apassword;rn outfile2.write((char*)& aac, sizeof(User2));rnrn rn outfile2.close();rnrn//---------------------------------------------------------------------------rnrnvoid UserAccount::Show()rnrn User2 aac;rn infile.open("UserAccount2.dat", ios::in | ios::binary | ios::app);rn infile.read((char*)& aac, sizeof(User2));rn while (!infile.eof())rn rn if (aac.name2 == a1)rn rn cout << "账户名称:"<< aac.Aname << " " << "账户密码:"<< aac.Apassword << endl;rn rn infile.read((char*)& aac, sizeof(User2));rn rn infile.clear();rn infile.close();rn rn rnrnrn//---------------------------------------------------------------------------rnvoid UserAccount::Run2()rnrn int selet;rn dorn rn cout << "请选择功能:" << endl;rn cout << "1.增加账户信息" << endl;rn cout << "2.查看账户信息" << endl;rn cout << "3.查询账户信息" << endl;rnrn cin >> selet;rnrn switch (selet)rn rn case 1:rn tryrn rn AddDate();rn catch (exception e)rn rn cout << "----";rn rn break;rn case 2:rn tryrn rn Show();rn rn catch(exception e)rn rn cout << "----";rn rn break;rn rn while (selet != 5);rnrn//-------------------------------------------------------------------------rnint main()rnrn tryrn rn UserAccount a;rn a.Run();rn rn catch (exception err)rn rn cout<<"----";rn rn system("pause");rn return 0;rn[img=https://img-bbs.csdn.net/upload/201906/13/1560418790_593525.png][/img][img=https://img-bbs.csdn.net/upload/201906/13/1560418806_109611.png][/img][img=https://img-bbs.csdn.net/upload/201906/13/1560418867_431613.png][/img]
新手求大佬帮忙看看
刚学C语言,实在没法理解。昨天自己憋了一下午,也没看出什么地方有问题。rn[code=c]#pragma warning(disable:4996)rn#includernint main()rnrn char str1[30], str2[30];rn printf("please enter string:");rn gets(str1);rn printf("which character that begin to copy? ");rn int m;rn scanf("%d", &m);rn void str_c(char x[], char y[], int n);rn str_c(str1, str2, m);rn printf("%s\n", str2);rn return 0;rnrnvoid str_c(char x[], char y[], int n)rnrn int i;rn for (i = n; i != '\0'; i++)rn rn y[i - n] = x[i];rn y[i - n] = '\0';rnrn[/code]rnrnrn后面写的str_c 函数目的是想把字符串x中第n个字符后面的复制到字符串y中去。真的无法理解为什么这么写会运行出错?rn有没有前辈解释一下哪错了?谢谢
求大佬来帮忙看看
eclipse一直报An internal error occurred during: "Computing Git status for repository hp222".Trailing char < > at index 82: C:\Users\hp222\AppData\Roaming\duowan\yy\mainframe\theme\float\star-V1-V6-apng.png
Sql server2012 字段数据,有没有大佬帮忙看看怎么解决!!
0111008b-76ce-4dfd-9f1c-2c08c5bec900rn02087b63-fbd9-4947-b29f-acead2fb06a4rn02d64009-5f4a-43aa-ba54-0868ff026d24rnrn怎么变成人能看懂的啊。。。。
想请问一下第一行和第三行代码一直报错找不到解决办法怎么弄,想请大佬帮忙看看
public class TestSwitch{ import java.util.Scanner; public static void main(String [] args) { int Garde = 0; char Level; int i = 0 ; for(i=0;;i++) { Scanner sc = new Scanner(System.in); Garde = sc.n...
有没有懂正则的大佬帮我看看咋回事
要将b列的字母和数字提取出来,列如w+2中的w和2,卡在这句了(Set objmh = objregex.Execute(form)),不知道怎么处理,顺便问下rn Cells(i, 8) = CStr(objmh(0).submatches(1))可以改成 arr(i,8) = CStr(objmh(0).submatches(1))或者 k = CStr(objmh(0).submatches(1))吗,将返回的字母加入数组arr,数字赋值给变量krnrnrnSub regexp_date_num()rn Dim res()rn Dim objregex As Objectrn Dim objmh As Objectrn Dim j As Integerrn Set objregex = CreateObject("vbscript.regexp")rn objregex.Pattern = "([a-zA-Z]+)\+(\d*)"rn objregex.Global = Truern For i = 1 To Cells(Rows.Count, "b").End(xlUp).Rowrn form = Cells(i, "b")rn Set objmh = objregex.Execute(form)rn If objmh.Count > 0 Thenrn Cells(i, 7) = CStr(objmh(0).submatches(0))rn Cells(i, 8) = CStr(objmh(0).submatches(1))rn End Ifrn Nextrn Set objregex = Nothingrn Set objmh = NothingrnEnd Subrn
Maven报错,哪位大佬给看看
Description Resource Path Location TypenCannot install Dynamic Web Module 2.5 facet. It is incompatibile with already installed facets: Utility Module. Please modify project configuration. pom.xml /e3-manager-service line 0 Maven Java EE Configuration Problemn
诸位大佬,看看有没有这样的报表工具
1、和业务系统独立,单独部署。rn2、支持运行时通过sql语句创建报表,把sql执行结果展现出来即可。可以打印。rn3、支持Excel做报表模板,然后编写sql,最终按照模板样式展现数据。rn4、支持导出excelrn5、支持打印rnrn谢谢了!
游标报错,帮忙看看??
DECLARE @h_fiSumOfFact intrnDECLARE @h_fiPersontime intrnDECLARE @h_fiVehicletime intrnDECLARE @h_fsSvProvinceID char(36)rnDECLARE @h_fsSvCityID char(36)rnDECLARE @h_fsSvCountyID char(36)rnDECLARE @h_fsSvTownID char(36)rnrnDECLARE authors_cursor CURSOR FOR rnselect sum(isnull(fiSumOfFact,0)),sum(isnull(fiPersontime,0)),sum(isnull(fiVehicletime,0)),rn fsSvProvinceID,fsSvCityID,fsSvCountyID,fsSvTownIDrnfrom Fact_TInspectionPlan group by fsSvProvinceID,fsSvCityID,fsSvCountyID,fsSvTownIDrn rnOPEN authors_cursor rnrnFETCH authors_cursor INTO @h_fiSumOfFact,@h_fiPersontime,@h_fiVehicletime,rn @h_fsSvProvinceID,@h_fsSvCityID,@h_fsSvCountyID,@h_fsSvTownIDrnrnWHILE @@sqlstatus = 0rnrnbeginrnupdate fact_stat_PlanInfo set rnfiTotalObjNum=@h_fiSumOfFact,rnfiCallOutPersonNum=@h_fiPersontime,rnfiCallOutVehicleNum=@h_fiVehicletimernfrom Fact_TInspectionPlan ftrnwhere fsSvProvinceID=@h_fsSvProvinceID rnand fsSvCityID=@h_fsSvCityID rnand fsSvCountyID=@h_fsSvCountyID rnand fsSvTownID=@h_fsSvTownID rnFETCH authors_cursor INTO @h_fiSumOfFact,@h_fiPersontime,@h_fiVehicletime,rn @h_fsSvProvinceID,@h_fsSvCityID,@h_fsSvCountyID,@h_fsSvTownIDrnendrnrnCLOSE authors_cursorrrnDEALLOCATE CURSOR authors_cursor rnrn========================================rn==============rn报错:rnNumber (7344) Severity (15) State (2) Server (AICFIVE) DECLARE CURSOR must be the only statement in a query batchrn帮忙看看这个游标错在哪,~谢谢rn
查询语句报错。帮忙看看
一个类别表,和信息表,页面想显示信息的列表,同时把信息的类别名称显示出来,因为存在信息表里的是类别的ID号,但是在写语句的时候老是报错。rnhql = "select id,topic,adddate,body,typename From news,newstype where news.typeid = newstype.typeid"rn这条语句在数据库中直接执行没有问题,但是程序里面就报错rnjava.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.IdentNode rn +-[IDENT] IdentNode: 'id' originalText=idrn
帮忙看看有没有错误。
为什么生成的DLL不能注册,要怎样将它注入到指定进程? 下面是代码。#include rnrn#include "stdafx.h"rnrnWNDPROC lpOldWndFunc=NULL;rnrnLRESULT CALLBACK WinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)rnrnswitch(uMsg)rnrncase WM_SYSCOMMAND:rn switch(LOWORD(wParam))rnrncase 988:rnMessageBox(hwnd,"test","About this demo...",MB_OK);rnreturn TRUE;rnrnbreak;rnrnrnreturn CallWindowProc(lpOldWndFunc,hwnd,uMsg,wParam,lParam);rnrnrnrnBOOL CALLBACK EnumWinProc(HWND hwnd, LPARAM lParam)rnrnDWORD PID;rnGetWindowThreadProcessId(hwnd,&PID);rnif(PID==(DWORD)lParam)rnrn HMENU SysMenu=GetSystemMenu(hwnd,FALSE);rn if(SysMenu)rn rn int ItemCount=GetMenuItemCount(SysMenu);rn InsertMenu(SysMenu,ItemCount-1,MF_BYPOSITION|MF_STRING,988,"About This Demo...");rn lpOldWndFunc=(WNDPROC)GetWindowLong(hwnd,GWL_WNDPROC);rn SetWindowLong(hwnd,GWL_WNDPROC,(LONG)WinProc);rnrn rnrnrnreturn TRUE;rnrnrnrnBOOL APIENTRY DllMain( HANDLE hModule, rnDWORD ul_reason_for_call, rnLPVOID lpReservedrn )rnrn switch(ul_reason_for_call)rn rn case DLL_PROCESS_ATTACH:rn EnumWindows(EnumWinProc,(LPARAM)(GetCurrentProcessId()));rn break;rn rnrnreturn TRUE;rnrnrnrnrn
有没有大佬帮忙解决个freemarker问题
我想解决freemarker出错时跳转error页面,现在可以拦截模版异常,后台可能正常跳转,但是在重定向到错误页面的时候发现个问题,无法跳转到新页面,而是在原页面出错的地方后面加载了页面,有谁碰到过这个问题么rn[img=https://img-bbs.csdn.net/upload/201904/29/1556502896_943200.png][/img]rn[img=https://img-bbs.csdn.net/upload/201904/29/1556502907_369370.png][/img]rn[img=https://img-bbs.csdn.net/upload/201904/29/1556502912_732448.png][/img]rn[img=https://img-bbs.csdn.net/upload/201904/29/1556502916_138658.png][/img]rn[img=https://img-bbs.csdn.net/upload/201904/29/1556503133_641538.png][/img]
mongodb报错,求大佬帮忙,谢谢。
[img=https://img-bbs.csdn.net/upload/201907/31/1564549431_295735.png][/img][img=https://img-bbs.csdn.net/upload/201907/31/1564549439_235361.png][/img][img=https://img-bbs.csdn.net/upload/201907/31/1564549446_790951.png][/img][img=https://img-bbs.csdn.net/upload/201907/31/1564549571_42509.png][/img]rn
vs2012有没有大佬帮忙看下这是怎么回事
为什么在浏览器运行会多一个v呀??[img=https://img-bbs.csdn.net/upload/201903/31/1554001452_771912.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/31/1554001454_451742.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/31/1554001455_837035.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/31/1554001493_161794.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/31/1554001494_879206.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/31/1554001494_441566.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/31/1554001506_665877.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/31/1554001508_650955.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/31/1554001509_960359.jpg][/img]
springside3 部署一直报错,请大家帮忙看看
tomact报错rn2010-1-6 17:39:05 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name '_filterChainProxy': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_filterChainList': Cannot create inner bean '(inner bean)' of type [org.springframework.security.config.OrderedFilterBeanDefinitionDecorator$OrderedFilterDecorator] while setting bean property 'filters' with key [10]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'filterSecurityInterceptor' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterSecurityInterceptor' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Cannot resolve reference to bean 'databaseDefinitionSource' while setting bean property 'objectDefinitionSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseDefinitionSource': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerExceptionrn rnSpringSecurity的配置rnrnrnrnrn SpringSecurity安全配置rnrn rn rn rn rn rn rnrn rn rn rn rn rnrn rn rnrn rn rn rn rn rn rnrn rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rnrn
运行报错,大佬们帮忙看看什么原因java.util.concurrent.ExecutionException
"C:\Program Files\Java\jdk1.8.0_201\bin\java" "-Dmaven.multiModuleProjectDirectory=C:\Users\Administrator\Desktop\travel - 副本" -Dfile.encoding=gb2312 "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\lib\idea_rt.jar=51249:C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\bin" -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.2.6 tomcat7:runrn[INFO] Scanning for projects...rn[WARNING] rn[WARNING] Some problems were encountered while building the effective model for cn.itcast:travel:war:1.0-SNAPSHOTrn[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 131, column 21rn[WARNING] rn[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.rn[WARNING] rn[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.rn[WARNING] rn[INFO] rn[INFO] ------------------------------------------------------------------------rn[INFO] Building travel 1.0-SNAPSHOTrn[INFO] ------------------------------------------------------------------------rn[INFO] rn[INFO] >>> tomcat7-maven-plugin:2.1:run (default-cli) > process-classes @ travel >>>rn[INFO] rn[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ travel ---rn[WARNING] Using platform encoding (gb2312 actually) to copy filtered resources, i.e. build is platform dependent!rn[INFO] Copying 3 resourcesrn[INFO] rn[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ travel ---rn[INFO] Changes detected - recompiling the module!rn[INFO] Compiling 40 source files to C:\Users\Administrator\Desktop\travel - 副本\target\classesrn[WARNING] /C:/Users/Administrator/Desktop/travel - 副本/src/main/java/cn/itcast/travel/dao/impl/FindDaoImpl.java: 某些输入文件使用了未经检查或不安全的操作。rn[WARNING] /C:/Users/Administrator/Desktop/travel - 副本/src/main/java/cn/itcast/travel/dao/impl/FindDaoImpl.java: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。rn[INFO] rn[INFO] <<< tomcat7-maven-plugin:2.1:run (default-cli) < process-classes @ travel << #write/* in servlet mappingrn at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3223)rn at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3198)rn at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1366)rn at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1353)rn at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)rn at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn ... 6 morernrn七月 21, 2019 5:00:21 下午 org.apache.catalina.core.ContainerBase startInternalrn严重: A child container failed during startrnjava.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]rn at java.util.concurrent.FutureTask.report(FutureTask.java:122)rn at java.util.concurrent.FutureTask.get(FutureTask.java:192)rn at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)rn at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.startup.Tomcat.start(Tomcat.java:335)rn at org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.startContainer(AbstractRunMojo.java:1091)rn at org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.execute(AbstractRunMojo.java:512)rn at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)rn at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)rn at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)rn at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)rn at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)rn at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)rn at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)rn at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)rn at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)rn at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)rn at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)rn at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)rn at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)rn at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)rn at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)rn at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)rn at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)rn at org.codehaus.classworlds.Launcher.main(Launcher.java:47)rnCaused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)rn at java.util.concurrent.FutureTask.run(FutureTask.java:266)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at java.lang.Thread.run(Thread.java:748)rnCaused by: org.apache.catalina.LifecycleException: A child container failed during startrn at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)rn at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn ... 6 morernrn[INFO] ------------------------------------------------------------------------rn[INFO] BUILD FAILURErn[INFO] ------------------------------------------------------------------------rn[INFO] Total time: 3.989 srn[INFO] Finished at: 2019-07-21T17:00:21+08:00rn[INFO] Final Memory: 32M/279Mrn[INFO] ------------------------------------------------------------------------rn[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run (default-cli) on project travel: Could not start Tomcat: Failed to start component [StandardServer[-1]]: Failed to start component [StandardService[Tomcat]]: Failed to start component [StandardEngine[Tomcat]]: A child container failed during start -> [Help 1]rn[ERROR] rn[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.rn[ERROR] Re-run Maven using the -X switch to enable full debug logging.rn[ERROR] rn[ERROR] For more information about the errors and possible solutions, please read the following articles:rn[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExceptionrnrnProcess finished with exit code 1
不知道哪错了!!!大佬帮忙看看
Type Exception ReportrnrnMessage An exception occurred processing JSP page [/user/top.jsp] at line [31]rnrnDescription The server encountered an unexpected condition that prevented it from fulfilling the request.rnrnExceptionrnorg.apache.jasper.JasperException: An exception occurred processing JSP page [/user/top.jsp] at line [31]rnrn28: rn29: rn30: rn31: $sessionScope.currUser.userNamern32: rn33: rn34: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:584)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:481)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:742)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rnrnrnRoot Causernjavax.el.PropertyNotFoundException: Property [userName] not found on type [don.Bean.User]rn javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:260)rn javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:212)rn javax.el.BeanELResolver.property(BeanELResolver.java:347)rn javax.el.BeanELResolver.getValue(BeanELResolver.java:92)rn org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110)rn org.apache.el.parser.AstValue.getValue(AstValue.java:169)rn org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)rn org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:944)rn org.apache.jsp.user.Login_jsp._jspx_meth_c_005fif_005f1(Login_jsp.java:282)rn org.apache.jsp.user.Login_jsp._jspService(Login_jsp.java:162)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:742)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:742)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rnrn[code=html]rn<%@ page language="java" contentType="text/html; charset=utf-8"rn pageEncoding="utf-8"%>rn<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>rnrnrn rn rn rn 登录rn rn rn rn <%@include file="top.jsp"%>rn rn rn rn rn rn rn rn 用户登录rn rn rn rn 用户名:rn rn rn rn 密码:rn rn rn rn rn 忘记密码?rn rn rn 还没有账号?rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rnrn[code=html]rn<%@ page language="java" contentType="text/html; charset=utf-8"rn pageEncoding="utf-8"%>rn<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>rn<%@page import="java.text.SimpleDateFormat,java.util.Date"%>rnrnrn rn rn rn toprn rn rn rn rn rn 做了么菜谱网rn rn $session.currUser.userNamern rn rn rn rn 您尚未登录,请rn 登陆 rn 或rn 注册 rn rn rn rn rn $sessionScope.currUser.userNamern rn rn rn rn rnrn[/code]
参数传递有问题 ,大佬帮忙看看
rn这个s的问题rn[img=https://img-bbs.csdn.net/upload/201812/04/1543932698_186495.png][/img]rnrnrnrn [img=https://img-bbs.csdn.net/upload/201812/04/1543932763_949111.png][/img]rn用红框的可以传递进去 Intent了一个新activity后 用同样的办法rnrnrnrnrn[img=https://img-bbs.csdn.net/upload/201812/04/1543932837_466161.png][/img]rn没反应 。用这个方法直接输入字符,有反应,就是这个方法的问题 dao是数据库对象,已经声明
!!!!!紧急!!!求大佬帮忙看看这是什么问题
[img=https://img-bbs.csdn.net/upload/201711/15/1510734544_687595.png][/img]rn别的文件都没报错就这个报错了!
求大佬帮忙看看sql优化问题
nnnnnnSELECT SUBSTRING(b.AreaCode,n 1,n 6) AS areaCode,n COUNT(*) AS countnFROM Data_MoJiWeather A JOINn (SELECTn AreaCode,n Lon,n Lat,n Shi,n Xian,n AreaTypen FROM Data_Area_Infon WHERE AreaCode NOT IN n (SELECT AreaCoden FROM Data_Area_Info an WHERE Xian LIKE '%区'n AND right(left(a.AreaCode,6),2)<06)) Bn ON A.location LIKE '%' + b.Shi + b.Xian + '%'n AND b.AreaType = '县'nWHERE CONVERT(varchar(100), up_time, 23) = '2017-11-11'nGROUP BY SUBSTRING(b.AreaCode, 1, 6)nUNIONnALL SELECT SUBSTRING(b.AreaCode,n 1,n 4)+'01' AS areaCode, COUNT(*) AS countnFROM Data_MoJiWeather AnJOIN n (SELECT AreaCode,n Lon,n Lat,n Shi,n Xian,n AreaTypen FROM Data_Area_Infon WHERE AreaCode IN n (SELECT [AreaCode]n FROM Data_Area_Info an WHERE Xian LIKE '%区'n AND right(left(a.AreaCode,6),2)<06)) Bn ON A.location LIKE '%' + b.Shi + b.Xian + '%'n AND b.AreaType = '县'nWHERE CONVERT(varchar(100), up_time, 23) = '2017-11-11'nGROUP BY SUBSTRING(b.AreaCode, 1, 4)+'01'nORDER BY areaCode nn```n n```nn![图片说明](https://img-ask.csdn.net/upload/201712/05/1512437027_27779.png)n表扫描占了很大的开销
【求助】 学习作业,求大佬帮忙看看???
写个程序,来计算表达式的值。比如计算3+1*4、(7+4)*3、3^2+4等这些式子,显然它们等于7、33、13rnrn你需要处理+、-、*、/、^,分别代表加、减、乘、除、幂,都是双目运算符,同时表达式中还包含括号()。rnrn注意运算符的优先顺序,先计算括号里的式子,幂运算符优先级最高,其次乘除运算优先级相同,最后是加减运算。同一优先级的运算符按照从左到右顺序计算。rnrn川农牛觉得这还不简单嘛,分分钟用Java给他写了个出来。rnrnrnInputrn输入一个不带空格的字符串(长度不超过10000),代表需要计算值的表达式。表达式中只有正整数,除法也请参照正整数除法比如3/2应该等于1。rnrn输入的字符串保证是一个合法的表达式。rnrnrnOutputrn输出计算出的值,注意这个值有可能会非常非常大。如果表达式中出现了除0错误,直接输出ERROR
大佬帮忙给看看,在线OJ题 ///////////
题目内容:n你的程序要读入一行文本,其中以空格分隔为若干个单词,以‘.’结束。你要输出这行文本中每个单词的长度。这里的单词与语言无关,可以包括各种符号,比如“it's”算一个单词,长度为4。注意,行中可能出现连续的空格。nn输入格式:n输入在一行中给出一行文本,以‘.’结束,结尾的句号不能计算在最后一个单词的长度内。nn输出格式:n在一行中输出这行文本对应的单词的长度,每个长度之间以空格隔开,行末没有最后的空格。nn输入样例:nIt's great to see you here.nn输出样例:n4 5 2 3 3 4n时间限制:500ms内存限制:32000kbnn一下是我写的代码,大佬帮忙看看。。。。。。——————————————————————————n#includennint main()nn char ch; int n;n scanf("%c",&ch);n while (ch != '.')n while (ch==' ')n n scanf("%c", &ch);n n n = 0;n while (ch!=' '&& ch!='.')n n n += 1; scanf("%c", &ch);n n printf("%d ",n);n n return 0;nnn```n n```nn
C语言程序,大佬帮忙看看哪里出问题了
是一个搜索引擎,用户输入关键字,在txt文件中查找rnrnrn![图片说明](https://img-ask.csdn.net/upload/201812/29/1546086663_544021.png)rn```rn#define __STDC_WANT_LIB_EXT1__ 1rn#include rn#include rn#include rn#include rnrn#define COUNT 5 rn#define LENGTH 256 rnrnchar delimiters[] = " \n";rnbool find = false;rnrntypedef struct Filernrn FILE *pfile;rn char *filename;rnFile;rnFile query = .filename = "query.txt", .pfile = NULL;rnrntypedef struct Tokenizernrn int count; rn char **pwords;rnTokenize;rnrnint tokenizing(char *, char **);rnint get_file(char *, int);rnvoid open_file(FILE *, char *, char *);rnvoid set_position(FILE *);rnint get_content(char **, int, FILE *);rnbool core_search(int, int, char **, char **);rnbool exact_search(int, int, char **, char **);rnrnvoid free_memory(char **, int);rnrnint main(int argc, char *argv[])rnrn char mode_1[2][10] = "manual", "script";rn char mode_2[4][15] = "coreSearch", "exactSearch", "topSearch", "topKSearch";rn char QA[LENGTH]; rn char buf[LENGTH];rn int fileID = 0;rn int queryID = 0;rn bool GET;rn File data;rn Tokenize qa;rn Tokenize content;rn if(strcmp(argv[1], mode_1[0]) == 0)rn rn printf("\n\nEnter query terms with up to %d characters per line.\n"rn "Terminate input by entering an empty line:\n", LENGTH - 1);rn rn while(true)rn rn fgets(buf, LENGTH, stdin); rn if(buf[0] == '\n') rn break;rn rn if(strcat_s(QA, LENGTH, buf)) rn rn printf("Something's wrong. Maximum permitted input length exceeded.\n");rn return 1;rn rn rn rn qa.count = tokenizing(QA, qa.pwords);rnrn while(get_file(data.filename, fileID))rn rn open_file(data.pfile, data.filename, "r");rn set_position(data.pfile);rnrn while(get_content(content.pwords, content.count, data.pfile))rn rn if(strcmp(argv[2], mode_2[0]) == 0)rn rn GET = core_search(qa.count, content.count, qa.pwords, content.pwords);rn if(!GET) printf("Core Search: d%d\n", fileID);rn rn if(strcmp(argv[2], mode_2[1]) == 0)rn rn GET = exact_search(qa.count, content.count, qa.pwords, content.pwords);rn if(!GET) printf("Exact Search: d%d\n", fileID);rn rnrn free_memory(content.pwords, content.count);rn fclose(data.pfile);rn rn rn free_memory(qa.pwords, qa.count);rn rn rn rn if(strcmp(argv[1], mode_1[1]) == 0) rn rn open_file(query.pfile, query.filename, "w");rnrn printf_s("\n\nPlease create your query file. \nEnter search queries ",rn "(1 per line) identified by the query ID or press Enter to end:\n");rnrn while(true)rn rn fgets(QA, LENGTH, stdin); rn if(QA[0] == '\n') rn break; rn if(EOF == fputs(QA, query.pfile)) rn rn printf_s("Error writing file.\n");rn return 1; rn rn rn fclose(query.pfile); rn rn open_file(query.pfile, query.filename, "r");rnrn while(fgets(QA, LENGTH, query.pfile))rn rn ++ queryID;rn qa.count = tokenizing(QA, qa.pwords);rn rn while(get_file(data.filename, fileID))rn rn open_file(data.pfile, data.filename, "r");rn set_position(data.pfile);rnrn while(get_content(content.pwords, content.count, data.pfile))rn rn if(strcmp(argv[2], mode_2[0]) == 0)rn rn GET = core_search(qa.count, content.count, qa.pwords, content.pwords);rn if(!GET) printf("Core Search: q%d d%d\n", queryID, fileID);rn rn if(strcmp(argv[2], mode_2[1]) == 0)rn rn GET = exact_search(qa.count, content.count, qa.pwords, content.pwords);rn if(!GET) printf("Exact Search: q%d d%d\n", queryID, fileID);rn rnrn free_memory(content.pwords, content.count);rn fclose(data.pfile);rn rn rn free_memory(qa.pwords, qa.count);rn rn rnrn return 0;rnrnrnint tokenizing(char *str, char **pWords)rnrn char *ptr = NULL; rn size_t maxWords = 10; rn int wordCount = 0; rn size_t wordLength = 0; rn pWords = calloc(maxWords, sizeof(char*)); rn size_t str_len = strnlen_s(str, LENGTH); rn char *pWord = strtok_s(str, &str_len, delimiters, &ptr);rn bool newWord = true; rnrn if(!pWord)rn rn printf("No words found. Ending program.\n");rn exit (1);rn rn rn while(pWord)rn rn for(int i = 0 ; i < wordCount ; ++i)rn if(strcmp(*(pWords + i), pWord) == 0)rn rn newWord = false;rn break;rn rnrn if(newWord) rn rn if(wordCount == maxWords)rn rn maxWords += COUNT;rn pWords = realloc(pWords, maxWords*sizeof(char*));rn rn wordLength = ptr - pWord; rn *(pWords + wordCount) = malloc(wordLength); rn strcpy_s(*(pWords + wordCount), wordLength, pWord); rn ++ wordCount; rn rn else newWord = true; rn pWord = strtok_s(NULL, &str_len, delimiters, &ptr); rn rnrn return wordCount;rn rnrnint get_file(char *filename, int num)rnrn char str_num[5];rn size_t size = 10;rn char head[3] = "00";rn char head_2[2] = "0";rn char extension[5] = ".txt";rn filename = malloc(size);rn FILE *pfile = NULL;rn num = 0;rn rn ++num;rn if(num < 10)rn rn strcpy_s(filename, sizeof(filename), head);rn sprintf(str_num, "%d", num);rn strcat_s(filename, sizeof(filename), str_num);rn strcat_s(filename, sizeof(filename), extension);rn rnrn else if(num >= 10 && num < 100)rn rn strcpy_s(filename, sizeof(filename), head_2);rn sprintf(str_num, "%d", num);rn strcat_s(filename, sizeof(filename), str_num);rn strcat_s(filename, sizeof(filename), extension);rn rn rn elsern rn sprintf(filename, "%d", num);rn strcat_s(filename, sizeof(filename), extension); rn rnrnrnvoid open_file(FILE *pfile, char *filename, char *mode)rnrn if(fopen_s(&pfile, filename, mode)) rn rn printf_s("Error opening %s for writing. Program terminated.\n", query.filename);rn exit(1);rn rn setbuf(pfile, NULL);rnrnrnvoid set_position(FILE *pfile)rnrn int offset = -1;rn while(true)rn rn fseek(pfile, offset, SEEK_SET);rn if(fgetc(pfile) == '>') rn rn -- offset;rn fseek(pfile, offset, SEEK_SET);rn if(fgetc(pfile) == '>') break;rn rn --offset;rn rnrnrnint get_content( char **pWords, int wordCount, FILE *pfile)rnrn char *pContent = malloc(LENGTH);rn fgets(pContent, LENGTH, pfile); rn char *ptr = NULL; rn size_t maxWords = 50; rn wordCount = 0; rn size_t wordLength = 0; rn size_t str_len = strnlen_s(pContent, LENGTH);rn char *pWord = strtok_s(pContent, &str_len, delimiters, &ptr);rn pWords = calloc(maxWords, LENGTH); rnrn if(!pWord) return 0;rn rn while(pWord)rn rn if(wordCount == maxWords)rn rn maxWords += COUNT;rn pWords = realloc(pWords, maxWords*sizeof(char*));rn rnrn wordLength = ptr - pWord; rn *(pWords + wordCount) = malloc(wordLength); rn strcpy_s(*(pWords + wordCount), wordLength, pWord); rn ++ wordCount;rn pWord = strtok_s(NULL, &str_len, delimiters, &ptr); rn rnrn free(pContent); rn pContent = NULL;rnrnrnbool core_search(int count_1, int count_2, char **pWords_1, char **pWords_2)rnrn for(int i = 0 ; i < count_1 ; ++ i )rn rn for(int j = 0 ; j < count_2 ; ++ j)rn rn if(strcmp(*(pWords_1 + i), *(pWords_2 + j)) == 0)rn rn find = true;rn break;rn rn else find = false;rn rn rn if(find) return true;rnrnrnbool exact_search(int count_1, int count_2, char **pWords_1, char **pWords_2)rnrn int FIND[count_1];rn int sum = 0; rn for(int i = 0 ; i < count_1 ; ++ i)rn rn for(int j = 0 ; j < count_2 ; ++ j)rn rn if(strcmp(*(pWords_1 + i), *(pWords_2 + j)) == 0) rn rn find = true;rn break;rn rn else find = false; rn rn if(find) FIND[i] = 1;rn else FIND[i] = 0;rn rn for(int i = 0 ; i < count_1 ; ++ i)rn sum += FIND[i];rn if(sum == count_1) return true;rnrnrnrnvoid free_memory(char **pStrs, int count)rnrn for(int i = 0; i < count ; ++i)rn rn free(*(pStrs + i)); rn *(pStrs + i) = NULL; rn rn free(pStrs); rn pStrs = NULL; rnrnrnrn```
一直报错
使用SWT MessageDialog.openinformation方法时一直保存说没有这个方法,请问需要导入什么包?
jsp-ajax实例一直报错!高手帮看看!
zip.html如下:[code=HTML]rnrnrn Check.htmlrnrn rn rnrnrn rn区号: rn城市: rnrnrnrnrnrnrn[/code]rnzip.jsp 如下:[code=HTML]:<%@ page contentType="text/html; charset=UTF-8" language="java" errorPage="" %>rn<%rnString zip= request.getParameter("zip");rnif("021".equals(zip)) out.print("上海");rnelse if("010".equals(zip)) out.print("北京");rnelse if("020".equals(zip)) out.print("天津");rnelse out.print("未知城市");rn%>rn[/code] 运行时一直跳出 "您所请求的页面有异常"很莫名。
反向数字 一直有这种报错 麻烦大佬们看一下
[img=https://img-bbs.csdn.net/upload/201611/27/1480262156_825115.png][/img]
数据结构的题 有没有大佬
约瑟夫(Joseph)问题的一种描述是:设编号为1,2,…,n的n(n>0)个人按顺时针方向围坐一圈,每人持有一个密码(正整数)。开始时任选一个整数作为报数上限值m,从一个人开始顺时针自1开始顺序报数,报到m时停止报数。报m的人出列,将他的密码作为新的m值,从他在顺时针方向上的下一个人开始重新从1报数,如此下去,直至所有的人全部出列为止。要求设计一个程序模拟此过程,求出出列顺序。n(2) 设计要求n 设计一个程序,以人机交互方式执行,用户指定约瑟夫环游戏的总人数n和初始的报数上限m,然后输入每个人所持有的密码key。模拟约瑟夫环,从头开始报数,直到所有的人出列。系统按照出列顺序给出编号。n(3) 数据结构n 本设计利用带头结点的单循环链表作为模拟约瑟夫环游戏的存储结构。n
大佬转义序列报错啊
我也不敢问,我也不好说[img=https://img-bbs.csdn.net/upload/201905/06/1557157278_462819.jpg][/img][img=https://img-bbs.csdn.net/upload/201905/06/1557157426_945701.jpg][/img][img=https://img-bbs.csdn.net/upload/201905/06/1557157425_305051.jpg][/img]
我的session_start()报错,帮忙看看!!
Warning: open(D:\php\sessiondata\sess_1a768a4f6c40b3cab652de92aad37ba4, O_RDWR) failed: Permission denied (13) in rnWarning: open(D:\php\sessiondata\sess_1a768a4f6c40b3cab652de92aad37ba4, O_RDWR) failed: Permission denied (13) in Unknown on line 0rnrnWarning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (D:\php\sessiondata) in Unknown on line 0
帮忙看看有没有好方法!
http://expert.csdn.net/Expert/topic/2193/2193386.xml?temp=.3563501
build文件报错。帮忙看看。。
[code=Java]Buildfile: F:\tempsvn\adapter_cmccinterface\build.xmlrnrnBUILD FAILEDrnF:\tempsvn\adapter_cmccinterface\build.xml:6: The file or path you specified (..\..\..\modules\build.properties) is invalid relative to F:\tempsvn\adapter_cmccinterfacernrnTotal time: 156 milliseconds[/code]rnrnant文件没怎么用过。。出错了不会弄。帮忙看看。谢谢
急 resin报错 帮忙看看
我的resin报错 帮忙看看 rn500 Servlet Exceptionrnjava.lang.NullPointerExceptionrn at _index__jsp._jspService(/javast/index.jsp:21)rn at com.caucho.jsp.JavaPage.service(JavaPage.java:75)rn at com.caucho.jsp.Page.subservice(Page.java:506)rn at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)rn at com.caucho.server.http.Invocation.service(Invocation.java:315)rn at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)rn at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246)rn at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:164)rn at com.caucho.server.TcpConnection.run(TcpConnection.java:139)rn at java.lang.Thread.run(Thread.java:536)rn
图像保存报错,帮忙看看
MSDN上的例子,改了下总是报错,为何?rn[code=C#]rnStream stream3 = new System.IO.FileStream(s, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite); rn TiffBitmapDecoder tifDecoder = new TiffBitmapDecoder(stream3, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);rn BitmapFrame pngFrame = (BitmapFrame)tifDecoder.Frames[0];rn BitmapMetadata myBitmapMetadata = new BitmapMetadata("tiff");rn TiffBitmapEncoder encoder3 = new TiffBitmapEncoder();rn myBitmapMetadata.ApplicationName = "";rn myBitmapMetadata.Author = new ReadOnlyCollection(rn new List() "" );rn myBitmapMetadata.CameraManufacturer = "";rn myBitmapMetadata.CameraModel = "";rn myBitmapMetadata.Comment = "";rn myBitmapMetadata.Copyright = "";rn myBitmapMetadata.Keywords = new ReadOnlyCollection(rn new List() "", "" ); rn myBitmapMetadata.Subject = "";rn myBitmapMetadata.Title = ""; rn encoder3.Frames.Add(BitmapFrame.Create(pngFrame,pngFrame.Thumbnail, myBitmapMetadata,pngFrame.ColorContexts));rn//[color=#FF0000][b]下面这句出错[/b][/color]rn encoder3.Save(stream3);rn stream3.Close(); rn[/code]
上传文件报错,大家帮忙看看
“/”应用程序中的服务器错误。rn--------------------------------------------------------------------------------rnrn未能找到文件“H:\课程频道测试数据\zjy\ED005 Microsoft Office Excel 2003 实用技巧之5:Excel VBA在办公方案中的应用.wmv”。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.IO.FileNotFoundException: 未能找到文件“H:\课程频道测试数据\zjy\ED005 Microsoft Office Excel 2003 实用技巧之5:Excel VBA在办公方案中的应用.wmv”。rnrn源错误: rnrnrn行 204: string FullUpLoadName = file.FileName.ToString();rn行 205: System.IO.FileInfo fNew = new FileInfo(FullUpLoadName);rn行 206: long FileLenth = Convert.ToInt64(fNew.Length);rn行 207: /***********判断上传文件大小**************/rn行 208: if (FileLenth > 102400000)rnrnrn在本地机器可以上传.弄到服务器就报错了..rn[code=C#]rn string FullUpLoadName = file.FileName.ToString();rn System.IO.FileInfo fNew = new FileInfo(FullUpLoadName);rn long FileLenth = Convert.ToInt64(fNew.Length);rn /***********判断上传文件大小**************/rn if (FileLenth > 102400000)rn rn lab1.Visible = true;rn lab1.Text = "上传文件大于100M请重新上传!";rn rn elsern rn string tt = Session["roadStrTxt"] + "\\" + file.GetName();rn string pathName = System.Web.HttpContext.Current.Server.MapPath(tt);rnrn /**************判断文件是否存在***************/rn if (File.Exists(pathName))rn rn lab1.Visible = true;rn lab1.Text = "对不起文件存在,请从新上传!";rn rn elsern rn string FileNM = FullUpLoadName.Substring(FullUpLoadName.LastIndexOf("\\") + 1);rn string type = FullUpLoadName.Substring(FullUpLoadName.LastIndexOf(".") + 1);rn if (type == "zip" || type == "ZIP")rn rn file.SaveAs(pathName);rn lab1.Text = " 文件上传成功!";rnrn rn elsern rn lab1.Visible = true;rn lab1.Text = "对不起您上传的文件格式不正确!";rn rn rn rn[/code]rn rn
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表