简易代码之家

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  157 Posts :: 2 Stories :: 57 Comments :: 0 Trackbacks

#

    早上刚来,维护部的同事就急匆匆过来说系统出现问题,昨天加班也没解决,情况比较紧急。打开系统,操作是上传图片,系统提示:该 URL“Images/F_300.jpg”无效,它可能指向不存在的文件或文件夹,或者是指向不在当前网站中的有效文件或文件夹。检查了源程序没有问题,上周还能正常运行,怎么就报错了呢,经过仔细分析,原来是该系统的数据库服务器空间已用完,悲催的问题根源。
posted @ 2012-09-20 11:19 Jakin.zhou 阅读(369) | 评论 (0)编辑 收藏

一.验收前的准备工作
    (1)配置现场演示的运行环境,测试系统运行的稳定性,添加适量的演示数据。确保在系统演示过程中不出问题,获得良好的系统演示印象。
    (2)编写项目汇报PPT,要求内容精简,界面大气。
    (3)检查验收报告中的交付文件是否齐全,文档内容和格式等是否规范,必须保证文档的质量。
二.验收过程中的注意事项
    (1)现场提交的文件保证是齐全的,并且一定要附有文件清单。避免在验收委员面前摆放一堆资料,没有顺序,也没有说明。
    (2)现场提交的需求文件必须包括原始需求,新版的需求和需求变更确认文件。
    (3)注意屏幕上字体的大小能否使后排人员看的清楚,解说时声音的大小能否保证在场所有人听的清楚。
    (4)结合需求和设计来介绍系统,始终围绕需求来开展,避免直接介绍系统功能,委员有疑问时再解释出自需求之类的,此时已比较被动。
    (5)不要针对一个问题进行反复解释,更不要和验收委员争论。
三.一些验收感触
    文档很重要,文档是项目的初印象,验收委员首次接触项目可能就是看摆在面前的这些文档,所以必须保证文档的规范性。做惯了甲方的验收委员们阅历比较丰富,眼光也比较挑剔,如果第一印象不好的话后面很难打开局面。
    在回答比较难缠的验收委员的质询时,声音要洪亮,对于自己很清楚的问题语气要坚决,心理上压倒对方,很可能他就不会再接着提问下一个问题。
    一个优秀的项目经理必须精通业务,深度具备某行业业务背景,这样需求调研与分析才能做的更加细化,系统设计才会做的更加深化,做出来的系统或是产品才能获得更多的认可。
posted @ 2012-09-20 11:17 Jakin.zhou 阅读(412) | 评论 (0)编辑 收藏

四个功能区:
第一个功能区包含首页,上一页,下一页,尾页。
第二个功能区显示总页数,当前页数,并可以输入页码跳转其他页。
第三个功能区可以选择每页显示多少条记录。
第四个功能区显示数据的总条数,当前页显示的数据范围。
如下图:
posted @ 2012-09-20 10:53 Jakin.zhou 阅读(170) | 评论 (0)编辑 收藏

    报表中按类别统计发现相同类别有两条记录,怀疑这个类别字段在表中有部分数据可能有空格,SQL语句查询时会将前后带有空格的数据也查询出来。经验证,确实存在空格问题。考虑到要修改的数据量大,又是正式服务器,新的类别代码已经不存在空格,只需处理旧数据,最后在视图中用SQL语法Replace去掉空格解决问题。
posted @ 2012-09-20 10:28 Jakin.zhou 阅读(136) | 评论 (0)编辑 收藏

    添加系统服务命令:xxxsvc.exe -install -name myserver。
    删除系统服务命令:xxxsvc.exe -uninstall myserver。
posted @ 2012-09-20 10:23 Jakin.zhou 阅读(135) | 评论 (0)编辑 收藏

    在ntext类型字段中会有些HTML标记,比如<div>/<br>/<font>等,当我们做统计查询时,这些内容会影响显示效果,下面编写的一个SQL函数可以去除这么标记。
