服务器如何接收数据
1. 服务器如何接收上传的文件
有两种方法上传程序到服务器。
如果是win系统服务器,那么打开远程桌面,从本地电脑复制文件,到远程桌面服务器里面,粘贴文件,就可以了。
如果有ip地址,ftp账号密码,也可以用 ftp软件上传。
linux服务器的话, 就是直接用ftp软件上传文件了。

2. java 服务器怎样给客户端传输数据
java需要利用scoket实现网络通信,在通信时可以利用是从客厅、获取输入输出流达到传输数据效果
3. 前端JS上传的数据,服务器怎么接收
如果已经是base64的字符串直接用post方式将字符串传给后台即可。
4. ajax请求发数据后,服务器端php如何接收
ajax也有多种提交数据方式的,也是有get和post等,和表单数据一样接收
5. php如何接收别的服务器post过来的数据 - 技术问答
通常情况下用户使用浏览器网页表单向服务器post提交数据,我们使用PHP的$_POST接收用户POST到服务器的数据,并进行适当的处理。但有些情况下,如用户使用客户端软件向服务端php程序发送post数据,而不能用$_POST来识别,那又该如何处理呢?
我们介绍php接受post数据的三种方式:
1.$_POST方式接收数据
$_POST方式是通过 HTTP POST 方法传递的变量组成的数组,是自动全局变量。如使用$_POST[‘name’]就可以接收到网页表单以及网页异步方式post过来的数据, 
即$_POST只能接收文档类型为Content-Type: application/x-www-form-urlencoded提交的数据,也就是表单POST过来的数据。
2.$GLOBALS[‘HTTP_RAW_POST_DATA’]方式接收数据
但$GLOBALS[‘HTTP_RAW_POST_DATA’]中是否保存POST过来的数据取决于centent-Type的设置,只有在PHP在无法识别的Content-Type的情况下,才会将POST过来的数据原样地填入变量$GLOBALS[‘HTTP_RAW_POST_DATA’]中,像Content-Type=application/x-www-form-urlencoded时,该变量是空的。 
另外,它同样无法读取Content-Type为multipart/form-data的POST数据,也需要设置php.ini中的always_populate_raw_post_data值为On,PHP才会总把POST数据填入变量$http_raw_post_data。
3.php://input方式接收数据
如果访问原始 POST 数据的更好方法是 php://input。php://input 允许读取 POST 的原始数据。和 $HTTP_RAW_POST_DATA 比起来,它给内存带来的压力较小,并且不需要任何特殊的php.ini设置,php://input不能用于 enctype=”multipart/form-data”。对于未指定 Content-Type 的POST数据,则可以使用file_get_contents(“php://input”)来获取原始数据。事实上,用PHP接收POST的任何数据都可以使用本方法。而不用考虑Content-Type,包括二进制文件流也可以。php://input读取不到$_GET数据。是因为$
6. 在服务器端如何正确接收提交数据请编写代码。
你用过serlvet吗?post和get方式的最大区别就是post在地址栏是没有参数传递的,就是看不到参数的传递,而get就是在地址栏可以看到参数的传递。你这样写不对啊,如果需要表单提交的话可以action里面输入post就默认的是post方式了你要接受post的参数的话用request.getParameter("参数")来接受
7. 服务器如何接收GPS定位器发送过来的数据
架设服务器平台,很简单;这里介绍一个 GPSBD卫星定位监控系统Simple版本的定位系统
他们系统是JAVA开发,首先服务器需要搭建JAVA环境,Mysql数据库,以及Reids缓存服务;
然后启动程序文件,一步一步操作即可;经过测试系统基本上市面上的各类GPS北斗定位设备都是支持的
在自己服务器搭建好GPS平台以后,就可以将设备的IP 端口配置到自己服务器对应的IP端口上,这样设备数据就会发往服务器,然后通过这套GPS定位系统就可以查看位置了

