资源简介
SecureCRSecureFXP-v7.0.0
代码片段和文件信息
# $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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 196 2014-01-24 11:39 SecureCRT(支持SSH1和SSH2的终端仿真程序)下载 v7.0.0.326绿色汉化版_ - pc6下载站.url
目录 0 2014-01-24 11:38 SecureCRTSecureFX_7.0.0.326中文版\
目录 0 2014-01-24 11:39 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\
目录 0 2014-01-24 11:38 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\
目录 0 2014-01-24 11:38 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\AppInfo\
文件 8734 2011-08-21 17:12 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\AppInfo\appicon.ico
文件 690 2011-12-24 01:28 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\AppInfo\appicon_16.png
文件 1698 2011-12-24 01:28 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\AppInfo\appicon_32.png
文件 585 2012-08-04 00:50 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\AppInfo\appinfo.ini
目录 0 2014-01-24 11:38 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\
文件 724480 2012-07-29 16:07 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Activator.exe
文件 1827328 2008-12-16 12:29 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\ccme_ba
文件 384 2008-12-16 12:29 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\ccme_ba
文件 1462272 2012-07-29 17:01 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\ClientConfigUI70U.dll
文件 413184 2012-07-29 17:01 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\CommonUI70U.dll
文件 889856 2012-07-29 17:01 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\ConnectDialog70U.dll
文件 1891840 2008-12-16 12:29 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\cryptocme2.dll
文件 384 2008-12-16 12:29 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\cryptocme2.dll.manifest
文件 1607 2008-12-16 12:29 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\cryptocme2.sig
文件 300032 2012-07-29 17:01 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\FTP.dll
文件 310272 2012-07-29 17:01 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\FTPSSL.dll
目录 0 2014-01-24 11:38 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Keymaps\
文件 5239 2004-03-17 14:47 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Keymaps\CRiSP.key
文件 2173 2004-03-17 14:47 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Keymaps\doorway.key
文件 9953 2004-03-17 14:47 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Keymaps\VShell.key
文件 1843 2004-03-17 14:47 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Keymaps\vt100.key
文件 2070 2004-03-17 14:47 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Keymaps\vt220-linux.key
文件 2537 2004-03-17 14:47 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Keymaps\vt220.key
文件 3735 2004-03-17 14:47 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Keymaps\vt400.key
文件 3957 2004-03-17 14:47 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\Keymaps\wyse50.key
文件 889792 2012-07-07 00:41 SecureCRTSecureFX_7.0.0.326中文版\SecureCRTSecureFX_HH_x64_7.0.0.326\App\VanDyke Clients\LicenseHelper.exe
............此处省略176个文件信息
- 上一篇:MAX30100程序,已验证可用
- 下一篇:柏林语音数据库
相关资源
- 基于51单片机GSM模块短信的家庭火灾报
- linux命令速查手册中文高清PDF
- 兄弟连2014年新版Linux视频教程课件
- Xshell_5.0.1325
- 程序员的自我修养--链接、装载与库(
- redis_Linux+Win_可视化客户端
- 超级详细的linux思维导图
- Linux 中TCP/IP协议实现及嵌入式应用
- SecureCRT8.5_for_linux.zip
-
em
bedded.Linux.Systems.with.the.Yocto.Proje - Suse Linux 12 下gcc环境所需rpm安装包
- 跨平台使用Synergy1.8.8+破解方法
- Linux命令行与shell脚本编程大全第3版文
- secureCRT8.5.2+注册机
- linux环境下部署kettle,执行kitchen.sh文
- Linux与unix shell编程指南.pdf
- [精品]鸟哥的Linux私房菜:服务器架设
- 超轻量级Linux镜像cirros
- 《UNIX环境高级编程》高清全英文版第
- 深入Linux内核架构中文版--原版pdf
- Linux命令行与shell脚本编程大全(第
- ARM9 Linux系统下的五子棋游戏
- 编译好的基于linux_arm64的etcd_3.1.14
- LINUX离线安装SVN1.8.17全过程,自己摸索
- 基于docker部署前后端分离项目文档
- Unix环境高级编程中文第2版.pdf
- 鸟哥的Linux私房菜-基础学习篇第四版
- 鸟哥的Linux私房菜:基础学习篇第四版
- RHCE&RHCSA;题库2018-2019
- linux编译过的hadoop2.7.6
评论
共有 条评论