资源简介
解压版SecureCRT,Window系统上 Linux 远程登录客户端
代码片段和文件信息
# $language = “python“
# $interface = “1.0“
# AddCommentToLogFile.py
#
# Description:
# This example script allows you to add a custom line of text to your
# SecureCRT log file. The user will be prompted for the text to add
# to the log file; logging will be stopped; the text provided by the
# user will be appended to the log file; then SecureCRT logging will
# be restarted.
#
# This method only works with connections associated with a Session
# configuration in which a log file is specified.
#
# Demonstrates:
# - How to prompt for user input using the SecureCRT InputBox() function.
# - How to access Session.LogFileName to determine the log file name
# stored for the current session.
# - How to use the Session.Logging property to determine if logging
# is currently active.
# - How to use the Python replace() method to substitute substrings
# within an existing string.
# - How to use the Python file object to open an existing text file
# and append data.
#
import datetime
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def Main():
# Make this script tab safe
tab = crt.GetscriptTab()
if tab.Session.LogFileName == ““ :
crt.Dialog.MessageBox(“Error.\n\n\
This script requires a session configuration in which a \
log file is defined.\n\n\
Specify a Log file name in Session Options ““Terminal / \
Log File““ and run this script again.“)
return
# 1. Stop logging to free up the log file for writing by our script.
tab.Session.Log(False)
# 2. Prompt the user for the text to add to the log file.
now = str(datetime.datetime.now())
textToAdd = crt.Dialog.Prompt(
“Add comment to log file (use \\r\\n to separate multiple lines):\n\n\
Comment will be prefaced with current timestamp:\n“ + now + “\n“
“Add Comment To SecureCRT Log File\n“ + now + “: “)
# Prompt returns ““ if the user cancels
if textToAdd == ““:
return
# 3. Write data to the file. If you want to include a newline you must
# concatenate a \n character to the end of the line. Note also that you can
# wrap the comment with certain markers and not require the user to enter
# these markers when prompted. Although the prompt function only allows
# one line per entry you can set up a tag that can be used to represent
# a new line such as “\r\n“ and then replace this tag with a \n as we
# have done in this example:
textToAdd = “\n/********************************************/ \n\
* “ + now + “: \n* “ + textToAdd.replace(“\r\n“ “\n* “) + “\n\
/********************************************/ \n“
WriteToFile(tab.Session.LogFileName textToAdd)
# 4. Start up logging again making sure we append rather than overwrite.
tab.Session.Log(True True)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def WriteToFile(filename data):
# filename: Full path to file
# data: data to be written to the
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 338 2014-03-04 17:07 securcrt.com\PC软件下载站.url
文件 198 2012-06-04 23:39 securcrt.com\SecureCRSecureFXPortable32\!)作者博客.url
文件 864 2012-08-04 00:48 securcrt.com\SecureCRSecureFXPortable32\!)使用必读.txt
文件 235 2012-06-05 23:46 securcrt.com\SecureCRSecureFXPortable32\!)综合网购首选.url
文件 8734 2011-08-21 17:12 securcrt.com\SecureCRSecureFXPortable32\App\AppInfo\appicon.ico
文件 690 2011-12-24 01:28 securcrt.com\SecureCRSecureFXPortable32\App\AppInfo\appicon_16.png
文件 1698 2011-12-24 01:28 securcrt.com\SecureCRSecureFXPortable32\App\AppInfo\appicon_32.png
文件 585 2012-08-04 00:48 securcrt.com\SecureCRSecureFXPortable32\App\AppInfo\appinfo.ini
文件 570368 2012-07-29 16:06 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Activator.exe
文件 1708032 2008-12-16 12:29 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\ccme_ba
文件 382 2008-12-16 12:29 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\ccme_ba
文件 1132032 2012-07-29 16:58 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\ClientConfigUI70U.dll
文件 326144 2012-07-29 16:58 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\CommonUI70U.dll
文件 694784 2012-07-29 16:58 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\ConnectDialog70U.dll
文件 1744896 2008-12-16 12:29 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\cryptocme2.dll
文件 382 2008-12-16 12:29 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\cryptocme2.dll.manifest
文件 1607 2008-12-16 12:29 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\cryptocme2.sig
文件 252416 2012-07-29 16:58 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\FTP.dll
文件 260096 2012-07-29 16:58 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\FTPSSL.dll
文件 5239 2004-03-17 14:47 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Keymaps\CRiSP.key
文件 2173 2004-03-17 14:47 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Keymaps\doorway.key
文件 9953 2004-03-17 14:47 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Keymaps\VShell.key
文件 1843 2004-03-17 14:47 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Keymaps\vt100.key
文件 2070 2004-03-17 14:47 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Keymaps\vt220-linux.key
文件 2537 2004-03-17 14:47 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Keymaps\vt220.key
文件 3735 2004-03-17 14:47 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Keymaps\vt400.key
文件 3957 2004-03-17 14:47 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Keymaps\wyse50.key
文件 763840 2012-07-29 16:16 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\LicenseHelper.exe
文件 732160 2012-07-29 16:06 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\LicenseUI70U.dll
文件 6915 2011-09-12 10:35 securcrt.com\SecureCRSecureFXPortable32\App\VanDyke Clients\Menus\allsystem.mnu
............此处省略196个文件信息
相关资源
- 我的嵌入式Linux应用开发之路(第二版
- linux 编程白皮书 linux 编程白皮书
- Linux命令行与Shell脚本编程大全
- RTL8188EUS_RTL8189ES_linux_v4.1.7_9024.2013091
- Linux环境编程图文指南.林世霖(带书
- rhci-5.8-1.iso Linux系统安装引导
- yafeilinux教程-qt学习必备-PDF版
- 东北大学linux教学资料
- linux2.6.1内核源码注释
- Linux内核设计与实现_第三版_清晰中文
- USB2.0网卡驱动(windows mac linux)AX887
- eclipse-inst-linux32.tar.gz
-
嵌入式Linux基础教程em
bedded Linux pr - Linux内核设计的艺术:图解Linux操作系
- 学习Vi 和 Vim 编辑器中文版第7版
- 鸟哥的Linux私房菜第四版PDF
- GNS3使用手册win版+linux版
- Linus Torvalds:只是为了好玩——Linux
- 鸟哥的Linux私房菜+基础学习篇(第三
- 宫虎波 linux编程从入门到精通
- 基于QT的电子地图的设计与实现
- libxl 内含注册机 linux可用
- 嵌入式操作系统基础μCOS-2和Linux(第
- Linux设备驱动开发详解:基于最新的
- i 春秋月刊第六期:Linux pwn 零基础入
- zw_Linuxc从入门到精通.zip
- Linux内核2.4版源代码分析大全
- Install_TW6.1.5.8_Enterprise_Linux.bin
- Linux 内核最新稳定版linux-4.20.tar.xz
- Linux设备驱动开发详解:基于最新的
评论
共有 条评论