Setting up cURL my windows server.
1 - Copy libeay32.dll and ssleay32.dll to c:\windows\system32
2 - Edit your php.ini file. Set extension=php_curl.dll enabled.
3 - Restart the server.
12/14/2009
12/07/2009
Java application with xmpp protocol ...
This code allow you talk with other people under protocol xmpp instant messages ...
In this example i use de server "talk.google.com" ...
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package clientxmppapp;
/**
*
* @author Antonio Nobre
*/
import XMLParsing.XMLParsingMessage;
import java.util.*;
import java.io.*;
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.Roster;
import org.jivesoftware.smack.RosterEntry;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Message;
public class ClientXmppApp implements MessageListener{
XMPPConnection connection;
public void login(String userName, String password) throws XMPPException
{
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
connection = new XMPPConnection(config);
connection.connect();
connection.login(userName, password);
}
public void sendMessage(String message, String to) throws XMPPException
{
Chat chat = connection.getChatManager().createChat(to, this);
chat.sendMessage(message);
}
public void ListaEnderecoEmail()
{
Roster roster = connection.getRoster();
Collection entradas = roster.getEntries();
System.out.println("\n\n" + entradas.size() + " list of addresses associated to email");
for(RosterEntry r:entradas)
{
System.out.println(r.getUser());
}
}
public void disconnect()
{
connection.disconnect();
}
public void processMessage(Chat chat, Message message)
{
try{
XMLParsingMessage xmlMessage = new XMLParsingMessage();
System.out.println("Begin...");
if(message.getType() == Message.Type.chat){
System.out.println("messageString: "+message.getBody().substring(0, 5));
if(message.getBody().substring(0, 5).equals("
xmlMessage.message(message);
System.out.println(chat.getParticipant() + " Send: " + message.getBody());
//System.out.println("XML 2");
}
else{
System.out.println("Inválid MESSAGE !!! - " + message.getBody());
}
}
}finally{
//System.out.println("Message send with sucess ...");
}
}
public static void main(String args[]) throws XMPPException, IOException
{
ClientXmppApp c = new ClientXmppApp();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String msg;
//XMPPConnection.DEBUG_ENABLED = true;
System.out.println("Write your address email: ");
String enderecoEmail = br.readLine();
System.out.println("Write your password: ");
String passwordEmail = br.readLine();
System.out.println("Email: " + enderecoEmail + " Password " + passwordEmail);
c.login(enderecoEmail, passwordEmail);
c.ListaEnderecoEmail();
System.out.println("##########################################");
System.out.println("who you want talk? - Write email address and press 'Enter':");
String receptor = br.readLine();
System.out.println("##########################################");
System.out.println("Write your message and press 'Enter':");
System.out.println("###########################################\n");
while( !(msg=br.readLine()).equals("bye"))
{
c.sendMessage(msg, receptor);
}
c.disconnect();
System.exit(0);
}
}
In this example i use de server "talk.google.com" ...
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package clientxmppapp;
/**
*
* @author Antonio Nobre
*/
import XMLParsing.XMLParsingMessage;
import java.util.*;
import java.io.*;
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.Roster;
import org.jivesoftware.smack.RosterEntry;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Message;
public class ClientXmppApp implements MessageListener{
XMPPConnection connection;
public void login(String userName, String password) throws XMPPException
{
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
connection = new XMPPConnection(config);
connection.connect();
connection.login(userName, password);
}
public void sendMessage(String message, String to) throws XMPPException
{
Chat chat = connection.getChatManager().createChat(to, this);
chat.sendMessage(message);
}
public void ListaEnderecoEmail()
{
Roster roster = connection.getRoster();
Collection entradas = roster.getEntries();
System.out.println("\n\n" + entradas.size() + " list of addresses associated to email");
for(RosterEntry r:entradas)
{
System.out.println(r.getUser());
}
}
public void disconnect()
{
connection.disconnect();
}
public void processMessage(Chat chat, Message message)
{
try{
XMLParsingMessage xmlMessage = new XMLParsingMessage();
System.out.println("Begin...");
if(message.getType() == Message.Type.chat){
System.out.println("messageString: "+message.getBody().substring(0, 5));
if(message.getBody().substring(0, 5).equals("
xmlMessage.message(message);
System.out.println(chat.getParticipant() + " Send: " + message.getBody());
//System.out.println("XML 2");
}
else{
System.out.println("Inválid MESSAGE !!! - " + message.getBody());
}
}
}finally{
//System.out.println("Message send with sucess ...");
}
}
public static void main(String args[]) throws XMPPException, IOException
{
ClientXmppApp c = new ClientXmppApp();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String msg;
//XMPPConnection.DEBUG_ENABLED = true;
System.out.println("Write your address email: ");
String enderecoEmail = br.readLine();
System.out.println("Write your password: ");
String passwordEmail = br.readLine();
System.out.println("Email: " + enderecoEmail + " Password " + passwordEmail);
c.login(enderecoEmail, passwordEmail);
c.ListaEnderecoEmail();
System.out.println("##########################################");
System.out.println("who you want talk? - Write email address and press 'Enter':");
String receptor = br.readLine();
System.out.println("##########################################");
System.out.println("Write your message and press 'Enter':");
System.out.println("###########################################\n");
while( !(msg=br.readLine()).equals("bye"))
{
c.sendMessage(msg, receptor);
}
c.disconnect();
System.exit(0);
}
}
12/02/2009
10/16/2009
PPH(NuSoap): SOAP Error: HTTP Error: socket read of headers timed out
How i can change the colors of rows in one table ... (css)
First write in file .css the following code:
Transfer your domain for just $8.95 and get a year free!
.buttonRollover {
background-color: #CCFFFF;
border: 1px #000000 solid;
}
Affter this you can reference your table in Html file like that:
Example |
---|
line 1 |
line 2 |
Transfer your domain for just $8.95 and get a year free!
Subscrever:
Mensagens (Atom)