Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaÊó±êÍÏ·ÅÎļþ£¨Windows & LinuxÊÊÓã©

/*ͨ¹ýÊó±êÍÏ·ÅÎļþµ½Öƶ¨¿Ø¼þÖУ¬²¢ÅжÏÊÇ·ñΪÎļþ£¬Èç¹ûÊÇ£¬Ôòµ÷ÓÃÎļþ·¢ËÍ·½·¨ChatFrame.SendFile(finalpath);
*/
class TextDropTargetListener implements DropTargetListener
{
CODER Coder = new CODER();
CHAT_FRAME ChatFrame;
/**
Constructs a listener.
@param aTextArea the text area in which to display the
properties of the dropped object.
*/
public TextDropTargetListener(CHAT_FRAME CF)
{
ChatFrame = CF;
}
public void dragEnter(DropTargetDragEvent event)
{
/*
int a = event.getDropAction();
if ((a & DnDConstants.ACTION_COPY) != 0)
textArea.append("ACTION_COPY\n");
if ((a & DnDConstants.ACTION_MOVE) != 0)
textArea.append("ACTION_MOVE\n");
if ((a & DnDConstants.ACTION_LINK) != 0)
textArea.append("ACTION_LINK\n");
if (!isDragAcceptable(event))
{
event.rejectDrag();
return;
}
*/
}
public void dragExit(DropTargetEvent event)
{
}
public void dragOver(DropTargetDragEvent event)
{
}
public void dropActionChanged(DropTargetDragEvent event)
{
if (!isDragAcceptable(event))
{
event.rejectDrag();
return;
}
}
public void drop(DropTargetDropEvent event)
{
if(ChatFrame.gbl_isSendFileShow==false){
ChatFrame.gbl_isSendFileShow=true;
if (!isDropAcceptable(event))
{
event.rejectDrop();
return;
}
event.acceptDrop(DnDConstants.ACTION_COPY);
Transferable transferable = event.getTransferable();
DataFlavor[] flavors = transferable.getTransferDataFlavors();
String path = "";
String finalpath = "";
for (int i = 0; i < flavors.length; i++)
{
DataFlavor d = flavors[i];
//textArea.append("MIME type=" + d.getMimeType() + "\n");
try


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

Linux²Ù×÷ϵͳϵĶàÏ̱߳à³ÌÏêϸ½âÎö£¨3£©


3¡¢Ï̱߳êʶ
    º¯ÊýÔ­ÐÍ£º
   
#include <pthread.h>
pthread_t pthread_self(void);
pid_t getpid(void);
    getpid()ÓÃÀ´È¡µÃÄ¿Ç°½ø³ÌµÄ½ø³Ìʶ±ðÂë,º¯Êý˵Ã÷
    Àý³Ì8
    ³ÌÐòÄ¿µÄ£ºÊµÏÖÔÚн¨Á¢µÄÏß³ÌÖдòÓ¡¸ÃÏ̵߳ÄidºÍ½ø ......

linux pgrepÃüÁî

 
pgrep ÊÇͨ¹ý³ÌÐòµÄÃû×ÖÀ´²éѯ½ø³ÌµÄ¹¤¾ß£¬Ò»°ãÊÇÓÃÀ´ÅжϳÌÐòÊÇ·ñÕýÔÚÔËÐС£ÔÚ·þÎñÆ÷µÄÅäÖú͹ÜÀíÖУ¬Õâ¸ö¹¤¾ß³£±»Ó¦Ó㬼òµ¥Ã÷ÁË£»
Ó÷¨£º
#ps ²ÎÊýÑ¡Ïî   ³ÌÐòÃû
³£ÓòÎÊý
-l  Áгö³ÌÐòÃûºÍ½ø³ÌID£»
-o  ½ø³ÌÆðʼµÄID£»
-n  ½ø³ÌÖÕÖ¹µÄID£»
¾ÙÀý£º
[root@localhost ~]# pgrep ......

¡¾Linux¡¿LinuxΪÍø¿¨¾²Ì¬ÅäÖÃIPµØÖ·µÈ

linuxÖÐÓÃifconfigΪÍø¿¨ÅäÖÃIPµØÖ·µÈ£¬ÔÚϵͳÖØÆôºó¾ÍʧЧÁË¡£ÎªÁ˱£Ö¤ÅäÖÃÓÀ¾ÃÉúЧ£¬ÐèÒª²ÉÓÃÐÞ¸ÄÅäÖÃÎļþµÄ¾²Ì¬ÅäÖ÷½·¨£¬×ܽáÈçÏ£º
1. cd /etc/sysconfig/network-scripts¡£
2. vi ifcfg-eth0(Ò²¿ÉÄÜÊÇeth1£¬eth2£¬·Ö±ð¶ÔÓ¦²»Í¬µÄÍø¿¨)
3. ÅäÖÃÄÚÈÝÈçÏ£º
    DEVICE=eth0   //Íø¿¨É豸à ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