佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

12
返回列表 发新帖
楼主: 红发

JAVA ServerClient的问题,谢谢

[复制链接]
发表于 4-9-2006 01:07 AM | 显示全部楼层
原帖由 红发 于 1-9-2006 10:59 PM 发表
问一个问题。
例如我有3个java的file
content.java
Add.java

这两个file都可以分开来跑的。
如果我要content里面link with的add.java的话要如何呢??


if (userChoice == 1) {
     AddRecord;  < ...


不是很明白你在问什么
是要这个吗?
Add add=new Add();
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 9-9-2006 12:22 AM | 显示全部楼层
有个问题要问一下

是关于ServerClient的。


  1. public static void main (String args[]) throws IOException {
  2.   Input in;
  3.   Output out;
  4.   Socket socket;

  5.   try{
  6.     socket = new Socket("localhost", 10000);
  7.     in = new Input (socket.getInputStream());
  8.     out = new Output (socket.getOutputStream());
  9.   } ....

  10.   System.out.print ("Username: ");
  11.   Name = rs.readLine();
  12.   System.out.print ("Password: ");
  13.   Password = rs.readLine();

  14.   tmp = "Name Password"
复制代码

以上的是我的client side 的code
我的问题是如果我要把tmp这个value sent去我的server side那里要如何做呢??

///////////////////////////////////////////////////

  1. out = new Output (socket.getOutputStream(), true);
复制代码


还有就是如果我在out那里加一个 true的话会有error的哦

Client.java:16: cannot find symbol
symbol  : constructor Output(java.io.OutputStream,boolean)
location: class Output
                        out = new Output (socket.getOutputStream(),true);
                              ^
1 error
回复

使用道具 举报

 楼主| 发表于 9-9-2006 10:42 PM | 显示全部楼层
没有人知道吗???
回复

使用道具 举报

发表于 11-9-2006 08:49 AM | 显示全部楼层
原帖由 红发 于 9-9-2006 12:22 AM 发表
有个问题要问一下

是关于ServerClient的。


public static void main (String args[]) throws IOException {
  Input in;
  Output out;
  Socket socket;

  try{
    socket = new Socket("l ...


你的Output class 在那里啊?Post 上来让大家看看。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 23-9-2024 05:23 PM , Processed in 0.085639 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表