8. 服务器返回的数据,该怎么接收
第一个问题:先搞清ajax的底层通信形式,ajax发出请求后等待回复,也就是监听某个信息端口,服务器接到请求后,发送结果,也就是向某个端口写信息,所以,不管在形式上编程上有什么不同,都是向这个ajax所在地的信息端口输出信息。
9. GPRS服务器数据接收,该怎么处理
GPRS接收数据本质上就是socket通信, 和一般的网络编程没有区别.短信就是AT指令了.
服务器应该设置一个监听端口,在SIM300处设置端口连接,待GPRS模块连通后就可以收发数据了;而后对于接收的数据进行判定是否收发完毕,GPRS无线分组业务如其名,分组发送,采用TCP和UDP在判断是否接受完成是不一样的;而后存数数据库,一般ACCESS就够用了。
10. socket编程服务器端接收数据
//服务端: 
using System.Net; 
using System.Net.Sockets; 
using System.Text; 
using System.Threading; 
Thread mythread ; 
Socket socket;
// 清理所有正在使用的资源。 
protected override void Dispose( bool disposing ) 
{ 
try 
{  
socket.Close();//释放资源 
mythread.Abort ( ) ;//中止线程 
} 
catch{ } 
if( disposing ) 
{ 
if (components != null)
{ 
components.Dispose(); 
} 
} 
base.Dispose( disposing ); 
}
public static IPAddress GetServerIP() 
{ 
IPHostEntry ieh=Dns.GetHostByName(Dns.GetHostName()); 
return ieh.AddressList[0]; 
}
private void BeginListen() 
{ 
IPAddress ServerIp=GetServerIP(); 
IPEndPoint iep=new IPEndPoint(ServerIp,8000); 
socket=new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp); 
byte[] byteMessage=new byte[100]; 
this.label1.Text=iep.ToString(); 
socket.Bind(iep); 
// do 
while(true) 
{ 
try 
{ 
socket.Listen(5); 
Socket newSocket=socket.Accept(); 
newSocket.Receive(byteMessage); 
string sTime = DateTime.Now.ToShortTimeString ( ) ; 
string msg=sTime+":"+"Message from:"; 
msg+=newSocket.RemoteEndPoint.ToString()+Encoding.Default.GetString(byteMessage); 
this.listBox1.Items.Add(msg); 
} 
catch(SocketException ex) 
{ 
this.label1.Text+=ex.ToString(); 
} 
} // while(byteMessage!=null); 
}
//开始监听 
private void button1_Click(object sender, System.EventArgs e) 
{ 
try 
{ 
mythread = new Thread(new ThreadStart(BeginListen)); 
mythread.Start(); 
} 
catch(System.Exception er) 
{ 
MessageBox.Show(er.Message,"完成",MessageBoxButtons.OK,MessageBoxIcon.Stop); 
} 
}
//客户端: 
using System.Net; 
using System.Net.Sockets; 
using System.Text;
private void button1_Click(object sender, System.EventArgs e) 
{ 
BeginSend(); 
}
private void BeginSend() 
{ 
string ip=this.txtip.Text; 
string port=this.txtport.Text; 
IPAddress serverIp=IPAddress.Parse(ip); 
int serverPort=Convert.ToInt32(port); 
IPEndPoint iep=new IPEndPoint(serverIp,serverPort); 
byte[] byteMessage; 
Socket socket=new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp); 
socket.Connect(iep); 
byteMessage=Encoding.ASCII.GetBytes(textBox1.Text); 
socket.Send(byteMessage); 
socket.Shutdown(SocketShutdown.Both); 
socket.Close(); 
} 
//基于TCP协议的发送和接收端 
//TCP协议的接收端 
using System.Net.Sockets ; //使用到TcpListen类 
using System.Threading ; //使用到线程 
using System.IO ; //使用到StreamReader类 
int port = 8000; //定义侦听端口号 
private Thread thThreadRead; //创建线程,用以侦听端口号,接收信息 
private TcpListener tlTcpListen; //侦听端口号 
private bool blistener = true; //设定标示位,判断侦听状态 
private NetworkStream nsStream; //创建接收的基本数据流 
private StreamReader srRead; 
private System.Windows.Forms.StatusBar statusBar1; 
private System.Windows.Forms.Button button1; 
private System.Windows.Forms.ListBox listBox1; //从网络基础数据流中读取数据 
private TcpClient tcClient ;
private void Listen ( ) 
{ 
try 
{ 
tlTcpListen = new TcpListener ( port ) ; //以8000端口号来初始化TcpListener实例 
tlTcpListen.Start ( ) ; //开始监听 
statusBar1.Text = "正在监听" ; 
tcClient = tlTcpListen.AcceptTcpClient ( ) ; //通过TCP连接请求 
nsStream = tcClient.GetStream ( ) ; //获取用以发送、接收数据的网络基础数据流 
srRead=new StreamReader(nsStream);//以得到的网络基础数据流来初始化StreamReader实例 
statusBar1.Text = "已经连接!"; 
while( blistener ) //循环侦听 
{ 
string sMessage = srRead.ReadLine();//从网络基础数据流中读取一行数据 
if ( sMessage == "STOP" ) //判断是否为断开TCP连接控制码 
{ 
tlTcpListen.Stop(); //关闭侦听 
nsStream.Close(); //释放资源 
srRead.Close(); 
statusBar1.Text = "连接已经关闭!" ; 
thThreadRead.Abort(); //中止线程 
return; 
} 
string sTime = DateTime.Now.ToShortTimeString ( ) ; //获取接收数据时的时间 
listBox1.Items.Add ( sTime + " " + sMessage ) ; 
} 
} 
catch ( System.Security.SecurityException ) 
{ 
MessageBox.Show ( "侦听失败!" , "错误" ) ; 
} 
}
//开始监听 
private void button1_Click(object sender, System.EventArgs e) 
{ 
thThreadRead = new Thread ( new ThreadStart ( Listen ) ); 
thThreadRead.Start();//启动线程 
button1.Enabled=false; 
}
// 清理所有正在使用的资源。 
protected override void Dispose( bool disposing ) 
{ 
try 
{ 
tlTcpListen.Stop(); //关闭侦听 
nsStream.Close(); 
srRead.Close();//释放资源 
thThreadRead.Abort();//中止线程 
} 
catch{} 
if( disposing ) 
{ 
if (components != null) 
{ 
components.Dispose(); 
} 
} 
base.Dispose( disposing ); 
}
//TCP协议的发送端 
using System.Net.Sockets; //使用到TcpListen类 
using System.Threading; //使用到线程 
using System.IO; //使用到StreamWriter类 
using System.Net; //使用IPAddress类、IPHostEntry类等 
private StreamWriter swWriter; //用以向网络基础数据流传送数据 
private NetworkStream nsStream; //创建发送数据的网络基础数据流 
private TcpClient tcpClient; 
private System.Windows.Forms.Button button1; 
private System.Windows.Forms.TextBox textBox1; 
private System.Windows.Forms.Button button2; 
private System.Windows.Forms.TextBox textBox2; 
private System.Windows.Forms.StatusBar statusBar1; 
private System.Windows.Forms.Label label1; 
private System.Windows.Forms.Label label2; //通过它实现向远程主机提出TCP连接申请 
private bool tcpConnect = false; //定义标识符,用以表示TCP连接是否建立 
//连接 
private void button1_Click(object sender, System.EventArgs e) 
{ 
IPAddress ipRemote ; 
try 
{ 
ipRemote = IPAddress.Parse ( textBox1.Text ) ; 
} 
catch //判断给定的IP地址的合法性 
{ 
MessageBox.Show ( "输入的IP地址不合法!" , "错误提示!" ) ; 
return ; 
} 
IPHostEntry ipHost ; 
try 
{ 
ipHost = Dns.Resolve ( textBox1.Text ) ; 
} 
catch //判断IP地址对应主机是否在线 
{ 
MessageBox.Show ("远程主机不在线!" , "错误提示!" ) ; 
return ; 
} 
string sHostName = ipHost.HostName ; 
try 
{ 
TcpClient tcpClient = new TcpClient(sHostName,8000);//对远程主机的8000端口提出TCP连接申请 
nsStream = tcpClient.GetStream();//通过申请,并获取传送数据的网络基础数据流 
swWriter = new StreamWriter(nsStream);//使用获取的网络基础数据流来初始化StreamWriter实例 
button1.Enabled = false ; 
button2.Enabled = true ; 
tcpConnect = true ; 
statusBar1.Text = "已经连接!" ; 
} 
catch 
{ 
MessageBox.Show ( "无法和远程主机8000端口建立连接!" , "错误提示!" ) ; 
return ; 
} 
} 
//发送 
private void button2_Click(object sender, System.EventArgs e) 
{ 
if (textBox2.Text !="") 
{ 
swWriter.WriteLine(textBox2.Text);//刷新当前数据流中的数据 
swWriter.Flush(); 
}
else 
{ 
MessageBox.Show("发送信息不能为空!","错误提示!"); 
} 
}
// 清理所有正在使用的资源。 
protected override void Dispose( bool disposing ) 
{ 
if ( tcpConnect ) 
{ 
swWriter.WriteLine ( "STOP" ) ; //发送控制码 
swWriter.Flush (); //刷新当前数据流中的数据 
nsStream.Close (); //清除资源 
swWriter.Close (); 
} 
if( disposing ) 
{ 
if (components != null) 
{ 
components.Dispose(); 
} 
} 
base.Dispose( disposing );
