android 开发时 线程老是出问题,求帮忙看看怎么回事

跟着书上一步步来的,不知道哪里有问题,tomcat打开了,却连接不了服务器,似乎不执行线程里的东西

package com.example.administrator.myapplication;

import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;

public class MainActivity extends AppCompatActivity {

private EditText nickname;
private EditText content;
private String result="";
private TextView resultTV;
private Handler handler;
private Button button;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    nickname=(EditText)findViewById(R.id.nickname);
    content=(EditText)findViewById(R.id.content);
    resultTV=(TextView)findViewById(R.id.resultTV);

    button=(Button)findViewById(R.id.button);

    button.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            if("".equals(content.getText().toString())){
                Toast.makeText(MainActivity.this,"请输入要发表的内容",Toast.LENGTH_SHORT).show();
                return;
            }

            new Thread(new Runnable() {
                public void run() {
                    send();
                    handler=new Handler(){
                        public void handleMessage(Message msg){
                            if (result!=null){
                                resultTV.setText(result);
                                content.setText("");
                                nickname.setText("");
                            }
                            super.handleMessage(msg);
                        }
                    };

                    Message m=handler.obtainMessage();
                    handler.sendMessage(m);
                }
            }).start();
        }
    });
}

public void send(){
    String target="http://10.0.2.2:8080/test/co.jsp";
    URL url;

    try {
        url=new URL(target);
        try {
            HttpURLConnection urlConn=(HttpURLConnection)url.openConnection();
            urlConn.setRequestMethod("POST");
            urlConn.setDoInput(true);
            urlConn.setDoOutput(true);
            urlConn.setInstanceFollowRedirects(true);
            urlConn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
            DataOutputStream out=new DataOutputStream(urlConn.getOutputStream());

            String param="nickname="+ URLEncoder.encode(nickname.getText().toString(),"utf-8")+"&content="+URLEncoder.encode(content.getText().toString(),"utf-8");
            out.writeBytes(param);
            out.flush();
            out.close();

            if(urlConn.getResponseCode()==HttpURLConnection.HTTP_OK){
                InputStreamReader in =new InputStreamReader(urlConn.getInputStream());
                BufferedReader buffer=new BufferedReader(in);
                String inputLine=null;
                while ((inputLine=buffer.readLine())!=null){
                    result+=inputLine+"\n";
                }
                in.close();
            }
            urlConn.disconnect();

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

    } catch (IOException e) {
        e.printStackTrace();
    }
}

}

这是我jsp的内容

<%@page contentType="text/html;charset=utf-8" language="java" %>
<%
String content=request.getParameter("content");
String nickname=request.getParameter("nickname");
if(content!=null&&nickname!=null){
nickname=new String(nickname.getBytes("iso-8859-1"),"utf-8");
content=new String(content.getBytes("iso-8859-1"),"utf-8");
String date=new java.util.Date().toLocaleString();
%>
<%="["+nickname+"]于"+date+"发表一条内容如下:"%>
<%=content%>
<%}%>

5个回答

子线程不能new Handler直接使用,需要手动启动Looper,查看Handler Looper的运行机制即可了解

子线程中的Handler需要在其前后分别写上Looper.prepare()和Looper.loop()方法,否则不起作用的,因为主线程已经帮你写上这两句话了。

handler = new Handler(Looer.mainLooper) . 就可以了

