Create WAP Push SMS Messages (from C# to JAVA)
猪年无聊,改了一个代码,有点D版那个意思,把WAP PUSH的C#代码改到了JAVA
原来出处:
http://www.codeproject.com/cs/internet/wappush.asp
改过后的代码在下面,程序好像可以输出了WAPPUSH的结构化的东西,但是,没有在CMPP协议上测试通过。
共7个文件:
package com.wap.wbxml;
public class Runner {
/**
* @param args
*/
public static void main(String[] args) {
try
{
String recipient = ""; // mobile number to send the message to
String href = "http://wap.monternet.com"; // url of the content to be pushed
String text = "A WAP Push to 梦网 site"; // description of the content displayed to the user
PushMessage message = new PushMessage(href, text);
HexDecoder decoder = new HexDecoder();
// Console.WriteLine("SMS body");
System.out.println("SMS body");
// Console.WriteLine(body);
String body = new String(decoder.GetChars(message.GetSMSBytes()));
System.out.println(body);
body =byteToHexStr(message.GetSMSBytes());
System.out.println(body);
// this body is now ready to be sent, either via
// an SMS Web Service as shown below or
// via a mobile phone on a serial port.
// Making sure the message is flagged as containing
// a User Data Header
// A free evaluation account for this service can
// be set up at https://www.esendex.com/secure/registration/evaluation.aspx
// messenger.MessengerHeader header = new messenger.MessengerHeader();
// header.Username = ""; // username for the SMS account
// header.Password = ""; // password for the SMS account
// header.Account = ""; // account reference
//
// messenger.SendService service = new messenger.SendService();
// service.Messeng
相关文档:
Java关键字(keywords)
abstract default if private this
boolean do implements &nbs ......
到http://download.csdn.net/source/1781433下载jxl.jar文件
/*Title是保存出来的文件名,gbl_LastOpenPath用于记录上次打开的路径*/
public void ExportToExcel(JTable table, String Title){
File DefaultFile;
JFileChooser fc = new JFileChooser();
File file;
if(gbl_LastOpen ......
到http://download.csdn.net/source/1781441下载JLDAP.jar文件
验证代码段如下:
DirContext ctx = null;
String account = "aa"; //用户名
String password = "123"; //登录密码
String root = "dc=scut,dc=edu,dc=cn"; // root
Hashtable env = new Hashtable() ......
第一种DES加密算法
import java.security.Key;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
/**
*
* 使用DES加密与解密,可对byte[],String类型进行加密与解密 密文可使用 ......
定义在一个类内部的类叫内部类,包含内部类的类称为外部类。内部类可以声明public、protected、private等访问限制,可以声明为
abstract的供其他内部类或外部类继承与扩展,或者声明为static、final的,也可以实现特定的接口。static的内部类行为上象一 ......