鱼C论坛

 找回密码
 立即注册

myBase Desktop 延长试用时间

热度 3已有 1545 次阅读2016-12-8 10:32 |个人分类:网络

myBase Desktop 是一款非常不错的知识管理工具,最新版本是 myBase Desktop 6.0 (TEST-12)。
不注册只能试用30天,使用以下方法可以让过期软件恢复成试用30天,非常简单。

1.打开软件根目录下的nyfedit.ini文件,找到App.UserLic.FirstUseOn=1295074923
这个参数记载着第一次打开此软件的时间,很明显,这个参数遵循Unix时间戳。
只需要修改这个Unix时间戳为你现在的时间,试用期就会变回30天。

2.现在所需要的就是获得当前的Unix时间戳,获得的方法多种多样。
例如我使用python,交互式shell中输入:
>>> import time
>>> time.time()
1295081182.125
显然,1295081182就是当前的Unix时间戳。
替换nyfedit.ini里面的App.UserLic.FirstUseOn参数,保存。
重新打开 myBase Desktop 试用时间就会回到30天。

最简单获得Unix时间戳的方法,访问如下链接就有:
http://tool.chinaz.com/Tools/unixtime.aspx

原文出处:http://kpjack.blog.51cto.com/627289/581938

-------------------------
#coding:utf-8
import os
import re
import time
from tkinter import *

target_str = 'App.UserLic.FirstUseOn'
str_list = []
old_str = ''
new_str = ''
fileName = ''
success = False

root = Tk()

# 打开文件,获取文件名
def openFile():
    global fileName #修改全局变量
    fileName = filedialog.askopenfilename()
    #print(fileName)
    vopen.set(fileName)

# 更新时间    
def updateFile():
    global str_list, new_str, old_str, filename, success
    # 遍历到列表
    with open(fileName, 'rb') as f:
        for each_line in f.readlines():
            str_list.append(each_line)
            
    # 查找字符串            
    for each_str in str_list:
        if target_str in each_str.decode('utf-8'):
            pos = str_list.index(each_str)
            old_str = str_list[pos].decode('utf-8')
            # 正则替换
            new_str = re.sub(r'(\d+)', str(time.time()).split('.')[0], old_str)
            str_list[pos] = bytes(new_str, encoding="utf-8")
            #print('Change:\n%sTo:\n%s'%(old_str, new_str))
            success = True
            break
    else:
        vupdate.set('文件格式错误!')
        
    if success:
        # 写入文件
        with open(fileName, 'wb') as ff:
            for each_ in str_list:
                ff.write(each_)
        vupdate.set('Change:\n%sTo:\n%s'%(old_str, new_str))
    # 执行完成后初始化全局变量
    str_list = []
    old_str = ''
    new_str = ''
    filename = ''
    success = False
    
# 界面部分
openButton = Button(root, text="打开文件", command=openFile).pack()
vopen = StringVar()
vopen.set("未选定任何文件")
openLabel = Label(root, textvariable=vopen).pack()

vupdate = StringVar()
vupdate.set("暂无任何更新")
updateButton = Button(root, text="更新文件", command=updateFile).pack()
updateLabel =Label(root, textvariable=vupdate).pack()

mainloop()
-------------------------

路过

鸡蛋
3

鲜花

握手

雷人

刚表态过的朋友 (3 人)

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-3-29 12:54

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

返回顶部