子线程不能new handler这样不起作用的

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
触发器出问题了,帮忙看看怎么回事?
代码如下:rnrnPrivate Sub Command1_Click(Index As Integer)rn Timer1.Interval = 60000rn Timer1.Enabled = Truern DifTime = DateAdd("s", 15, Now) rnEnd SubrnrnPrivate Sub Timer1_Timer()rn If Now >= DifTime Thenrn Timer1.Enabled = Falsern .........//执行语句rn DifTime = DateAdd("s", 15, Now) rn Timer1.Enabled = Truern End IfrnEnd Subrn我原本是希望不断的执行我导数据的程序,但后来过了两天去看,没新数据导入我重新启动该执行程序后又有新数据了,是不是我的触发器出问题了?rnrn
请各位帮忙看看!!老是出问题!!
下面这段程序,我觉得是正确的,但是运行的结果在我意料之外rn先请看程序:rn#include rnvoid print (void);rnstruct byrnrn char keep[15];rn;rnstruct by save[999];rnvoid print (void)rnrn FILE *inputfirst;rn int i=0,y=0;rn char temp;rn char temp1[10];rn printf ("请输入您要比较的文件名(如:test.txt):");rn scanf ("%10s",temp1);rn inputfirst = fopen (temp1,"r");rn if (inputfirst == NULL)rn rn printf ("没找到您输入的文件名,请重新输入!\n");rn exit(1);rn rn dorn rn dorn rn temp = getc (inputfirst);rn save[i].keep[y] = temp;rn ++y;rn while (temp != '\n');rn save[i].keep[y -1] = '\0';rn ++i;rn while (temp != EOF);rn printf ("%s\n",save[0].keep); \\打印测试一下rnrnint main (void)rnrn print();rn return 0;rnrn这段是我想把一个文本文件里面的数据读取到结构中去。rn因为我文本中的结构是这样的rn1.4.G.G01.00341rn1.4.G.G01.00351rn1.4.G.G01.00343rn1.4.G.G01.00345rn1.4.G.G01.00349rn1.4.G.G01.00353rn1.4.G.G01.00352rn1.4.G.G01.00335rn1.4.G.G01.00347rn1.4.G.G01.00336rn1.4.G.G01.00003rn1.4.G.G01.00023rn所以,当遇到'\n'符号的时候就把前面读到的,存到一个结构成员中去。rn用EOF做文件结尾的判断。rn但是奇怪的是,如果我拿走rndornrnwhile (temp != EOF);rn这个外层循环的话,那就能读出一排来,但是加上这个就变成死循环了,而且,结构里面也没能存到字符。rn请各位帮我看看,到底问题是出在哪里呢?谢谢,小弟感激不尽。rn我整个程序如下:rn#include rn#include rnbool compare (char a[] , char b[]);rnvoid find (void);rnvoid fuzhi (char a[] , char b[]);rnstruct byrnrn char keep[15];rn;rnstruct by save[999];rnstruct shurnrn char repeat[15];rn int number;rn;rnstruct shu jieguo[999];rnbool compare (char a[] , char b[])rnrn int i = 0;rn while (a[i] == b[i] && a[i] != '\0' && b[i] != '\0')rn rn ++i;rn rn if (a[i] == '\0' && b[i] == '\0')rn rn return true;rn rn elsern rn return false;rn rnrnvoid find (void)rnrn FILE *inputfirst;rn int i,y,a,b,e,f = 0,g = 0;rn char temp;rn char temp1[10];rn bool t = false;rn printf ("请输入您要比较的文件名(如:test.txt):");rn scanf ("%10s",temp1);rn inputfirst = fopen (temp1,"r");rn if (inputfirst == NULL)rn rn printf ("没找到您输入的文件名,请重新输入!\n");rn exit(1);rn rn for (i = 0;temp != EOF; ++i)rn rn for (y = 0;temp != '\n'; ++y)rn rn temp = getc(inputfirst);rn save[i].keep[y] = temp;rn rn save[i].keep[y - 1] = '\0';rn rn for (a = 0; a <= i; ++a)rn rn b = 0 , e = 0;rn while (b <= i)rn rn t = compare (save[b].keep,save[a].keep);rn if (t == true)rn rn ++e;rn rn rn if (e > 1)rn rn jieguo[f].number = e;rn fuzhi (jieguo[f].repeat,save[a].keep);rn ++f;rn rn rn if (f == 0)rn rn printf ("您的文件中没有重复的内容!\n");rn rn elsern rn for (a = 0; a < f; ++a)rn rn printf ("%s%80i",jieguo[a].repeat,jieguo[a].number);rn rn rnrnvoid fuzhi (char a[] , char b[])rnrn int i;rn for (i = 0;b[i] != '\0'; ++i)rn rn a[i] = b[i];rn rn a[i] = '\0';rnrnint main (void)rnrn find();rn return 0;rnrn
数据库老是出问题,大神帮忙看看参数
数据库内存经常达到300m以上,以下是服务器和数据库参数:rnrn服务器配置:4G内存 6核cpurnmysql:5.5.35rnmy.ini配置:rnsql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"rnmax_connections=800rnquery_cache_size=84Mrntable_cache=1520rntmp_table_size=30Mrnthread_cache_size=38rnmyisam_max_sort_file_size=100Grnmyisam_sort_buffer_size=30Mrnkey_buffer_size=129Mrnread_rnd_buffer_size=256Krnsort_buffer_size=256Krn#skip-innodbrninnodb_additional_mem_pool_size=6Mrninnodb_flush_log_at_trx_commit=1rninnodb_log_buffer_size=3Mrninnodb_buffer_pool_size=250Mrninnodb_log_file_size=50Mrninnodb_thread_concurrency=14rnrnrn
调用java.sql.addBatch()老是出问题,怎么回事。
出现这个问题。rnjava.lang.AbstractMethodErrorrnrn at com.protect.crypt.CryptMotherCode.CreatedbCode(CryptMotherCode.java:39)rnrn at com.protect.test.(test.java:46)rnrn at com.protect.test.main(test.java:55)rnrnException in thread "main"
android 开发空指针异常 求大神帮忙看看
如题 求助解决方法。error log 如下:rn09-01 13:18:39.187: E/AndroidRuntime(21433): FATAL EXCEPTION: mainrn09-01 13:18:39.187: E/AndroidRuntime(21433): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.getDrawingRect(android.graphics.Rect)' on a null object referencern09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup$ViewLocationHolder.init(ViewGroup.java:7297)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup$ViewLocationHolder.obtain(ViewGroup.java:7232)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup$ChildListForAccessibility.init(ViewGroup.java:7167)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup$ChildListForAccessibility.obtain(ViewGroup.java:7135)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.dispatchPopulateAccessibilityEventInternal(ViewGroup.java:2729)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.View.dispatchPopulateAccessibilityEvent(View.java:5362)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.dispatchPopulateAccessibilityEventInternal(ViewGroup.java:2735)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.View.dispatchPopulateAccessibilityEvent(View.java:5362)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.dispatchPopulateAccessibilityEventInternal(ViewGroup.java:2735)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.View.dispatchPopulateAccessibilityEvent(View.java:5362)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.widget.RelativeLayout.dispatchPopulateAccessibilityEvent(RelativeLayout.java:1120)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.widget.AdapterView.onRequestSendAccessibilityEvent(AdapterView.java:949)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.requestSendAccessibilityEvent(ViewGroup.java:740)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.requestSendAccessibilityEvent(ViewGroup.java:744)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.requestSendAccessibilityEvent(ViewGroup.java:744)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.requestSendAccessibilityEvent(ViewGroup.java:744)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:5330)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.View.sendAccessibilityEventUnchecked(View.java:5311)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.run(ViewRootImpl.java:6948)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.runOrPost(ViewRootImpl.java:6974)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewRootImpl.postSendWindowContentChangedCallback(ViewRootImpl.java:6175)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewRootImpl.notifySubtreeAccessibilityStateChanged(ViewRootImpl.java:6288)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:2780)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:2780)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:2780)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:2780)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:2780)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:2780)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:2780)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:2780)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:2780)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.View.notifySubtreeAccessibilityStateChangedIfNeeded(View.java:8020)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.addViewInner(ViewGroup.java:4005)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.addView(ViewGroup.java:3794)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.addView(ViewGroup.java:3735)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at com.app.myfolder.view.ScrollLayout.addView(ScrollLayout.java:213)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.view.ViewGroup.addView(ViewGroup.java:3708)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at com.app.myfolder.view.ScrollLayout.refreView(ScrollLayout.java:226)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at com.app.myfolder.activity.FoldersBoxActivity.initContainer(FoldersBoxActivity.java:675)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at com.app.myfolder.activity.FoldersBoxActivity.access$75(FoldersBoxActivity.java:658)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at com.app.myfolder.activity.FoldersBoxActivity$FolderAsyncTask.onPostExecute(FoldersBoxActivity.java:3110)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at com.app.myfolder.activity.FoldersBoxActivity$FolderAsyncTask.onPostExecute(FoldersBoxActivity.java:1)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.os.AsyncTask.finish(AsyncTask.java:636)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.os.AsyncTask.access$500(AsyncTask.java:177)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:653)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.os.Handler.dispatchMessage(Handler.java:102)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.os.Looper.loop(Looper.java:135)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at android.app.ActivityThread.main(ActivityThread.java:5254)rn09-01 13:18:39.187: E/AndroidRuntime(21433): at java.lang.reflect.Method.invokern
ssh整合老是出问题 帮忙
老是说找不到action配置我感觉没错 rn大家帮我看看 这整合的我快疯了 又没资料找rn还需要什么文件说 我实在看不出那里错了rnNo action config found for the specified url.rn详细的错误信息在下面rn[code=XML] rn rn [/code]rnrnrnrn[code=XML]rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrn rnrnrnrn[/code]rnrnorg.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.rn org.apache.struts.chain.commands.AbstractSelectAction.execute(AbstractSelectAction.java:71)rn org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)rn org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.rnrn
自定义控件ViewState出问题了,看看怎么回事
问题:rn查看页:rnhttp://202.200.225.83/newblog/login.aspxrn点击登录按钮,用户名的文本框就会添加“,”号,而且是+=添加rnrnlogin.aspx的页面实现:rn整页只有一个自定义UserFrame控件【代码见下】,UserFrame控件根据SwapStrings属性和SwapControls属性提供的字符串,分析Text属性,将Text属性中SwapStrings的字符加载SwapControls提供的用户控件路径加载控件并Render,最终页面由Javascript呈现rnrnUserFrame控件源码:rnusing System;rnusing System.Web;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.ComponentModel;rnusing System.Text;rnrnrn[assembly:TagPrefix("FrameMaster","SmallCharm")]rnnamespace FrameMasterrnrn /// rn /// WebCustomControl1 的摘要说明。rn /// rn [DefaultProperty("Text"),rn ToolboxData("<0:UserFrame runat=server>")]rn public class UserFrame :System.Web.UI.Control,INamingContainerrn rn private string text;rn private string swapstrings;rn private string swapcontrols;rn private string CopyRightInfo="";rn private string[] swapstring;rn private string[] swapcontrol;rnrn [Bindable(true),rn Category("Appearance"),rn DefaultValue("")]rn public string Textrn rn getrn rn return text;rn rnrn setrn rn text = value;rn rn rnrn [Bindable(true),rn Category("Data"),rn DefaultValue(""),Description("替换字符串集合,#分割")]rn public string SwapStringsrn rn getrn rn return swapstrings;rn rn setrn rn swapstrings = value;rn rn rnrn [Bindable(true),rn Category("Data"),rn DefaultValue(""),Description("控件路径集合,#分割")]rn public string SwapControlsrn rn getrn rn return swapcontrols;rn rn setrn rn swapcontrols = value;rn rn rnrn /// rn /// 将此控件呈现给指定的输出参数。rn /// rn /// 要写出到的 HTML 编写器 rn protected override void Render(HtmlTextWriter output)rn rn //输出版权信息rn output.Write(this.CopyRightInfo);rn //输出客户端替换JavaScriptrn output.Write(this.MyGetJavaScript());rn /*if ((this.HasControls())&&(this.Controls[0] is LiteralControl)) rn rn output.Write(((LiteralControl)Controls[0]).Text);rn */rn output.Write(text);rn base.Render(output);rn rn rn protected override void OnInit(EventArgs e)rn rn // TODO: 添加 UserFrame.OnInit 实现rn this.CopyRightInfo+="\n\n";rn rn rn base.OnInit (e);rn rnrn protected string MyGetJavaScript()rn rn StringBuilder js=new StringBuilder(600);rn js.Append("\n \n");rnrn return js.ToString();rn rn rn protected override void CreateChildControls()rn rn // TODO: 添加 UserFrame.CreateChildControls 实现rn //加载替换控件rn swapstring=swapstrings.Split('#');rn swapcontrol=swapcontrols.Split('#');rn if(swapstring.Length!=swapcontrol.Length)rn rn throw new Exception("替换字符串集合和控件集合设置错误,数目不一致!");rn rn PlaceHolder ctrlHolder;rn UserControl uctrl;rn for(int i=0;i"));rn uctrl=(UserControl)Page.LoadControl(swapcontrol[i]);rn ctrlHolder.Controls.Add(uctrl);rn ctrlHolder.Controls.Add(new LiteralControl(""));rn this.Controls.Add(ctrlHolder);rn rnrn rnrn rn rn public override void DataBind()rn rn // TODO: 添加 UserFrame.DataBind 实现rn //this.OnDataBinding(System.EventArgs.Empty);rn rn base.DataBind ();rn rn rn protected override object SaveViewState()rn rn // TODO: 添加 UserFrame.SaveViewState 实现rn Object baseState=base.SaveViewState();rn Object[] myState=new object[4];rn myState[0]=baseState;rn myState[1]=this.Text;rn myState[2]=this.SwapStrings;rn myState[3]=this.SwapControls;rn return myState;rn rn rn protected override void LoadViewState(object savedState)rn rn // TODO: 添加 UserFrame.LoadViewState 实现rn if(savedState!=null)rn rn Object[] myState=(Object[])savedState;rn if(myState[0]!=null)rn base.LoadViewState(myState[0]);rn if(myState[1]!=null)rn this.Text=(string)myState[1];rn if(myState[2]!=null)rn this.SwapStrings=(string)myState[2];rn if(myState[3]!=null)rn this.SwapControls=(string)myState[3];rn rn rn rn protected override void TrackViewState()rn rn // TODO: 添加 UserFrame.TrackViewState 实现rn if(HasChildViewState)rn ClearChildViewState();rn base.TrackViewState ();rn rn rnrn
帮忙看看哪里出问题了。
有n个人围成一圈,按顺序从1到n编好号。从第一个人开始报数,报到3的人退出圈子,下一个人从1开始报数,报到3的人退出圈子,如此下去,直到留下最后一个人。请按退出顺序输出退出圈子的人的编号。rnrn样例输入:rn8rn样例输出:rn3rn6rn1rn5rn2rn8rn4rn7rn#include rn#include rnint main() rn rn int n,*p,i,k=0,j=0; rn scanf("%d",&n); rn if((p=(int *)calloc(n,sizeof(int)))==NULL) rn exit(1); rn for(i=0;i<=n;i++) rn *(p+i)=i+1; rn for(i=0;i
帮忙看看哪儿出问题了
System Error.Code 1411.热键已注册rnWin2000+D6rn======================rnunit Unit1;rnrninterfacernrnusesrn Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,rn Dialogs, StdCtrls, ExtCtrls;rnrnconstrn LSX_MYMESSAGE = WM_USER + $1100;rn MsgStr = 'This is my message!';rnrntypern TForm1 = class(TForm)rn GroupBox1: TGroupBox;rn cb1: TCheckBox;rn cb2: TCheckBox;rn cb3: TCheckBox;rn cb4: TCheckBox;rn PostMsg: TButton;rn SendMsg: TButton;rn procedure PostMsgClick(Sender: TObject);rn procedure SendMsgClick(Sender: TObject);rn procedure FormCreate(Sender: TObject);rn privatern procedure OnAppMsg(var msg:TMsg; var handle: Boolean);rn Procedure LSXMyMessage(var msg:TMessage);message LSX_MYMESSAGE;rn publicrn procedure WndProc(var msg:TMessage);override;rn procedure DefaultHandler(var msg);override;rn end;rnrnvarrn Form1: TForm1;rnrnimplementationrnrn$R *.dfmrnconstrn //声明两个字符串,表明消息是被Send或Postrn PostSendStr: array[0..1] of string=('sent','posted');rnrn//将消息Post方式发送给当前窗口rnprocedure TForm1.PostMsgClick(Sender: TObject);rnbeginrn PostMessage(handle,LSX_MYMESSAGE,1,0);rnend;rnrn//将消息以Send方式发送给当前窗口rnprocedure TForm1.SendMsgClick(Sender: TObject);rnbeginrn SendMessage(handle,LSX_MYMESSAGE,0,0);rnend;rnrnprocedure TForm1.FormCreate(Sender: TObject);rnbeginrn //将OnMessage设为自己的处理函数rn Application.OnMessage := OnAppMsg;rnrnend;rnrn//处理OnMessage事件的过程rnprocedure TForm1.OnAppMsg(var msg: TMsg; var handle: Boolean);rnbeginrn //检查是否是自定义消息rn if msg.message = LSX_MYMESSAGE thenrn if cb1.Checked thenrn beginrn showmessage( Format( MsgStr,[PostSendStr[msg.wParam],'Application.OnMessage'] ) );rn handle := false;rn end;rnend;rnrn//窗体的WinProc函数rnprocedure TForm1.WndProc(var msg: TMessage);rnbeginrn if msg.Msg = LSX_MYMESSAGE thenrn if cb2.Checked thenrn showmessage( Format( MsgStr,[PostSendStr[msg.wParam],'WndProc'] ) );rn inherited WndProc(msg);rnend;rnrn//处理自定义的消息rnprocedure TForm1.LSXMyMessage(var msg: TMessage);rnbeginrn if msg.Msg = LSX_MYMESSAGE thenrn if cb3.Checked thenrn showmessage( Format( MsgStr,[PostSendStr[msg.wParam],'Message Procedure'] ) );rnend;rnrn//窗口默认的处理过程rnprocedure TForm1.DefaultHandler(var msg);rnbeginrn if TMessage(msg).Msg = LSX_MYMESSAGE thenrn if cb4.Checked thenrn showmessage( Format( MsgStr,[PostSendStr[TMessage(msg).wParam],'Default Handler'] ) );rnend;rnrnend.rn
MyEclipse出问题了,帮忙看看
打开MyEclipse,出现选择工作空间后,点OK后就没反应,再打开就说这个空间已经建立了。虽然再建立一个新空间就可以打开MyEclipse,不过我不想每打开一次就建一个空间。rn前几天明明还好好的
出问题了 大家帮忙看看!!
问题出在“卖出”按钮中 卖出按钮代码如下rnjiage3:=ADOquery2.Fieldbyname('商品').asstring;rnadoquery3.Close;rnadoquery3.SQL.Clear;rnadoquery3.SQL.Add('select 价格 as wan1 from sp where 商品='+jiage3+'');rnadoquery3.Open;rna:=adoquery3.Fieldbyname('wan1').AsInteger;rnlabel6.Caption:=inttostr(a);rn//label6.Caption:=inttostr(lab6+adoquery3.Fields('wan1').asinteger);rnadoquery2.Delete;rn运行后 点击按钮 系统提示 “参数 衣服(当前商品)没有定义”rn卖出按钮实现功能就是 rn现有表1 表2 将表2中的商品删除 把表2中商品的价格赋值给a ;rn搞半天搞不好!!!
帮忙看看,页面出问题了,求帮助。
[img=http://img.my.csdn.net/uploads/201301/07/1357548306_1053.jpg][/img]rn[img=http://img.my.csdn.net/uploads/201301/07/1357548334_6034.jpg][/img]rn页面导航栏出问题 了,大家帮忙调一下吧。谢谢。rnrn项目地址:http://kuai.xunlei.com/d/ZylPCHvoyIvqUAQAdad
MYSQL存储过程出问题,求各位朋友帮忙看看
case classidrnwhen 0 thenrn select concat('',articletitle,'') as linkname,substring(articlecontent,0,400) as linkmemo,'新闻' as class from tbl_mslz_article where articletitle like concat('%',keywords,'%') or articlecontent like concat('%',keywords,'%') union select concat('',exhibitionname,'') as linkname,exhibitiondescription as linkmemo,'展厅' as class from tbl_mslz_exhibition where exhibitionname like concat('%',keywords,'%') or exhibitiondescription like concat('%',keywords,'%') union select concat('',worksname,'(',membername,')','') as linkname,worksintroduce as linkmemo,'作品' as class from vw_exhi_showworks where worksname like concat('%',keywords,'%') or worksintroduce like concat('%',keywords,'%') union select concat('',membername,'') as linkname,bio as linkmemo,case groupid when 23 then '教师会员' when 20 then '学生会员' else '未知类型' end as class from vw_exhi_showmember where membername like concat('%',keywords,'%') or bio like concat('%',keywords,'%');rnwhen 1 thenrn select concat('',articletitle,'') as linkname,substring(articlecontent,0,400) as linkmemo,'新闻' as class from tbl_mslz_article where articletitle like concat('%',keywords,'%') or articlecontent like concat('%',keywords,'%');rnwhen 2 thenrn select concat('',exhibitionname,'') as linkname,substring(exhibitiondescription,0,400) as linkmemo,'展厅' as class from tbl_mslz_exhibition where exhibitionname like concat('%',keywords,'%') or exhibitiondescription like concat('%',keywords,'%');rnwhen 3 thenrn select concat('',worksname,'(',membername,')','') as linkname,worksintroduce as linkmemo,'作品' as class from vw_exhi_showworks where worksname like concat('%',keywords,'%') or worksintroduce like concat('%',keywords,'%');rnelsern select concat('',membername,'') as linkname,substring(bio,0,400) as linkmemo,case groupid when 23 then '教师会员' when 20 then '学生会员' else '未知类型' end as class from vw_exhi_showmember where membername like concat('%',keywords,'%') or bio like concat('%',keywords,'%');rnend casern我是用的ASP 的ODBC驱动来访问MYSQL数据库的,为什么当我调用 WHEN 0的情况时,会出错,LOST CONNECTION,查了下帮助,好像是服务端超时,为什么???rn另,这样设计合不合理,有人说这样非常不合理!
sql server 老是出问题,怎么回事呢?
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005' rnrn[Microsoft][ODBC SQL Server Driver]不能装载通讯模块。驱动程序安装不正确。
请大侠帮忙看看哪里出问题?老是报错:”缺少对象“
rnrn Untitled Pagern rnrnrn rn rn rn rn rnrn
大家帮忙看看,这段老是出问题,内存不能read
编译没问题,执行时跳出 执行[0x ]的指令,引用[0x ]出错,该内存为不能[read] rn改改代码,有时又出现什么access violation ,就是令人头痛的这一段rn我用vc6,按f10能正常运行下去,rnrnrn[code=C/C++] void File::Printmainfile(char* fn1,char* fn3)rnrn ifstream fin(fn1,ios::in|ios::binary);rn if(!fin)rn cerr<
不能赋值是怎么回事??求帮忙看看
#define max 100rntypedef int data;rntypedef structrn data a[max];rn int front;rn int rear; rnsequence_que;rn//病人信息rntypedef structrnrn char name[10];rn char sex;rn int age;rn char heth[10];rninf;rnrn//初始化rnvoid init(sequence_que *sq)rnrn sq->front =sq->rear=0;rnrn//判断是否为空rnint empty(sequence_que sq)rnrn return (sq.front ==sq.rear? 1:0);rnrn//显示rnvoid display(sequence_que sq)rnrn int i;rn if(empty(sq))rn rn printf("顺序队列是空的!\n");rn rn elsern for(i=sq.front;irear==max)rn rn printf("\n顺序队列是满的!");exit(1);rn rn sq->a[sq->rear]=x;rn sq->rear=sq->rear+1;rnrn//删除rnvoid dele(sequence_que *sq)rnrn if(sq->front ==sq->rear)rn rn printf("\n顺序队列是空的!不能做删除操作!");exit(1);rn rn sq->front++;rnrnrnrn#includern#includern#includern#include"kb.h"rnvoid main()rnrn sequence_que kb;rn sequence_que kb2;rn init(&kb);rn init(&kb2);rn inf z;rn int a,b,n=0;rn while(1)rn rn printf("\n1.挂号\n");rn printf("2.显示\n");rn printf("3.看病\n");rn printf("4.退出\n");rn printf("请输入选项:");rn scanf("%d",&a);rn switch(a)rn rn case 1:n++;rn printf("请输入病人姓名:\n");rn scanf("%s",z.name);rn printf("请输入学生性别:\n");rn scanf("%s",z.sex);rn printf("请输入学生年龄:\n");rn scanf("%d",&z.age);rn printf("请输入学生健康状况:\n");rn scanf("%s",z.heth);rn printf("1.急诊 2.普通 请输入\n");rn scanf("%d",&b);rn switch(b)rn rn case 1:insert(&kb,z);break;rn case 2:insert(&kb2,z);break;rn break;rn case 2:printf("急诊");display(kb);rn printf("\n");rn printf("普通");display(kb2);rn break;rn case 3:if(empty(kb))rn dele(&kb2);rn elsern dele(&kb);rn break;rn case 4:exit(1);break;rn rn rnrn刚学数据结构,用队列做的一个医院看病的[,想加入一些病人的信息,但出现error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'inf' (or there is no acceptable conversion)rnError executing cl.exe.rn求大神帮我看看!!!!!
帮忙看看这是怎么回事
我打入 load query table db2admin.tablename 命令时出现了下面的错误rnSQL3508N 在装入或装入查询期间存取类型"MSGFILE"rn的文件或路径时出错 原因代码为"1" 路径为"C;\PROGRA~1\IBM\SQLLIB\DB2\tmp\db22480.msg"rn这是什么问题  怎么解决 rndb22480.msg 这个文件还会变
帮忙看看怎么回事啊
打开窗口,提示发生错误rn rnrnrn有关调用实时(JIT)调试而不是此对话框的详细信息,rn请参见此消息的结尾。rnrn************** 异常文本 **************rnSystem.InvalidOperationException: 创建窗体时出错。有关详细信息,请参阅 Exception.InnerException。错误为: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。 ---> System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。rn 在 System.Windows.Forms.UnsafeNativeMethods.IOleObject.DoVerb(Int32 iVerb, IntPtr lpmsg, IOleClientSite pActiveSite, Int32 lindex, IntPtr hwndParent, COMRECT lprcPosRect)rn 在 System.Windows.Forms.AxHost.DoVerb(Int32 verb)rn 在 System.Windows.Forms.AxHost.InPlaceActivate()rn 在 System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)rn 在 System.Windows.Forms.AxHost.CreateHandle()rn 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)rn 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)rn 在 System.Windows.Forms.AxHost.EndInit()rn 在 LBPlatform.FrmTccWatch.InitializeComponent()rn 在 LBPlatform.FrmTccWatch..ctor()rn --- 内部异常堆栈跟踪的结尾 ---rn 在 LBPlatform.My.MyProject.MyForms.Create__Instance__[T](T Instance)rn 在 LBPlatform.FrmMDI.OnParking_Click(Object sender, EventArgs e)rn 在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)rn 在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)rn 在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)rn 在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)rn 在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)rn 在 System.Windows.Forms.ToolStripItem.PerformClick()rn 在 LBPlatform.FrmMDI.tsFun_ItemClicked(Object sender, ToolStripItemClickedEventArgs e)rn 在 System.Windows.Forms.ToolStrip.OnItemClicked(ToolStripItemClickedEventArgs e)rn 在 System.Windows.Forms.ToolStrip.HandleItemClick(ToolStripItem dismissingItem)rn 在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)rn 在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)rn 在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)rn 在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)rn 在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)rn 在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)rn 在 System.Windows.Forms.Control.WndProc(Message& m)rn 在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)rn 在 System.Windows.Forms.ToolStrip.WndProc(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)rn 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)rn
代码怎么回事,帮忙看看
package com.yaya.action;rnrnimport java.util.ArrayList;rnimport java.util.List;rnrnimport org.apache.struts2.ServletActionContext;rnrnrnimport com.opensymphony.xwork2.ActionContext;rnimport com.opensymphony.xwork2.ActionSupport;rnimport com.yaya.dao.IUserDao;rnimport com.yaya.hib.Users;rnimport com.yaya.serv.IUserServ;rnimport com.yaya.util.DaoFactory;rnimport com.yaya.vo.RoleBean;rnimport com.yaya.vo.UserBean;rnrnrnpublic class UserAction extends ActionSupport rnrn private UserBean ub=new UserBean();rn private RoleBean r=new RoleBean();rn private IUserServ ser = DaoFactory.getUserServ();rn //private IUserDao dao=DaoFactory.getUserDao();rn private List roles = new ArrayList();rnrn public List getRoles() rn return roles;rn rnrn public void setRoles(List roles) rn this.roles = roles;rn rnrnrn public String login() throws Exception rn boolean bb = ser.checkuser(ub);rn if (bb) rn ActionContext.getContext().getSession().put("user",rn ub.getUsername());rn return this.SUCCESS;rn else rn this.addActionError("用户登陆失败!!");rn return this.INPUT;rn rn rnrn public String getrole() throws Exception rn roles = ser.getallrole(r);rn ServletActionContext.getRequest().setAttribute("role",roles);rn return this.SUCCESS;rn rn public String regist() throws Exception rn UserBean bb=ser.save(ub);rn ActionContext.getContext().getSession().put("user",bb.getUsername());rn return this.SUCCESS;rn rn rn rn rn public UserBean getUb() rn return ub;rn rnrn public void setUb(UserBean ub) rn this.ub = ub;rn rnrn public RoleBean getR() rn return r;rn rnrn public void setR(RoleBean r) rn this.r = r;rn rnrnrnrnrnrn页面调用rn<%@ page language="java" pageEncoding="UTF-8"%>rn<%@ taglib uri="/struts-tags" prefix="s"%>rnrnrnrnrn rnrn My JSP 'index.jsp' starting pagern rn rn rn rnrnrn rn rn rnrn rn rn rn rn rn rn rn rn rn 用户姓名:rn rn rn rn rn rn rn rn 用户密码:rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn 用户注册rn rn rn rn rn rn rn 欢迎你的到来!!!rn rn rn rn rn rn rn rn bnamern rn rn bcontentrn rn rn pricern rn rn pubdatern 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 首页rn rn 上一页rn rn rn 下一页rn rn rn 尾页rn rn rn rn rn 添加图书rn rn rn rn rn rnrnrn异常如下:rnorg.apache.jasper.JasperException: tag 'select', field 'list', name 'role': The requested list key 'roles' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.name - [unknown location]rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:541)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)rnrnrnroot cause rnrnrn
大家帮忙看看,怎么回事?
public static bool operator>(Card card1,Card card2)rn rn string[] suit=new string[]"黑桃","红桃","梅花","方块";rn string[] rank=new string[]"一","二","三","四","五","六","七","八","九","十","J","Q","K";rn int suit1,suit2,rank1,rank2;rn for(int i=0;i<4;i++)rn for(int j=0;j<13;j++)rn rn if (card1.suit.ToString()==suit[i] && card1.rank.ToString()==rank[j]) rn rn suit1=i;rn rank1=j;rn rn rn for(int i=0;i<4;i++)rn for (int j=0;j<13;j++)rn rn if (card2.suit.ToString()==suit[i] && card2.rank.ToString()==rank[j])rn rn suit2=i;rn rank2=j;rn rn rn if (rank1>rank2)rn return true;rn elsern rn if (rank1==rank2 && suit1>suit2)rn return true;rn else rn return false;rn rnrnrn rn为什么系统提示说我的suit1,suit2,rank1,rank2没有赋值呢,说我使用了未赋值的变量
帮忙看看怎么回事?
SQLSTATE = 23000rn[Sybase][ODBC Driver][Adaptive Server Anywhere]Integrity constraint violation: primary key for row in table 'emplyee_basic' is referenced in another tablern我第一次用外键,插入数据时到处是问题,谁帮忙讲讲外键
帮忙看看怎么回事
DLL导出一个函数 start(HWND hwnd),hwnd用于接收EXE传过去的窗口句柄,将其赋给一个共享数据区的变量hWnd,在钩子回调函数中用SendMessage(hWnd, WM_MY_NUMBER, wParam, lParam);向EXE发消息。下面是EXE中装载DLL的函数rnBOOL CDBFDlg::LoadDLL()rnrn typedef BOOL (CALLBACK *inshook)(HWND hwnd); rn inshook instkbhook;rn if(hinstDLL=LoadLibrary((LPCTSTR)"FenDLL.dll"))rn rn instkbhook=(inshook)GetProcAddress(hinstDLL, "start"); rn instkbhook(this->m_hWnd);rn return TRUE;rn rn elsern rn MessageBox("装载FenDLL.dll文件失败,将不能捕获收费系统上输入的电话! ","装载DLL失败",MB_OK|MB_ICONWARNING);rn return FALSE;rn rnrnrn它是EXE主对话框类的一个成员函数,在使用中没有什么问题,如果将其改为一个线程函数:rnUINT LoadDLL(LPVOID lp)rnrn CDBFDlg * dbf=(CDBFDlg *)lp;rn typedef BOOL (CALLBACK *inshook)(HWND hwnd); rn inshook instkbhook;rn if(hinstDLL=LoadLibrary((LPCTSTR)"FenDLL.dll"))rn rn instkbhook=(inshook)GetProcAddress(hinstDLL, "start"); rn instkbhook(dbf->m_hWnd);rn return TRUE;rn rn elsern rn MessageBox(dbf->m_hWnd,"装载FenDLL.dll文件失败,将不能捕获收费系统上输入的电话! ","装载DLL失败",MB_OK|MB_ICONWARNING);rn return FALSE;rn rnrnrn在CDBFDlg成员函数中用AfxBeginThread(LoadDLL,this)开启线程,在调试中我的EXE什么东西也收不到。两种方法的差异仅在于前都通过成员函数启动,后者通过线程启动。请高手帮忙解释一下怎么回事。
帮忙看看怎么回事,
SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also http://www.slf4j.org/codes.html#log4j_versionrnlog4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).rnlog4j:WARN Please initialize the log4j system properly.rnException in thread "main" org.hibernate.PropertyNotFoundException: Could not find a getter for Room_ID in class com.entity.roomrn at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:306)rn at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:299)rn at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:191)rn at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:67)rn at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:136)rn at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:456)rn at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:131)rn at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)rn at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:267)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)rn at com.test.ceshi.main(ceshi.java:18)rnrn
大家 帮忙看看怎么回事?
我编译了一个find.dll组件,代码如下:rnOption ExplicitrnPublic Declare Function FindWindow Lib "user32" rnAlias "FindWindowA" (ByVal lpClassName As String, ByVal rnlpWindowName As String) As LongrnrnPublic Function findwin() As LongrnDim Handle As Longrn Handle = FindWindow("XLMAIN", vbNullString)rn If Handle <> 0 Thenrn findwin = 1rn Elsern findwin = 0rn End IfrnEnd Functionrnrn注册成功后,在asp中怎么不管excel是否打开,结果都是0呢?(在vb中测试是不同的结果)rnasp代码:rndim Findwinrndim flagrnset Findwin=server.CreateObject("find.win")rnflag=Findwin.findwinrnif flag=1 thenrn response.write flagrnelsern response.write flagrnend if
大家帮忙看看怎么回事
public class hellornrnpublic static void main(String arg[])rnrnint i=9;rnSystem.out.print(i);rnrnrn得出结果就是显示9。rn可是换成下面rnpublic class hellornrnint i=9;rnpublic static void main(String arg[])rnrnSystem.out.print(i);rnrnrn就出错了。rnnon-static variable i cannot be referenced from a static contextrnSystem.out.print(i);rn ^rn1 errorrnrn我是个初学的,搞不懂为什么,谁能详细的解释一下。马上结分。rn
帮忙看看这是怎么回事,
我的一个对话框中有一个Edit对应的变量为m_strFile,我想点该对话框中的某按钮调用一个FileDialog,用CFileDialog的GetPathName来赋值m_strFile,程序如下:rnvoid CAlgorithmDlg::OnBrowse() rn rn char szFilter[]="Algorithm Files(*.dll)|*.dll|";rn CFileDialog m_FileDlg(TRUE,"dll","*.dll",OFN_HIDEREADONLY|OFN_FILEMUSTEXIST,szFilter,rn this);rn int ret=m_FileDlg.DoModal();rn if(ret==IDOK)rn rn m_strFile=m_FileDlg.GetPathName();rn rn UpdateData(FALSE);rn rnrn这样,功能实现了,可是调试时,会出现rnthis中的m_strFile: CXX0030:Error:expression cannot be evaluatedrn为什么呢,怎么解决,rn只有这么多分了,谢谢指导
帮忙看看代码怎么回事
话说为什么赋值就是无法成功呢,插入到数据库中的数据全是空数据。rn[img=https://img-bbs.csdn.net/upload/201606/16/1466066122_237677.png][/img]rn[img=https://img-bbs.csdn.net/upload/201606/16/1466066127_901863.png][/img]rn[img=https://img-bbs.csdn.net/upload/201606/16/1466066134_837339.png][/img]
诸位,帮忙看看怎么回事?
LIBCD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in LIBC.lib(malloc.obj)rnLIBCD.lib(dbgheap.obj) : error LNK2005: __nh_malloc already defined in LIBC.lib(malloc.obj)rnLIBCD.lib(dbgheap.obj) : error LNK2005: __heap_alloc already defined in LIBC.lib(malloc.obj)rnLIBCD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in LIBC.lib(calloc.obj)rnLIBCD.lib(dbgheap.obj) : error LNK2005: _realloc already defined in LIBC.lib(realloc.obj)rnLIBCD.lib(dbgheap.obj) : error LNK2005: _free already defined in LIBC.lib(free.obj)rnLIBCD.lib(dbgheap.obj) : error LNK2005: __msize already defined in LIBC.lib(msize.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: __get_sbh_threshold already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: __set_sbh_threshold already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_heap_init already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_find_block already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_free_block already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_alloc_block already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_alloc_new_region already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_alloc_new_group already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_resize_block already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_heapmin already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_heap_check already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(sbheap.obj) : error LNK2005: ___sbh_threshold already defined in LIBC.lib(sbheap.obj)rnLIBCD.lib(dbgheap.obj) : warning LNK4006: _malloc already defined in LIBC.lib(malloc.obj); second definition ignoredrnLIBCD.lib(dbgheap.obj) : warning LNK4006: __nh_malloc already defined in LIBC.lib(malloc.obj); second definition ignoredrnLIBCD.lib(dbgheap.obj) : warning LNK4006: __heap_alloc already defined in LIBC.lib(malloc.obj); second definition ignoredrnLIBCD.lib(dbgheap.obj) : warning LNK4006: _calloc already defined in LIBC.lib(calloc.obj); second definition ignoredrnLIBCD.lib(dbgheap.obj) : warning LNK4006: _realloc already defined in LIBC.lib(realloc.obj); second definition ignoredrnLIBCD.lib(dbgheap.obj) : warning LNK4006: _free already defined in LIBC.lib(free.obj); second definition ignoredrnLIBCD.lib(dbgheap.obj) : warning LNK4006: __msize already defined in LIBC.lib(msize.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: __get_sbh_threshold already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: __set_sbh_threshold already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_heap_init already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_find_block already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_free_block already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_alloc_block already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_alloc_new_region already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_alloc_new_group already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_resize_block already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_heapmin already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_heap_check already defined in LIBC.lib(sbheap.obj); second definition ignoredrnLIBCD.lib(sbheap.obj) : warning LNK4006: ___sbh_threshold already defined in LIBC.lib(sbheap.obj); second definition ignored
帮忙看看这是怎么回事?
public class BreakDemornrn public static void main(String[] args) throws Exceptionrn rn DataInputStream in=new DataInputStream(new BufferedInputStream(System.in));rn byte buffer[]=new byte[30];rn System.out.println("请输入数字:");rn System.in.read(buffer);rn String search=new String(buffer);rn System.out.println("String:"+search);//到这步都没错rn rn int num = Integer.parseInt(search);//这里就出错了,为什么?rn System.out.println("byte"+num);rn rn
帮忙看看这是怎么回事!
我自己机器上的sqlserver连不上了。下边是错误信息,各位帮忙看看。rnA connection could not be established to SERVER(我的机器名)-General network error.check your network documentation.rnChanged language setting to us_english.rnConnectionRead(Error SIO_KEEPALIVE_VALS())..
帮忙看看怎么回事?(在线)
DELETE FOR ;rn SUBSTR(BY,1,4) = '0311' .OR. BY = '0312' .OR. BY = '0313' .OR. BY = '031' .OR. ;rnBY = '03' .OR. BY = '012' .OR. BY = '013' .OR. BY = '022' .OR. BY = '023' .OR. ;rnBY = '031' .OR. BY = '033' .OR. BY = '032'rn1 在上面代码中,by='0312'是不是表示 by like '0312%' ?rn2 我在foxpro 命令窗口中执行此段代码,会删除若干条纪录。看起来象是把rn符合 by like 'xx..%'删除掉。但是我在程序中执行此段代码确没有按照上面的意思删除,而只是把部分 符合 by like 'xx..%'的纪录删掉,怎么回事??rn
帮忙看看这是怎么回事!!!
昨日小弟在写一查询语句按照combobox1.text里的内容查询,用到的组件是TAdoconnection,TAdodataSet,TDBGrid,TDataSource,等现在程序是这样的rnprocedure Tcurrency.FormCreate(Sender: TObject);rnbeginrn self.ComboBox1.Items.Add('投影仪');rn self.ComboBox1.Items.Add('显示器');rn self.ComboBox1.Items.Add('显卡');rn self.ComboBox1.Items.Add('硬盘');rn self.ComboBox1.Items.Add('CPU');rn self.ComboBox1.Items.Add('内存');rn self.ComboBox1.Items.Add('主板');rn self.ComboBox1.ItemIndex:=0;rnend;rnrnprocedure Tcurrency.Btn_QueryClick(Sender: TObject);rn varrn str: string ;rnbeginrn AdoDataSet1.Active:=false;rn if combobox1.Text=' 投影仪 'rn thenrnbeginrn str:='use 公司机器设备';rn str:= str + ' select * from 投影仪$ ' ;rn end;rn if combobox1.Text=' 显示器 'rn thenrnbeginrn str:= 'ues 公司机器设备';rn str:= str + ' select * from 显示器$ ';rn end;rn if combobox1.Text=' 显卡 'rn thenrnbeginrn str:= ' use 公司机器设备 ';rn str:= str + 'select * from 显卡$ ';rn end;rn if combobox1.Text = '硬盘'rn thenrnbeginrn str:= 'use 公司机器设备 ';rn str:= str + ' select *from 硬盘 ';rn end;rnend;rnrnend.rn但是就是查询不出来,怎么回事rn
怎么回事?请帮忙看看
using System.Runtime.InteropServices;rn[StructLayout(LayoutKind.Explicit)]rn class MyUnionrn //一下是自定义的rn [FieldOffset(0)]G00 g00;rn [FieldOffset(0)]G01 g01;rn [FieldOffset(0)]G02_G03 g02_g03;rn [FieldOffset(0)]G12 g12;rn [FieldOffset(0)]ellips g12_g13;rn [FieldOffset(0)]g16type g16;rn [FieldOffset(0)]G04 g04;rn [FieldOffset(0)]G31 g31;rn [FieldOffset(0)]G33 g33;rn [FieldOffset(0)]G87 g87;rn [FieldOffset(0)]G88 g88;rn [FieldOffset(0)]S s;rn rn系统报错:C:\Documents and Settings\gr\My Documents\Visual Studio Projects\GL2000_32bit\FunctionStruct.cs(764): 找不到类型或命名空间名称“FieldOffset”(是否缺少 using 指令或程序集引用?)rn请问这是为什么?
帮忙看看怎么回事??
今天我起动机器时,刚过去win98的开机界面,就出现蓝屏,上面显示VFAT Device intinational fated的字样,然后怎么也进不了系统了,而且重起也重起不了。快帮帮我啊,我那里头还有重要文件怎么办啊??//
很老很老的问题----老是出问题!!帮我看看!
服务器: 消息 8152,级别 16,状态 4,行 1rn将截断字符串或二进制数据。rn语句已终止。rnrnrn老是出-将截断字符串或二进制数据。 这个错误,请问那个高手能解决啊?rn帮我分析分析---rnrn谢谢了先!rnrnrnPOST的原因?数据库的字段太多了~...也不多啊,10多个(前提:字段设置的长度没有问题)
大虾帮忙看看这是怎么回事,指针作为参数出问题
/*怎么会是死循环rn#include rn#include rntypedef struct simple rn int a;rn struct simple *next;rn sim;rn//typedef struct simple sim;rn//添加一个节点的函数rnvoid addnode(sim **head2,int i)rnrn sim *temp;rnrn //getch();rn temp=(sim *)malloc(sizeof(sim));rn temp->a=i;rn temp->next=*head2;rnrn *head2=temp;rnrn rnvoid display(sim *head)rn sim *cur;rn cur=head;rnrn while(cur!=NULL)rn printf("in display ");rn printf("%d\n",cur->a);rn cur=(cur->next);rn rnrn rnint main()rn sim *head=NULL;rn int i=0;rn while (i<10)rn addnode(&head,i);rn //printf("%10d",i);rn i++;rn rn display(head);rn getch();rn printf("ok");rnrn rn
vs2005出问题了,高手帮忙看看
今天来打开vs2005,发现突然菜单变成好几项重复的,不知道有没有其他人碰到过相同的情况,请教高手如何解决?(不想重装)rn不知道该发到哪里,只好发到这里了[img=http://i3.6.cn/cvbnm/d4/37/d7/f6d3f832094a61519733363d184e8090.jpg][/img]
出问题了,请各位帮忙看看~!!!
我初学ASP.NET,现在在配环境,可怎么都是装不了呀,请教各位了~rn我的系统是WIN XP SP2,我下载了个ASP.NET的安装包,包括了ASP.NET的四个安装软件,我也按说明安装了,可就是不行,出现错误信息是:一个错误页面,提示"环境配置错误",请问是什么问题?要怎样安装才是绝对行的?rn谢谢了!
高手帮忙看看,哪里出问题了
俺刚刚做第一个JSP程序,照着书敲代码,是一个简单购物程序,开始先做javabean。第一个程序Item.java产品信息类,第二个程序Products.java是可得到的商品类。照着书敲都不对。大家帮忙看下哈,谢谢!!!rnrnrnrnpackage com.hrq.ch6;rnrnpublic class Item rn rn //属性rn private String itemId; //目录中这个产品的idrn private float price; //这个产品的价格rn private String description; //商品的名称或者描述rn private boolean available; //是否有货rn private String producer; //商品生产者rn rn //构造方法 rn public Item(String itemId, float price, String description, boolean available, String producer) rn this.itemId = itemId;rn this.price = price;rn this.description = description;rn this.available = available;rn this.producer = producer;rn rn rn //属性的setter和getter方法 rn public void setItemId(String aItemId) rn itemId = aItemId;rn rn rn public String getItemId()rn return itemId;rn rn rn public void setPrice(float aPrice) rn price = aPrice;rn rn rn public float getPrice()rn return price;rn rn rn public void setDescription(String aDescription) rn description = aDescription;rn rn rn public String getDescription()rn return description;rn rn rn public void setAvailable(boolean aAvailable) rn available = aAvailable;rn rn rn public boolean getAvailable()rn return available;rn rn rn public void setProducer(String aProducer) rn producer = aProducer;rn rn rn public String getProducer()rn return producer;rn rnrnrnrnrnrnrnrnrnrnrnrnpackage com.hrq.ch6;rnrnimport java.util.Vector;rnrnpublic class Products rn private Vector items = new Vector(); //表示商品的目录rn rn //同步方法取得Vector类的实例对象items(Vector类型)rn synchronized public Vector getItems() rn return items; //得到目录rn rn rn //同步方法取得Item类索引对照的那个实例对象items(Item类型),一个对象的五个特性都取得rn synchronized public Item getItem(String itemId) rn int index = Integer.parseInt(itemId);rn return(Item)items.elementAt(index);rn rn rn //同步方法设置Item类对象,制定了要设置的那个对象的索引,设置成itemrn synchronized public void setItem(Item item, String itemId) rn int index = Integer.parseInt(itemId);rn items.set(index, item); rn rn rn public Products() rn items.addElement(new Item("0", float(59), "jsp应用开发详解", true, "电子工业出版社"));rn items.addElement(new Item("1", float(45), "java Web 服务开发", true, "电子工业出版社"));rn items.addElement(new Item("2", float(99), "java编程思想", true, "机械工业出版社"));rn items.addElement(new Item("3", float(10), "JSP编程指南", true, "电子工业出版社"));rn items.addElement(new Item("4", float(68), "J2EE1.4应用开发详解", true, "电子工业出版社"));rn items.addElement(new Item("5", float(56), "J2EE企业级应用开发", true, "电子工业出版社"));rn items.addElement(new Item("6", float(56), "J2EE参考手册", true, "电子工业出版社"));rn items.addElement(new Item("7", float(55), "J2EE Web 服务开发", true, "电子工业出版社"));rn rn rn //商品的数量rn public int getSize() rn return items.size();rn rnrn rnrnrnrnrnrn就是构造函数有问题,大家帮忙看看怎么改哈!
相关热词 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天 c#字典序排序 c# 截屏取色 c#中的哪些属于托管机制