㈠ 求像「與同時訪問此網站的人聊天」的浮動網頁內聊天窗口的源碼
以下代碼 應該可以調用只要你自己美工下
<!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt-->
<html>
<head>
<title>javaScript製作的聊天窗口代碼 - www.webdm.cn</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<style type="text/css" media="all" rel="stylesheet">
<!--
body {
text-align:left;
margin:0;
font:normal 12px Verdana, Arial;
background:#FFEEFF
}
form {
margin:0;
font:normal 12px Verdana, Arial;
}
table,input {
font:normal 12px Verdana, Arial;
}
a:link,a:visited{
text-decoration:none;
color:#333333;
}
a:hover{
text-decoration:none;
color:#FF6600
}
#main {
width:400px;
position:absolute;
left:600px;
top:100px;
background:#EFEFFF;
text-align:left;
filter:Alpha(opacity=90)
}
#ChatHead {
text-align:right;
padding:3px;
border:1px solid #003399;
background:#DCDCFF;
font-size:11px;
color:#3366FF;
cursor:move;
}
#ChatHead a:link,#ChatHead a:visited, {
font-size:14px;
font-weight:bold;
padding:0 3px
}
#ChatBody {
border:1px solid #003399;
border-top:none;
padding:2px;
}
#ChatContent {
height:200px;
padding:6px;
overflow-y:scroll;
word-break: break-all
}
#ChatBtn {
border-top:1px solid #003399;
padding:2px
}
-->
</style><script language="javascript" type="text/javascript">
<!--
function $(d){return document.getElementById(d);}
function gs(d){var t=$(d);if (t){return t.style;}else{return null;}}
function gs2(d,a){
if (d.currentStyle){
var curVal=d.currentStyle[a]
}else{
var curVal=document.defaultView.getComputedStyle(d, null)[a]
}
return curVal;
}
function ChatHidden(){gs("ChatBody").display = "none";}
function ChatShow(){gs("ChatBody").display = "";}
function ChatClose(){gs("main").display = "none";}
function ChatSend(obj){
var o = obj.ChatValue;
if (o.value.length>0){
$("ChatContent").innerHTML += "<strong>Akon說:</strong>"+o.value+"<br/>";
o.value='';
}
}
if (document.getElementById){
(
function(){
if (window.opera){ document.write("<input type='hidden' id='Q' value=' '>"); }
var n = 500;
var dragok = false;
var y,x,d,dy,dx;
function move(e)
{
if (!e) e = window.event;
if (dragok){
d.style.left = dx + e.clientX - x + "px";
d.style.top = dy + e.clientY - y + "px";
return false;
}
}
function down(e){
if (!e) e = window.event;
var temp = (typeof e.target != "undefined")?e.target:e.srcElement;
if (temp.tagName != "HTML"|"BODY" && temp.className != "dragclass"){
temp = (typeof temp.parentNode != "undefined")?temp.parentNode:temp.parentElement;
}
if('TR'==temp.tagName){
temp = (typeof temp.parentNode != "undefined")?temp.parentNode:temp.parentElement;
temp = (typeof temp.parentNode != "undefined")?temp.parentNode:temp.parentElement;
temp = (typeof temp.parentNode != "undefined")?temp.parentNode:temp.parentElement;
}
if (temp.className == "dragclass"){
if (window.opera){ document.getElementById("Q").focus(); }
dragok = true;
temp.style.zIndex = n++;
d = temp;
dx = parseInt(gs2(temp,"left"))|0;
dy = parseInt(gs2(temp,"top"))|0;
x = e.clientX;
y = e.clientY;
document.onmousemove = move;
return false;
}
}
function up(){
dragok = false;
document.onmousemove = null;
}
document.onmousedown = down;
document.onmouseup = up;
}
)();
}
-->
</script>
</head>
<body>
<div class="dragclass" id="main" style="LEFT: 588px; TOP: 298px">
<div id="ChatHead"><a onclick="ChatHidden();" href="#">-</a> <a onclick="ChatShow();" href="#">+</a> <a onclick="ChatClose();" href="http://www.webdm.cn">x</a> </div>
<div id="ChatBody">
<div id="ChatContent"></div>
<div id="ChatBtn">
<form action="" method="post" name="chat">
<textarea style="WIDTH: 350px" rows="3" name="ChatValue"></textarea> <input onclick="ChatSend(this.form);" type="button" name="Submit" value="Chat" />
</form>
</div>
</div>
</div>
</body>
</html>
㈡ 跪求JAVA群聊天代碼
3459067873有
㈢ 能不能找到即時在線聊天的網頁源代碼
可是搜索一下啊
㈣ JAVA區域網聊天系統源碼,簡單的聊天系統就夠了,界麵包括登錄界面、聊天界面,能群聊和私聊 有的請發我
親
給你發過去了哦
㈤ 求一個能私聊,群聊的Java小程序源代碼
聯系方式也不留
幾個類呢。
代碼都復制這里?
看到加我
7810554
㈥ 誰知道用JAVA去實現一個簡易的QQ群聊天功能,求源代碼。。。高價懸賞
客戶端:java Socket類
伺服器:java ServerSocket類
讀寫用:BufferedReader,PrintWriter
之後利用線程
思路是這樣的
㈦ 怎麼實現網頁版的在線聊天啊,用html寫,求源代碼
這純html是寫不出來的 要後台程序語言寫 你可以去網上下載一個 有很多
㈧ 求jsp web 聊天室源碼或者 jsp web即時通訊工具.能聊天.在網頁中.源碼. .
我現在就有一個這樣的東西。。
做的很簡單,其實是自己練習寫一個購物網站 裡面加的一個聊天室
㈨ 求JAVA webQQ在線聊天源碼
客戶端源代碼
import java.net.Socket;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class socketClient
{
private DataOutputStream output;
private DataInputStream input;
private String clientName;
public static void main(String[] args)
{
//在main函數中,啟動伺服器的socket
new socketClient().ConnectServer();
}
public void ConnectServer()
{
try
{
Socket socket = new Socket("127.0.0.1",10001);
clientName = socket.getInetAddress().toString();
input = new DataInputStream(socket.getInputStream());
output = new DataOutputStream(socket.getOutputStream());
new readServer().start();
new writeServer().start();
}
catch(Exception e) {System.out.println(e.toString());}
}
public class readServer extends Thread
{
private Socket client;
public void run()
{
String msg;
try
{
while(true)
{
msg = input.readUTF();
if(msg!=null)
System.out.println("收到消息:【"+clientName+"】 "+msg);
}
}
catch(Exception e) {System.out.println(e.toString());}
}
}
public class writeServer extends Thread
{
private Socket client;
public void run()
{
try
{
BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
String userInput;
while(true)
{
if(stdIn.ready())
{
userInput = stdIn.readLine();
if(userInput!="exit")
{
output.writeUTF(userInput);
System.out.println("已發送消息給【"+clientName+"】"+userInput);
}
}
}
}
catch(Exception e) {System.out.println(e.toString());}
}
}
}
伺服器源代碼
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class socketServer
{
ArrayList clientList = new ArrayList();
//private DataOutputStream output;
//private DataInputStream input;
//private String clientName;
//private Socket socket;
public static void main(String[] args)
{
//在main函數中,啟動伺服器的socket
new socketServer().OpenServer();
}
public void OpenServer()
{
try
{
ServerSocket server = new ServerSocket(10001);
Socket socket;
while((socket = server.accept())!=null)
{
clientList.add(socket);
//clientName = socket.getInetAddress().toString();
//output = new DataOutputStream(socket.getOutputStream());
//input = new DataInputStream(socket.getInputStream());
new readClient(socket).start();
new writeClient(socket).start();
}
}
catch(Exception e) {System.out.println(e.toString());}
}
public class readClient extends Thread
{
private Socket socket;
public readClient(Socket client)
{socket = client;}
public void run()
{
String msg;
try
{
String clientName = socket.getInetAddress().toString();
DataOutputStream output = new DataOutputStream(socket.getOutputStream());
DataInputStream input = new DataInputStream(socket.getInputStream());
while((msg = input.readUTF())!=null)
{
System.out.println("收到消息:【"+clientName+"】 "+msg);
}
}
catch(Exception e){System.out.println(e.toString());}
}
}
public class writeClient extends Thread
{
private Socket socket;
public writeClient(Socket client)
{socket = client;}
public void run()
{
try{
BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
String userInput;
String clientName = socket.getInetAddress().toString();
DataOutputStream output = new DataOutputStream(socket.getOutputStream());
DataInputStream input = new DataInputStream(socket.getInputStream());
while(true)
{
if(stdIn.ready())
{
userInput = stdIn.readLine();
if(userInput!="exit")
{
output.writeUTF(userInput);
System.out.println("已發送消息給【"+clientName+"】"+userInput);
}
}
}
}
catch(Exception e) {System.out.println(e.toString());}
}
}
}
㈩ 在線客服系統源碼
PowerTalkBox,現在我們公司就用這個,用ASP.NET實現的,源碼開放,方便第二次開放,支持單聊,多聊,群聊。你想看看效果可以去http://www.51aspx.com/CV/PowerTalkBox
這個我用的是QQ客服,鏈接到QQ的,像現在QQ那麼普及。。
源碼那裡是鏈接到自己站內的聊天室的,不用安插件什麼的,還提供表情和聊天記錄的保存