搞定了:
public class password
{
public static void main(String[] args)
{
String LcPassword = "12345";
try
{
byte temp[] = LcPassword.getBytes("gb2312");
for (int i=0;i<LcPassword.length() ;i++ )
{
temp[i] = (byte)(255 - (i+1) - (int)temp[i]);
}
//System.out.println(tempPassword);
LcPassword=new String(temp, 0, temp.length, "gb2312").trim();
}
catch (Exception Ue)
{
Ue.printStackTrace();
}
}
}
大家有没有更好的方法,都说说吧
public class password
{
public static void main(String[] args)
{
String LcPassword = "12345";
try
{
byte temp[] = LcPassword.getBytes("gb2312");
for (int i=0;i<LcPassword.length() ;i++ )
{
temp[i] = (byte)(255 - (i+1) - (int)temp[i]);
}
//System.out.println(tempPassword);
LcPassword=new String(temp, 0, temp.length, "gb2312").trim();
}
catch (Exception Ue)
{
Ue.printStackTrace();
}
}
}
大家有没有更好的方法,都说说吧
解决方案 »
- 最近正在使用潍坊中硕软件有限公司做的一个进销存系统,他们的技术人员说是用swing做的,大家看看这个界面swing能做出来吗,给点建议
- i = i++的问题
- java 代码统计小工具
- 为什么编译通不过呢?
- 新手问一个new treeset的问题
- JTabbedPane怎么应用!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 请问java里面怎么用socket传送文件?
- 一个关于字符串比较的问题。
- 请问高手~~~~谢谢来者!
- 大家好,google今天已经能用了,还是原来的网址www.google.com
- 写一个程序将HTML和JavaScript代码进行缩格
- 关于ant的问题
{
char temp[] = LcPassword.toCharArray() for (int i=0;i<LcPassword.length() ;i++ )
{
temp[i] = (char)(255-temp[i]);
}
//System.out.println(tempPassword);
LcPassword=new String(temp, 0, temp.length, "gb2312").trim();
}
catch (Exception Ue)
{
Ue.printStackTrace();
}
LcPassword=new String((byte)temp, 0, temp.length, "gb2312").trim();
我的那个方法更正:
temp[i] = (byte)(255 - (int)temp[i]);