Netbeans BD

Fermé
cs_playm89 Messages postés 13 Date d'inscription samedi 29 novembre 2008 Statut Membre Dernière intervention 5 juin 2011 - 18 avril 2011 à 15:26
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 - 18 avril 2011 à 16:54
salut je suis en cours de réalisation mon projet fin d'étude sur "réalisation d'un serveur sms avec java j'utilise l'API SMSLIB voici ce code et pour l'envoi d'un sms a u numéro

import org.smslib.*;

class SendMessage
{
public static void main(String[] args)
{
// Define the CService object. The parameters show the Comm Port used,
// the Baudrate, the Manufacturer and Model strings. Manufacturer and
// Model strings define which of the available AT Handlers will be used.
CService srv = new CService("COM6", 110, "Sony Ericsson", "Z530i");

System.out.println();
System.out.println("SendMessage(): Send a message.");
System.out.println("  Using " + CService._name + " " + CService._version);
System.out.println();

try
{
// If the GSM device is PIN protected, enter the PIN here.
// PIN information will be used only when the GSM device reports
// that it needs a PIN in order to continue.
srv.setSimPin("");

// Some modems may require a SIM PIN 2 to unlock their full functionality.
// Like the Vodafone 3G/GPRS PCMCIA card.
// If you have such a modem, you should also define the SIM PIN 2.
srv.setSimPin2("0000");

// Normally, you would want to set the SMSC number to blank. GSM
// devices get the SMSC number information from their SIM card.
srv.setSmscNumber("");

//	If you would like to change the protocol to TEXT, do it here!
// srv.setProtocol(CService.Protocol.TEXT);

// OK, let connect and see what happens... Exceptions may be thrown
// here!
srv.connect();

// Lets get info about the GSM device...
System.out.println("Mobile Device Information: ");
System.out.println("	Manufacturer  : " + srv.getDeviceInfo().getManufacturer());
System.out.println("	Model         : " + srv.getDeviceInfo().getModel());
System.out.println("	Serial No     : " + srv.getDeviceInfo().getSerialNo());
System.out.println("	IMSI          : " + srv.getDeviceInfo().getImsi());
System.out.println("	S/W Version   : " + srv.getDeviceInfo().getSwVersion());
System.out.println("	Battery Level : " + srv.getDeviceInfo().getBatteryLevel() + "%");
System.out.println("	Signal Level  : " + srv.getDeviceInfo().getSignalLevel() + "%");

// Lets create a message for dispatch.
// A message needs the recipient's number and the text. Recipient's
// number should always be defined in international format.
COutgoingMessage msg = new COutgoingMessage("+243991372231", " Hello ! voici le test du logiciel que j'aie exécuté pour envoyer des sms. Be blessed. Bovy's.");

// Set the message encoding.
// We can use 7bit, 8bit and Unicode. 7bit should be enough for most
// cases. Unicode is necessary for Far-East countries.
msg.setMessageEncoding(CMessage.MessageEncoding.Enc7Bit);

// Do we require a Delivery Status Report?
msg.setStatusReport(true);

// We can also define the validity period.
// Validity period is always defined in hours.
// The following statement sets the validity period to 8 hours.
msg.setValidityPeriod(8);

// Do we require a flash SMS? A flash SMS appears immediately on
// recipient's phone.
// Sometimes its called a forced SMS. Its kind of rude, so be
// careful!
// Keep in mind that flash messages are not supported by all
// handsets.
// msg.setFlashSms(true);

// Some special applications are "listening" for messages on
// specific ports.
// The following statements set the Source and Destination port.
// They should always be used in pairs!!!
// Source and Destination ports are defined as 16bit ints in the
// message header.
// msg.setSourcePort(10000);
// msg.setDestinationPort(11000);

// Ok, finished with the message parameters, now send it!
// If we have many messages to send, we could also construct a
// LinkedList with many COutgoingMessage objects and pass it to
// srv.sendMessage().
srv.sendMessage(msg);

// Disconnect - Don't forget to disconnect!
srv.disconnect();
}
catch (Exception e)
{
e.printStackTrace();
}
System.exit(0);
}
}


maintenant mon problème je veux l'envoi d'un sms a un groupe enregistrer dans une base des données comment je peux faire ca aide moi svp c'est très urgent

1 réponse

cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
18 avril 2011 à 16:54
Salut,

Codes-Sources est un site communautaire où des bénévoles apportent de l'aide à ceux qui le demande. Nous demandons pas grand chose en retour : juste un peu de reconnaissance et de respect.
Venir poser une question sur le forum en disant que c'est urgent est un manque de respect : qu'est-ce que ca t'apporte de préciser que c'est urgent ? Tu crois qu'en disant cà tu seras prioritaire par rapport aux autres membres ? Tu crois qu'on va se dépêcher à te répondre parce que tu es dans l'urgence ?

Et bien non, bien au contraire ! Dire que c'est urgent ne nous donne vraiment pas envie d'aider. Nous avons tous nos tracas quotidiens, avec nos patrons qui nous disent qu'il leur faut telle fonctionnalité pour demain matin à 8 h (si ce n'est pour la veille). Alors je traque tout ceux qui demande de l'aide de façon urgente histoire de bien leur faire comprendre qu'on y gagne rien à aider les gens, alors le moins que tu peux espérer, c'est de trouver quelqu'un qui veuille bien t'aider, l'urgence elle n'est que pour toi, et surtout pas pour nous !

Sujet clos.
______________________________________

AVANT de poster votre message, veuillez lire, comprendre, et appliquer notre réglement
0
Rejoignez-nous