这种编译方法对吗?如何将它做成可执行文件呢?
import com.sensestream.app.myalbum.util.FormUploader;
import com.sensestream.media.MIMEType;
import java.io.*;
public class Submit3PIExample {
static String targetURL = "http://www.test.com/doSend.jsp";
static String senderID = "13910008585";
//static String recipientID = "13900000379";
static String recipientID;
static String subject = "3PI Test";
//static String targetType = "nokia7650";
static String targetType;
static String smilName = "mms.smil";
static String gifName = "Beach.gif";
static byte[] smil = null;
static byte[] gif = null;
public static void main(String args[]) {
String tmp;
recipientID=args[0];
tmp=args[1];
if(tmp=="1")
{
targetType= "nokia7650";
}
if(tmp=="2")
{
targetType= "ericssont68i";
}
if(tmp=="3")
{
targetType= "nokia6610";
}
if(tmp=="4")
{
targetType= "panasonicgd88";
}
smil = readfile(smilName);
gif = readfile(gifName);
doUpload();
}
public static void doUpload() {
try {
FormUploader uploader = new FormUploader();
uploader.addFormParameter("senderID", senderID);
uploader.addFormParameter("recipientID", recipientID);
uploader.addFormParameter("subject", subject);
uploader.addFormParameter("targetType", targetType);
uploader.addBinaryContent(smil, "application/smil", smilName, "filename");
uploader.addBinaryContent(gif, "image/gif", gifName, "filename");
uploader.upload(targetURL);
}
catch (Exception e) {
e.printStackTrace();
}
}
public static byte[] readfile(String filename) {
byte[] byteArray = null;
try {
FileInputStream f = null;
f = new FileInputStream(filename);
int len = f.available();
byteArray = new byte[len];
f.read(byteArray);
f.close();
}
catch (Exception e) {
e.printStackTrace();
}
return(byteArray);
}
}
javac -classpath MIMEupload.jar Submit3PIExample.java
java -classpath .;./MIMEupload.jar Submit3PIExample 13910337379 1
main(String args[])中的参数传递对吗?如果不对应该怎么传?
import com.sensestream.media.MIMEType;
import java.io.*;
public class Submit3PIExample {
static String targetURL = "http://www.test.com/doSend.jsp";
static String senderID = "13910008585";
//static String recipientID = "13900000379";
static String recipientID;
static String subject = "3PI Test";
//static String targetType = "nokia7650";
static String targetType;
static String smilName = "mms.smil";
static String gifName = "Beach.gif";
static byte[] smil = null;
static byte[] gif = null;
public static void main(String args[]) {
String tmp;
recipientID=args[0];
tmp=args[1];
if(tmp=="1")
{
targetType= "nokia7650";
}
if(tmp=="2")
{
targetType= "ericssont68i";
}
if(tmp=="3")
{
targetType= "nokia6610";
}
if(tmp=="4")
{
targetType= "panasonicgd88";
}
smil = readfile(smilName);
gif = readfile(gifName);
doUpload();
}
public static void doUpload() {
try {
FormUploader uploader = new FormUploader();
uploader.addFormParameter("senderID", senderID);
uploader.addFormParameter("recipientID", recipientID);
uploader.addFormParameter("subject", subject);
uploader.addFormParameter("targetType", targetType);
uploader.addBinaryContent(smil, "application/smil", smilName, "filename");
uploader.addBinaryContent(gif, "image/gif", gifName, "filename");
uploader.upload(targetURL);
}
catch (Exception e) {
e.printStackTrace();
}
}
public static byte[] readfile(String filename) {
byte[] byteArray = null;
try {
FileInputStream f = null;
f = new FileInputStream(filename);
int len = f.available();
byteArray = new byte[len];
f.read(byteArray);
f.close();
}
catch (Exception e) {
e.printStackTrace();
}
return(byteArray);
}
}
javac -classpath MIMEupload.jar Submit3PIExample.java
java -classpath .;./MIMEupload.jar Submit3PIExample 13910337379 1
main(String args[])中的参数传递对吗?如果不对应该怎么传?
...全文
相关推荐
C、C++程序编译步骤以及如何生成可执行文件
C++程序编译步骤以及如何生成可执行文件,详细讲述了各种文件
Go-交叉编译-在window中编译linux 可执行文件
GO Window下编译Linux可执行文件 文章目录GO Window下编译Linux可执行文件1、Note2、交叉编译方法window 下编译 linuxlinux 下编译 window3、参考 Go-交叉编译-在window中编译linux 可执行文件 1、Note 在window使用 CMD 交叉编译 powershell: 无法使用set命令设置环境信息(无法生效) 使用powersh...
android JNI运行NDK编译成的可执行文件
android JNI运行NDK编译成的可执行文件。 具体信息参考博客http://blog.csdn.net/csdn49532/article/details/50698666
C#实现将记事本中的代码编译成可执行文件的方法
主要介绍了C#实现将记事本中的代码编译成可执行文件的方法,很实用的技巧,需要的朋友可以参考下
linux mp3解码源码 经编译通过 readme中有编译方法 有编译后的可执行文件
linux mp3解码源码 经编译通过 readme中有编译方法 有编译后的可执行文件


Java SE
