flash C# Socket
2009-09-01 17:33在.net中定义以下
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
namespace ClientSocket
{
public class AsynchronousSocketListener
{
//异步socket诊听
// Incoming data from client.从客户端传来的数据
public static string data = null;
// Thread signal.线程 用一个指示是否将初始状态设置为终止的布尔值初始化 ManualResetEvent 类的新实例。
public static ManualResetEvent allDone = new ManualResetEvent(false);
public AsynchronousSocketListener()
{
}
public static void StartListening()
{
// Data buffer for incoming data. 传入数据缓冲
byte[] bytes = new Byte[1024];
// Establish the local endpoint for the socket. 建立本地端口
// The DNS name of the computer
// running the listener is "host.contoso.com".
IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
IPAddress ipAddress = ipHostInfo.AddressList[0];
IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 11001);
// Create a TCP/IP socket.
Socket listener = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp );
// Bind the socket to the local endpoint and listen for incoming connections.绑定端口和数据
try
{
listener.Bind(localEndPoint);
listener.Listen(100);
while (true)
{
// Set the ev
相关文档:
public string NoExcuteHtml(string Htmlstring)
{
string x = string.Empty;
x = Htmlstring.Replace(@"&", "&");//将&设置为保留字
x ......
机器内部有一部分flash供客户使用,同时机器支持sd卡。当插入sd卡时候flash内部和sd卡内部的多媒体都可以被播放器识别,一旦拔掉sd卡,则flash内的媒体对播放器也不见了。
解决方法:
修改frameworks/base/services/java/com/android/server/MountService.java文件的函数:notifyMediaBadRemoval如下,红色为添加。
mCon ......
对于大部分Flash开发者,都已经知道Flash的帧频、Timer计时并不是十分精确的。如果您已经做过这方面测试,可以略过这篇文章的前面一部分,在后面有关于Flash Player可变跑道的文章链接,希望对您有帮助。这篇文章的主要目的是让一些不知道Flash计时不精确和知道但又没有做过测试的朋友,来分享我的测试结果。我使用的Flex开 ......
C#连接连接Access
首先看一个例子代码片断:
程序代码:
--------------------------------------------------------------------------------
using System.Data;
using System.Data.OleDb;
......
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;";
strConnection+=@"Data Source=C:\BegASPNET\Northwin ......
最近要改写一个核心加密认证类,从C#改写成Java。
发现在调试时,加密的数据无论如何也对不上。
经过跟踪,发现问题出在C#和Java byte类型的区别上:在C#里 byte类型是无符号的,而Java里是有符号的,所以C#里的129到Java里就成了负数。
发现了问题,解决就比较容易了,针对Java的byte,采用Int来进行存储。
通过如下代 ......