javaSocket¿Í»§¶ËÓëC·þÎñ¶ËͨÐÅ
ת×Ô£ºhttp://hi.baidu.com/ssrt_hanbing/blog/item/62e3b934598eeb82a71e1238.html
ͨ¹ý¸ßµÍλת»»¡£
package com.commnt;
import java.net.*;
import java.io.*;
public class Client {
public String send(String address, int port, String str) {
OutputStream os = null;
DataInputStream is = null;
String look = "";
Socket socket = null;
try {
socket = new Socket(address, port);
os = socket.getOutputStream();
byte[] phone = new byte[str.length()];
phone = ByteUtil.StringtoBytes(phone, str);
os.write(phone);
os.flush();
is = new DataInputStream(socket.getInputStream());
byte[] phone1 = new byte[str.length()];
is.read(phone1);
String strBype = new String(phone1);
look = strBype.toString();
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
close(socket, is, os);
}
return look;
}
public void close(Socket socket, DataInputStream is, OutputStream os) {
if (os != null)
try {
os.close();
} catch (IOException e) {
e.printStackTrace();
}
if (is != null)
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
if (socket != null)
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public class ByteUtil
Ïà¹ØÎĵµ£º
#include<stdio.h>
#include<math.h>
float x1,x2,disc,p,q;
int main()
{
void greater_than_zero(float,float);
void equal_to_zero(float,float);
void smaller_than_zero(float,float);
float a,b,c;
printf("\ninput a,b,c:");
scanf("%f,%f,%f",&a,&b,&c) ......
Êä³öì³²¨ÄÇÆõÊýÁÐǰN¸öºÏÊý£¬ËĸöÒ»ÐУ¬NÓÉʹÓÃÕßÊäÈ룬½éÓÚ10µ½30Ö®¼ä¡£
#include<stdio.h>
#include<math.h>
int fab(int);
int judge(int);
int main()
{
int a[30]={0};
int i,n,t=0;
do
{
printf("Input the number\n");
scanf("%d",&n);
}
while(n>3 ......
µÚ¶þÕ Êý¾ÝÀàÐÍ
Ò»¡¢Êý¾ÝÀàÐÍ·ÖÀà
1 ÁªºÏÀàÐÍ
2 º¯ÊýÀàÐÍ
3 ÊýÁ¿ÀàÐÍ
3.1ËãÊõÀàÐÍ
¢Ù »ù±¾Êý¾ÝÀàÐÍ
ÕûÐÍ£¨°üÀ¨char£©
¸¡µãÐÍ ......
ת×Ô£ºhttp://dev.yesky.com/12/3067012.shtml
¶¯Ì¬Á¬½Ó¿âµÄ´´½¨²½Ö裺
¡¡¡¡Ò»¡¢´´½¨Non-MFC DLL¶¯Ì¬Á´½Ó¿â
¡¡¡¡1¡¢´ò¿ªFile —> New —> ProjectÑ¡ÏѡÔñWin32 Dynamic-Link Library —>sample project
¡¡¡¡—>¹¤³ÌÃû£ºDllDemo
¡¡¡¡2¡¢Ð½¨Ò»¸ö.hÎļþDllDemo.h
ÒÔÏÂÊÇÒýÓÃÆ¬¶Î£º
......
µÚ¶þÕ Õ÷·þ¿É²âÐÔÄÑÌâ
2.1 ¿É²âÐÔÎÊÌâÏê½â£¨1£©
µ¥Ôª²âÊÔÐ§ÒæÌØ±ð¸ß£¬·½·¨Ò²ºÜ¼òµ¥£¬µ«È´³¢ÊÔµÄÆóÒµºÜ¶à£¬³É¹¦ÊµÊ©µÄÆóÒµºÜÉÙ£¬ÎªÊ²Ã´ÄØ£¿Ö÷ÒªÔÒò¾ÍÊÇÄÑÓÚÍ»ÆÆ¿É²âÐÔÎÊÌâ¡£“¿É²â”Õâ¸ö´Ê£¬Òâ˼ÒѾºÜÃ÷°×ÁË£¬Èç¹û²»“¿É²â”µÄ»°£¬ÄǾÍÊDz»Äܲ⣬û·¨²â£¬¾ÍÊÇ× ......