USE [COMMON]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[fun_RemoveHtml]
(
    @input    VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
    declare
    @Result varchar(8000),
    @start int,
    @end int,
    @len int
    set @input = @input+'<>'
    set @Result = ''
    set @len=len(@input)
    set @start = charindex('<',@input,1)
    set @end = charindex('>',@input,@start)
    while(@start<@end)
        begin       
            if(@start<>1)
            set @Result = @Result + substring(@input,1,@start-1)
            set @len = @len - @end
            set @input = substring(@input,@end+1,@len)
            set @start = charindex('<',@input,1)
            set @end = charindex('>',@input,@start)
        end
    RETURN replace(@Result,'&nbsp;','')   
END
posted @ 2012-09-20 10:00 Jakin.zhou 阅读(2347) | 评论 (1)编辑 收藏

函数名称fun_GetPinyin,内容为:

IF OBJECT_ID('[fun_GetPinyin]') IS NOT NULL
 DROP FUNCTION [fun_GetPinyin]  
GO 
create function [dbo].[fun_GetPinyin](@words nvarchar(2000)) 
returns varchar(8000) 
as
begin
declare @word nchar(1) 
declare @pinyin varchar(8000) 
declare @i int
declare @words_len int
declare @unicode int
set @i = 1 
set @words = ltrim(rtrim(@words)) 
set @words_len = len(@words) 
while (@i <= @words_len) --循环取字符 
begin
set @word = substring(@words, @i, 1) 
set @unicode = unicode(@word) 
set @pinyin = ISNULL(@pinyin +SPACE(1),'')+  
(case when unicode(@word) between 19968 and 19968+20901 then 
(select top 1 py from ( 
select 'a' as py,N'厑' as word 
union all select 'ai',N'靉'
union all select 'an',N'黯'
union all select 'ang',N'醠'
union all select 'ao',N'驁'
union all select 'ba',N'欛'
union all select 'bai',N'瓸' --韛兡瓸 
union all select 'ban',N'瓣'
union all select 'bang',N'鎊'
union all select 'bao',N'鑤'
union all select 'bei',N'鐾'
union all select 'ben',N'輽'
union all select 'beng',N'鏰'
union all select 'bi',N'鼊'
union all select 'bian',N'變'
union all select 'biao',N'鰾'
union all select 'bie',N'彆'
union all select 'bin',N'鬢'
union all select 'bing',N'靐'
union all select 'bo',N'蔔'
union all select 'bu',N'簿'
union all select 'ca',N'囃'
union all select 'cai',N'乲' --縩乲 
union all select 'can',N'爘'
union all select 'cang',N'賶'
union all select 'cao',N'鼜'
union all select 'ce',N'簎'
union all select 'cen',N'笒'
union all select 'ceng',N'乽' --硛硳岾猠乽 
union all select 'cha',N'詫'
union all select 'chai',N'囆'
union all select 'chan',N'顫'
union all select 'chang',N'韔'
union all select 'chao',N'觘'
union all select 'che',N'爡'
union all select 'chen',N'讖'
union all select 'cheng',N'秤'
union all select 'chi',N'鷘'
union all select 'chong',N'銃'
union all select 'chou',N'殠'
union all select 'chu',N'矗'
union all select 'chuai',N'踹'
union all select 'chuan',N'鶨'
union all select 'chuang',N'愴'
union all select 'chui',N'顀'
union all select 'chun',N'蠢'
union all select 'chuo',N'縒'
union all select 'ci',N'嗭' --賜嗭 
union all select 'cong',N'謥'
union all select 'cou',N'輳'
union all select 'cu',N'顣'
union all select 'cuan',N'爨'
union all select 'cui',N'臎'
union all select 'cun',N'籿'
union all select 'cuo',N'錯'
union all select 'da',N'橽'
union all select 'dai',N'靆'
union all select 'dan',N'饏'
union all select 'dang',N'闣'
union all select 'dao',N'纛'
union all select 'de',N'的'
union all select 'den',N'扽'
union all select 'deng',N'鐙'
union all select 'di',N'螮'
union all select 'dia',N'嗲'
union all select 'dian',N'驔'
union all select 'diao',N'鑃'
union all select 'die',N'嚸' --眰嚸 
union all select 'ding',N'顁'
union all select 'diu',N'銩'
union all select 'dong',N'霘'
union all select 'dou',N'鬭'
union all select 'du',N'蠹'
union all select 'duan',N'叾' --籪叾 
union all select 'dui',N'譵'
union all select 'dun',N'踲'
union all select 'duo',N'鵽'
union all select 'e',N'鱷'
union all select 'en',N'摁'
union all select 'eng',N'鞥'
union all select 'er',N'樲'
union all select 'fa',N'髮'
union all select 'fan',N'瀪'
union all select 'fang',N'放'
union all select 'fei',N'靅'
union all select 'fen',N'鱝'
union all select 'feng',N'覅'
union all select 'fo',N'梻'
union all select 'fou',N'鴀'
union all select 'fu',N'猤' --鰒猤 
union all select 'ga',N'魀'
union all select 'gai',N'瓂'
union all select 'gan',N'灨'
union all select 'gang',N'戇'
union all select 'gao',N'鋯'
union all select 'ge',N'獦'
union all select 'gei',N'給'
union all select 'gen',N'搄'
union all select 'geng',N'堩' --亙堩啹喼嗰 
union all select 'gong',N'兣' --熕贑兝兣 
union all select 'gou',N'購'
union all select 'gu',N'顧'
union all select 'gua',N'詿'
union all select 'guai',N'恠'
union all select 'guan',N'鱹'
union all select 'guang',N'撗'
union all select 'gui',N'鱥'
union all select 'gun',N'謴'
union all select 'guo',N'腂'
union all select 'ha',N'哈'
union all select 'hai',N'饚'
union all select 'han',N'鶾'
union all select 'hang',N'沆'
union all select 'hao',N'兞'
union all select 'he',N'靏'
union all select 'hei',N'嬒'
union all select 'hen',N'恨'
union all select 'heng',N'堼' --堼囍 
union all select 'hong',N'鬨'
union all select 'hou',N'鱟'
union all select 'hu',N'鸌'
union all select 'hua',N'蘳'
union all select 'huai',N'蘾'
union all select 'huan',N'鰀'
union all select 'huang',N'鎤'
union all select 'hui',N'顪'
union all select 'hun',N'諢'
union all select 'huo',N'夻'
union all select 'ji',N'驥'
union all select 'jia',N'嗧'
union all select 'jian',N'鑳'
union all select 'jiang',N'謽'
union all select 'jiao',N'釂'
union all select 'jie',N'繲'
union all select 'jin',N'齽'
union all select 'jing',N'竸'
union all select 'jiong',N'蘔'
union all select 'jiu',N'欍'
union all select 'ju',N'爠'
union all select 'juan',N'羂'
union all select 'jue',N'钁'
union all select 'jun',N'攈'
union all select 'ka',N'鉲'
union all select 'kai',N'乫' --鎎乫 
union all select 'kan',N'矙'
union all select 'kang',N'閌'
union all select 'kao',N'鯌'
union all select 'ke',N'騍'
union all select 'ken',N'褃'
union all select 'keng',N'鏗' --巪乬唟厼怾 
union all select 'kong',N'廤'
union all select 'kou',N'鷇'
union all select 'ku',N'嚳'
union all select 'kua',N'骻'
union all select 'kuai',N'鱠'
union all select 'kuan',N'窾'
union all select 'kuang',N'鑛'
union all select 'kui',N'鑎'
union all select 'kun',N'睏'
union all select 'kuo',N'穒'
union all select 'la',N'鞡'
union all select 'lai',N'籟'
union all select 'lan',N'糷'
union all select 'lang',N'唥'
union all select 'lao',N'軂'
union all select 'le',N'餎'
union all select 'lei',N'脷' --嘞脷 
union all select 'leng',N'睖'
union all select 'li',N'瓈'
union all select 'lia',N'倆'
union all select 'lian',N'纞'
union all select 'liang',N'鍄'
union all select 'liao',N'瞭'
union all select 'lie',N'鱲'
union all select 'lin',N'轥' --轥拎 
union all select 'ling',N'炩'
union all select 'liu',N'咯' --瓼甅囖咯 
union all select 'long',N'贚'
union all select 'lou',N'鏤'
union all select 'lu',N'氇'
union all select 'lv',N'鑢'
union all select 'luan',N'亂'
union all select 'lue',N'擽'
union all select 'lun',N'論'
union all select 'luo',N'鱳'
union all select 'ma',N'嘛'
union all select 'mai',N'霢'
union all select 'man',N'蘰'
union all select 'mang',N'蠎'
union all select 'mao',N'唜'
union all select 'me',N'癦' --癦呅 
union all select 'mei',N'嚜'
union all select 'men',N'們'
union all select 'meng',N'霥' --霿踎 
union all select 'mi',N'羃'
union all select 'mian',N'麵'
union all select 'miao',N'廟'
union all select 'mie',N'鱴' --鱴瓱 
union all select 'min',N'鰵'
union all select 'ming',N'詺'
union all select 'miu',N'謬'
union all select 'mo',N'耱' --耱乮 
union all select 'mou',N'麰' --麰蟱 
union all select 'mu',N'旀'
union all select 'na',N'魶'
union all select 'nai',N'錼'
union all select 'nan',N'婻'
union all select 'nang',N'齉'
union all select 'nao',N'臑'
union all select 'ne',N'呢'
union all select 'nei',N'焾' --嫩焾 
union all select 'nen',N'嫩'
union all select 'neng',N'能' --莻嗯鈪銰啱 
union all select 'ni',N'嬺'
union all select 'nian',N'艌'
union all select 'niang',N'釀'
union all select 'niao',N'脲'
union all select 'nie',N'钀'
union all select 'nin',N'拰'
union all select 'ning',N'濘'
union all select 'niu',N'靵'
union all select 'nong',N'齈'
union all select 'nou',N'譳'
union all select 'nu',N'搙'
union all select 'nv',N'衄'
union all select 'nue',N'瘧'
union all select 'nuan',N'燶' --硸黁燶郍 
union all select 'nuo',N'桛'
union all select 'o',N'鞰' --毮夞乯鞰 
union all select 'ou',N'漚'
union all select 'pa',N'袙'
union all select 'pai',N'磗' --鎃磗 
union all select 'pan',N'鑻'
union all select 'pang',N'胖'
union all select 'pao',N'礮'
union all select 'pei',N'轡'
union all select 'pen',N'喯'
union all select 'peng',N'喸' --浌巼闏乶喸 
union all select 'pi',N'鸊'
union all select 'pian',N'騙'
union all select 'piao',N'慓'
union all select 'pie',N'嫳'
union all select 'pin',N'聘'
union all select 'ping',N'蘋'
union all select 'po',N'魄'
union all select 'pou',N'哛' --兺哛 
union all select 'pu',N'曝'
union all select 'qi',N'蟿'
union all select 'qia',N'髂'
union all select 'qian',N'縴'
union all select 'qiang',N'瓩' --羻兛瓩 
union all select 'qiao',N'躈'
union all select 'qie',N'籡'
union all select 'qin',N'藽'
union all select 'qing',N'櫦'
union all select 'qiong',N'瓗'
union all select 'qiu',N'糗'
union all select 'qu',N'覻'
union all select 'quan',N'勸'
union all select 'que',N'礭'
union all select 'qun',N'囕'
union all select 'ran',N'橪'
union all select 'rang',N'讓'
union all select 'rao',N'繞'
union all select 're',N'熱'
union all select 'ren',N'餁'
union all select 'reng',N'陾'
union all select 'ri',N'馹'
union all select 'rong',N'穃'
union all select 'rou',N'嶿'
union all select 'ru',N'擩'
union all select 'ruan',N'礝'
union all select 'rui',N'壡'
union all select 'run',N'橍' --橍挼 
union all select 'ruo',N'鶸'
union all select 'sa',N'栍' --櫒栍 
union all select 'sai',N'虄' --簺虄 
union all select 'san',N'閐'
union all select 'sang',N'喪'
union all select 'sao',N'髞'
union all select 'se',N'飋' --裇聓 
union all select 'sen',N'篸'
union all select 'seng',N'縇' --閪縇 
union all select 'sha',N'霎'
union all select 'shai',N'曬'
union all select 'shan',N'鱔'
union all select 'shang',N'緔'
union all select 'shao',N'潲'
union all select 'she',N'欇'
union all select 'shen',N'瘮'
union all select 'sheng',N'賸'
union all select 'shi',N'瓧' --鰘齛兙瓧 
union all select 'shou',N'鏉'
union all select 'shu',N'虪'
union all select 'shua',N'誜'
union all select 'shuai',N'卛'
union all select 'shuan',N'腨'
union all select 'shuang',N'灀'
union all select 'shui',N'睡'
union all select 'shun',N'鬊'
union all select 'shuo',N'鑠'
union all select 'si',N'乺' --瀃螦乺 
union all select 'song',N'鎹'
union all select 'sou',N'瘶'
union all select 'su',N'鷫'
union all select 'suan',N'算'
union all select 'sui',N'鐩'
union all select 'sun',N'潠'
union all select 'suo',N'蜶'
union all select 'ta',N'襨' --躢襨 
union all select 'tai',N'燤'
union all select 'tan',N'賧'
union all select 'tang',N'燙'
union all select 'tao',N'畓' --討畓 
union all select 'te',N'蟘'
union all select 'teng',N'朰' --霯唞朰 
union all select 'ti',N'趯'
union all select 'tian',N'舚'
union all select 'tiao',N'糶'
union all select 'tie',N'餮'
union all select 'ting',N'乭' --濎乭 
union all select 'tong',N'憅'
union all select 'tou',N'透'
union all select 'tu',N'鵵'
union all select 'tuan',N'褖'
union all select 'tui',N'駾'
union all select 'tun',N'坉'
union all select 'tuo',N'籜'
union all select 'wa',N'韤'
union all select 'wai',N'顡'
union all select 'wan',N'贎'
union all select 'wang',N'朢'
union all select 'wei',N'躛'
union all select 'wen',N'璺'
union all select 'weng',N'齆'
union all select 'wo',N'齷'
union all select 'wu',N'鶩'
union all select 'xi',N'衋'
union all select 'xia',N'鏬'
union all select 'xian',N'鼸'
union all select 'xiang',N'鱌'
union all select 'xiao',N'斆'
union all select 'xie',N'躞'
union all select 'xin',N'釁'
union all select 'xing',N'臖'
union all select 'xiong',N'敻'
union all select 'xiu',N'齅'
union all select 'xu',N'蓿'
union all select 'xuan',N'贙'
union all select 'xue',N'瀥'
union all select 'xun',N'鑂'
union all select 'ya',N'齾'
union all select 'yan',N'灩'
union all select 'yang',N'樣'
union all select 'yao',N'鑰'
union all select 'ye',N'岃' --鸈膶岃 
union all select 'yi',N'齸'
union all select 'yin',N'檼'
union all select 'ying',N'譍'
union all select 'yo',N'喲'
union all select 'yong',N'醟'
union all select 'you',N'鼬'
union all select 'yu',N'爩'
union all select 'yuan',N'願'
union all select 'yue',N'鸙'
union all select 'yun',N'韻'
union all select 'za',N'雥'
union all select 'zai',N'縡'
union all select 'zan',N'饡'
union all select 'zang',N'臟'
union all select 'zao',N'竈'
union all select 'ze',N'稄'
union all select 'zei',N'鱡'
union all select 'zen',N'囎'
union all select 'zeng',N'贈'
union all select 'zha',N'醡'
union all select 'zhai',N'瘵'
union all select 'zhan',N'驏'
union all select 'zhang',N'瞕'
union all select 'zhao',N'羄'
union all select 'zhe',N'鷓'
union all select 'zhen',N'黮'
union all select 'zheng',N'證'
union all select 'zhi',N'豒'
union all select 'zhong',N'諥'
union all select 'zhou',N'驟'
union all select 'zhu',N'鑄'
union all select 'zhua',N'爪'
union all select 'zhuai',N'跩'
union all select 'zhuan',N'籑'
union all select 'zhuang',N'戅'
union all select 'zhui',N'鑆'
union all select 'zhun',N'稕'
union all select 'zhuo',N'籱'
union all select 'zi',N'漬' --漬唨 
union all select 'zong',N'縱'
union all select 'zou',N'媰'
union all select 'zu',N'謯'
union all select 'zuan',N'攥'
union all select 'zui',N'欈'
union all select 'zun',N'銌'
union all select 'zuo',N'咗') t  
where word >= @word collate Chinese_PRC_CS_AS_KS_WS  
order by word collate Chinese_PRC_CS_AS_KS_WS ASC) else @word end) 
set @i = @i + 1 
end
return @pinyin 
END
GO 

使用方法:
select dbo.fun_GetPinyin([Title]),[Title] from Issue;
查询结果:
1 ma ling shu jia chong 马铃薯甲虫
posted @ 2012-08-28 10:23 Jakin.zhou 阅读(163) | 评论 (0)编辑 收藏

DATEADD,在向指定日期加上一段时间的基础上,返回新的datetime值。

例如:dateadd(day,1,CreateTime)
select dateadd(day,1,CreateTime) from student;

posted @ 2012-08-16 18:02 Jakin.zhou 阅读(266) | 评论 (0)编辑 收藏

 1<html>
 2<head>
 3    <title>测试HTML导出内容至WORD</title>
 4    <script type="text/javascript" language="javascript">
 5        //指定页面区域内容导入Word
 6        function exportToWord(controlId) {
 7            var control = document.getElementById(controlId);
 8            try {
 9                var oWD = new ActiveXObject("Word.Application");
10                var oDC = oWD.Documents.Add(""01);
11                var oRange = oDC.Range(01);
12                var sel = document.body.createTextRange();
13                try {
14                    sel.moveToElementText(control);
15                }
 catch (notE) {
16                    alert("导出数据失败,没有数据可以导出。");
17                    window.close();
18                    return;
19                }

20                sel.select();
21                sel.execCommand("Copy");
22                oRange.Paste();
23                oWD.Application.Visible = true;
24                //window.close();
25            }

26            catch (e) {
27                alert("导出数据失败,需要在客户机器安装Microsoft Office Word(不限版本),将当前站点加入信任站点,允许在IE中运行ActiveX控件。");
28                try { oWD.Quit(); } catch (ex) { }
29                //window.close();
30            }

31        }

32    
</script>
33</head>
34<body>
35    <div id="TestDiv">
36        <div align="center">爱情公寓第三季成绩表</div>
37        
38        <table width="100%">
39            <tr>
40                <td style="background-color: #F50AE5; font-weight: bold;text-align:center">
41                    名次
42                </td>
43                <td style="background-color: #F50AE5; font-weight: bold;text-align:center">
44                    姓名
45                </td>
46                <td style="background-color: #F50AE5; font-weight: bold;text-align:center">
47                    总分
48                </td>
49            </tr>
50            <tr>
51                <td style="text-align:center">
52                    2012001
53                </td>
54                <td style="text-align:center">
55                    曾小贤
56                </td>
57                <td style="text-align:center">
58                    86
59                </td>
60            </tr>
61            <tr>
62                <td style="text-align:center">
63                    2012002
64                </td>
65                <td style="text-align:center">
66                    胡一菲
67                </td>
68                <td style="text-align:center">
69                    85
70                </td>
71            </tr>
72        </table>
73    </div>
74    <div>
75    <div style="text-align:center">
76    <input type="button" value="导出到WORD" onclick="return exportToWord('TestDiv')" />
77    </div>
78</body>
79</html>
80
posted @ 2012-08-16 10:35 Jakin.zhou 阅读(2187) | 评论 (1)编辑 收藏

新建一个工程,然后导入下面的MyecliseGen.java文件:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class MyeclipseGen {
    
private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.";

    
public String getSerial(String userId, String licenseNum) {
        java.util.Calendar cal 
= java.util.Calendar.getInstance();
        cal.add(
13);
        cal.add(
6-1);
        java.text.NumberFormat nf 
= new java.text.DecimalFormat("000");
        licenseNum 
= nf.format(Integer.valueOf(licenseNum));
        String verTime 
= new StringBuilder("-").append(
                
new java.text.SimpleDateFormat("yyMMdd").format(cal.getTime()))
                .append(
"0").toString();
        String type 
= "YE3MP-";
        String need 
= new StringBuilder(userId.substring(01)).append(type)
                .append(
"300").append(licenseNum).append(verTime).toString();
        String dx 
= new StringBuilder(need).append(LL).append(userId)
                .toString();
        
int suf = this.decode(dx);
        String code 
= new StringBuilder(need).append(String.valueOf(suf))
                .toString();
        
return this.change(code);
    }


    
private int decode(String s) {
        
int i;
        
char[] ac;
        
int j;
        
int k;
        i 
= 0;
        ac 
= s.toCharArray();
        j 
= 0;
        k 
= ac.length;
        
while (j < k) {
            i 
= (31 * i) + ac[j];
            j
++;
        }

        
return Math.abs(i);
    }


    
private String change(String s) {
        
byte[] abyte0;
        
char[] ac;
        
int i;
        
int k;
        
int j;
        abyte0 
= s.getBytes();
        ac 
= new char[s.length()];
        i 
= 0;
        k 
= abyte0.length;
        
while (i < k) {
            j 
= abyte0[i];
            
if ((j >= 48&& (j <= 57)) {
                j 
= (((j - 48+ 5% 10+ 48;
            }
 else if ((j >= 65&& (j <= 90)) {
                j 
= (((j - 65+ 13% 26+ 65;
            }
 else if ((j >= 97&& (j <= 122)) {
                j 
= (((j - 97+ 13% 26+ 97;
            }

            ac[i] 
= (char) j;
            i
++;
        }

        
return String.valueOf(ac);
    }


    
public MyeclipseGen() {
        
super();
    }


    
public static void main(String[] args) {
        
try {
            System.out.println(
"please input register name:");
            BufferedReader reader 
= new BufferedReader(new InputStreamReader(
                    System.in));
            String userId 
= null;
            userId 
= reader.readLine();
            MyeclipseGen myeclipsegen 
= new MyeclipseGen();
            String res 
= myeclipsegen.getSerial(userId, "5");
            System.out.println(
"Serial:" + res);
            reader.readLine();
        }
 catch (IOException ex) {
        }

    }

}

运行此文件,在控制台出现:
please input register name:
随便一个名字,然后回车,即可出现注册码,然后在MyEclipse下,在菜单中选择 Myeclipse->Subscription Information 然后 输入Subscriber和Subscription code即可。
posted @ 2012-07-02 17:28 Jakin.zhou 阅读(2010) | 评论 (1)编辑 收藏

仅列出标题
共16页: First 上一页 4 5 6 7 8 9 10 11 12 下一页 Last