1.下面是网上编写的类库,保存为libAutoit.rb

#LibAutoit主要处理windows弹出的对话框,调用autoit类进行处理
#函数如下:
#- ChooseFileDialog函数:处理选择文件对话框窗口
#- clearSecurityAlert函数:处理安全警告对话框
#- ControlSetText函数:给对话框中的某个控件设置值
#- ControlClick函数:向指定控件发送鼠标点击命令
#- ControlGetText函数:获取指定控件值
#- ControlGetHandle函数:获取指定控件值的句柄
#- ControlFocus函数:设置输入焦点到指定窗口的某个控件上
#- DealDownloadDialog函数:处理文件下载对话框
#- DealPathDialog函数:设置下载文件路径及操作下载,如果文件已存在则覆盖处理
#- DealAlterDialog函数:处理Alter对话框
#- DealConfirmDialog函数:处理Confirm对话框
#- DealPromptDialog函数:处理Prompt对话框
#- DealSecurity函数:点击页面链接,使弹出安全警告对话框
#- GetDialogTitle函数:根据类型获取弹出的窗口标题
#- SendKey函数:模拟键盘输入字符
#- WinExists函数:判断窗口是否存在 module LibAutoit
class AutoItApi
def initialize
require 'win32ole'
require 'watir/windowhelper'
WindowHelper.check_autoit_installed
@autoit = WIN32OLE.new("AutoItX3.Control") @DealDownloadDialogTimeOut = 40
@DealPathDialogTimeOut = 40
@ChooseFileDialogTimeOut = 40
@DealAlterDialogTimeOut = 40
@DealConfirmDialogTimeOut = 40
@DealPromptDialogTimeOut = 40
@DealSecurityTimeOut = 40
@clearSecurityAlertTimeOut = 40 end #def initialize end #功能说明:根据类型获取弹出的窗口标题,因为IE各版本弹出的对话框标题有差异,需要进行特殊处理
#
#参数说明:
#type:窗口类型,具体值如下:
#- type=1:选择文件窗口标题
#- type=2:Alter窗口标题
#- type=3:Prompt窗口标题
#- type=4:安全警告窗口标题
#- type=5:文件下载窗口标题
#- type=6:文件另存为窗口标题
#
#调用示例: GetDialogTitle(2)
#
#返回值说明:
#- 成功:返回获取的标题
#- 失败:返回false
def GetDialogTitle(type = 2)
#$logger.log("调用函数:LibAutoit.rb文件中的GetDialogTitle(#{type})" ) case type
when 1 #选择文件窗口标题
dialog_title = ['选择文件','Choose file']
when 2 #Alter窗口标题
dialog_title = ['Microsoft Internet Explorer','Windows Internet Explorer']
when 3 #Prompt窗口标题
dialog_title = ['Explorer 用户提示','Explorer User Prompt']
when 4 #安全警告窗口标题
dialog_title = ['安全警告','Security Alert']
when 5 #文件下载窗口标题
dialog_title = ['文件下载 - 安全警告','文件下载','File Download']
when 6 #文件另存为窗口标题
dialog_title = ['另存为']
end dialog_title.each do |title|
if (WinExists(title,'') == 1)
$logger.log("获取的窗口:#{title}",'N')
$logger.log("调用函数结束:LibAutoit.rb文件中的GetDialogTitle(#{type})" ,'N') return title
end
end
return false
#$logger.log("调用函数结束:LibAutoit.rb文件中的GetDialogTitle(#{type})" )
end #功能说明:处理文件下载对话框,调用DealPathDialog函数设置路径及下载文件
#
#参数说明:
#- file_path:文件下载后存放的路径,格式如:c:\\test
#- file_name:文件名,如:test.txt
#- timeout:对话框处理的超时时间,默认为20秒
#
#调用示例: DealDownloadDialog(“c:\\test\test.txt”,15)
#
#返回值说明:
#- 成功:返回ture
#- 失败:返回false
def DealDownloadDialog(file_path,file_name,timeout = @DealDownloadDialogTimeOut )
$logger.log("调用函数:LibAutoit.rb文件中的DealDownloadDialog(#{file_path},#{file_name},#{timeout})",'N' )
$logger.log('----------deal with download File dialog begin----------')
start_time = Time.now.to_i while 1
if (Time.now.to_i-start_time < timeout) #判断处理时间是否超时 win_title = GetDialogTitle(5) #获取窗口标题 if (win_title)
@autoit.WinActivate(win_title,'')
sleep(1)
ControlClick(win_title,'','Button2') DealPathDialog(file_path,file_name) $logger.log('----------deal with download File dialog end----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的DealDownloadDialog(),返回结果:true",'N' )
return true
end
else
$logger.log("Deal Download File Dialog Fail!")
$logger.log('----------deal with download File dialog end----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的DealDownloadDialog(),返回结果:false",'N' )
return false
end
end
end #功能说明:设置下载文件路径及操作下载,如果文件已存在则覆盖处理
#
#参数说明:
#- file_path:文件下载后存放的路径,格式如:c:\\test
#- file_name:文件名,如:test.txt
#- timeout:对话框处理的超时时间,默认为20秒
#
#调用示例:
#- DealPathDialog(“c:\\test”,"test.txt")
#
#返回值说明:
#- 成功:返回true
#- 失败:返回false
def DealPathDialog(file_path,file_name = '',timeout = @DealPathDialogTimeOut )
$logger.log("调用函数:LibAutoit.rb文件中的DealPathDialog(#{file_path},#{file_name},#{timeout})",'N' ) start_time = Time.now.to_i while 1
if (Time.now.to_i-start_time < timeout) #判断处理时间是否超时
win_title = GetDialogTitle(6) #获取窗口标题 if (win_title)
@autoit.WinActivate(win_title,'') #if (file_name == '')
#file_name = ControlGetText(win_title,'','Edit1')
#end if (!FileTest::exist?(file_path))
FileUtils.makedirs(file_path)
end file_full_path = "#{file_path}\\#{file_name}" real_file_path = $TxtClass.GetRealPath(file_full_path,'N')
real_full_path = "#{real_file_path}\\#{file_name}" ControlSetText(win_title,'','Edit1',real_full_path)
SendKey("!S")
#ControlClick(win_title,'','Button2') if (WinExists(win_title,'替换') == 1)
@autoit.WinActivate(win_title,'替换')
ControlClick(win_title,'替换','Button1')
end $logger.log("调用函数结束:LibAutoit.rb文件中的DealPathDialog()" ,'N')
return true
end
else
$logger.log("Deal File Path Dialog Fail!")
$logger.log("调用函数结束:LibAutoit.rb文件中的DealPathDialog()" ,'N')
return false
end
end
end #功能说明:处理选择文件对话框窗口
#
#参数说明:无
#- file_path:文件下载后存放的路径,格式:目录+文件名,如:c:\\test\\test.txt
#- timeout:对话框处理的超时时间,默认为20秒
#
#调用示例: ChooseFileDialog(“c:\\test\\test.txt”,15)
#
#返回值说明:
#- 成功:返回true
#- 失败:返回false
def ChooseFileDialog(file_path,timeout = @ChooseFileDialogTimeOut)
$logger.log("调用函数:LibAutoit.rb文件中的ChooseFileDialog(#{file_path},#{timeout})" ,'N') $logger.log('----------deal with Choose File dialog begin----------')
start_time = Time.now.to_i while 1
if (Time.now.to_i-start_time < timeout) #判断处理时间是否超时
win_title = GetDialogTitle(1) #获取窗口标题 if (win_title)
@autoit.WinActivate(win_title,'') if (FileTest::exist?(file_path))
real_file_path = $TxtClass.GetRealPath(file_path) #获取真实路径 ControlSetText(win_title,'','Edit1',real_file_path)
ControlClick(win_title,'','Button2') $logger.log('----------deal with Choose File dialog end----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的ChooseFileDialog(#{file_path},#{timeout})",'N' ) return true
else
$logger.log('----------deal with Choose File dialog end----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的ChooseFileDialog(#{file_path},#{timeout})",'N' )
return false
end
end
else
$logger.log("Deal Choose File Dialog Fail!")
$logger.log('----------deal with Choose File dialog end----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的ChooseFileDialog(#{file_path},#{timeout})" ,'N')
return false
end
end
end #功能说明:处理Alter对话框
#
#参数说明:
#- timeout:对话框处理的超时时间,默认为20秒
#
#调用示例: DealAlterDialog(15)
#
#返回值说明:
#- 成功:返回对话框中的文本提示内容
#- 失败:返回false
def DealAlterDialog(timeout = @DealAlterDialogTimeOut )
$logger.log("调用函数:LibAutoit.rb文件中的DealAlterDialog(#{timeout})" ,'N')
$logger.log('----------deal with alter dialog begin----------') start_time = Time.now.to_i while 1
if (Time.now.to_i-start_time < timeout) #判断处理时间是否超时
win_title = GetDialogTitle(2) #获取窗口标题
if (win_title)
@autoit.WinActivate(win_title,'') alter_content = ControlGetText(win_title,'','Static2')
SendKey('{ENTER}')
#ControlClick('Windows Internet Explorer','','Button1')
#puts "alter message:\n #{alter_content}" $logger.log("the content of alter dialog: #{alter_content} ",'N')
$logger.log('-----------deal with alter dialog end-----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的DealAlterDialog(#{timeout})" ,'N')
return alter_content
end
else
$logger.log("deal with alter dialog fail!")
$logger.log('-----------deal with alter dialog end-----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的DealAlterDialog(#{timeout})" ,'N')
return false
end
end
end #功能说明:处理Confirm对话框
#
#参数说明:
#- type:点击确定或取消按钮,Y:确定 N:取消
#- timeout:对话框处理的超时时间,默认为20秒
#
#调用示例: DealConfirmDialog()
#
#返回值说明:
#- 成功:返回对话框中的文本提示内容
#- 失败:返回false
def DealConfirmDialog(type = 'Y',timeout = @DealConfirmDialogTimeOut)
$logger.log("调用函数:LibAutoit.rb文件中的DealConfirmDialog()" ,'N')
$logger.log('----------deal with confirm dialog begin----------')
start_time = Time.now.to_i while 1
if (Time.now.to_i-start_time < timeout) #判断处理时间是否超时
win_title = GetDialogTitle(2) #获取窗口标题' if (win_title)
@autoit.WinActivate(win_title,'') confirm_content = ControlGetText(win_title,'','Static2') case type
when 'Y'
ControlClick(win_title,'','Button1')
when 'N'
ControlClick(win_title,'','Button2')
end
$logger.log("the content of confirm dialog: #{confirm_content} ",'N')
$logger.log('-----------deal with confirm dialog end-----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的DealConfirmDialog()" ,'N') return confirm_content
#puts "窗口提示信息:#{confirm_content}"
end
else
$logger.log("deal with confirm dialog fail!")
$logger.log('-----------deal with confirm dialog end-----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的DealConfirmDialog()" ,'N') return false
end
end
end #功能说明:处理Prompt对话框
#
#参数说明:
#- string:输入的文本内容
#- type:点击确定或取消按钮,Y:确定 N:取消
#- timeout:对话框处理的超时时间,默认为20秒
#
#调用示例: DealPromptDialog('test','Y',15)
#
#返回值说明:
#- 成功:返回true
#- 失败:返回false
def DealPromptDialog(string = '',type = 'Y',timeout = @DealPromptDialogTimeOut )
$logger.log("调用函数:LibAutoit.rb文件中的DealPromptDialog(#{string},#{type},#{timeout})" ,'N') puts '----------deal with prompt dialog begin----------'
start_time = Time.now.to_i while 1
if (Time.now.to_i-start_time < timeout) #判断处理时间是否超时
win_title = GetDialogTitle(3) #获取窗口标题
if (win_title)
@autoit.WinActivate(win_title,'') ControlSetText(win_title,'','Edit1',string)
case type
when 'Y'
ControlClick(win_title,'','Button1')
when 'N'
ControlClick(win_title,'','Button2')
end
$logger.log('-----------deal with prompt dialog end-----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的DealPromptDialog(#{string},#{type},#{timeout})" ,'N') return true
end
else
$logger.log("deal with prompt dialog fail!")
$logger.log('-----------deal with prompt dialog end-----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的DealPromptDialog(#{string},#{type},#{timeout})" ,'N') return false
end
end
end #功能说明:点击页面链接,使弹出安全警告对话框
#
#参数说明:
#- win_title:IE页面的标题
#- timeout:对话框处理的超时时间
#
#调用示例: DealSecurity("ie标题",15)
#
#返回值说明:
#- 成功:返回true
#- 失败:返回false
def DealSecurity(win_title,timeout = @DealSecurityTimeOut)
$logger.log("调用函数:LibAutoit.rb文件中的DealSecurity(#{win_title},#{timeout})" ,'N') start_time = Time.now.to_i if (Time.now.to_i-start_time < timeout) #判断处理时间是否超时
while 1
@autoit.ControlClick(win_title,'','Button1')
sleep(1)
SendKey('{DOWN}')
SendKey('{ENTER}')
sleep(1) clearSecurityAlert('Y') #清除安全框窗口
return true
end
else
$logger.log('Deal Security Fail!')
$logger.log("调用函数结束:LibAutoit.rb文件中的DealSecurity(#{win_title},#{timeout})" ,'N') return false
end
end #功能说明:处理安全警告对话框
#
#参数说明:
#- type:选择点击哪个按钮,Y:确定 N:取消
#- timeout:对话框处理的超时时间
#
#调用示例: DealSecurity("ie标题",15)
#
#返回值说明:
#- 成功:返回安全警告窗口中的提示信息
#- 失败:返回false
def clearSecurityAlert(type = 'Y',timeout = @clearSecurityAlertTimeOut)
$logger.log("调用函数:LibAutoit.rb文件中的clearSecurityAlert(#{type},#{timeout})" ,'N')
$logger.log('----------deal with Security dialog begin----------')
#处理安全对话框
start_time = Time.now.to_i while 1
if (Time.now.to_i-start_time < timeout) #判断处理时间是否超时
win_title = GetDialogTitle(4) #获取窗口标题 if (win_title)
alter_content = ControlGetText(win_title,'','Static2') case type
when 'Y'
ControlClick(win_title,'','Button1')
when 'N'
ControlClick(win_title,'','Button2')
end
#puts "安全警告信息:\n#{alter_content}" $logger.log("the content of Security dialog: #{alter_content} ")
$logger.log('-----------deal with Security dialog end-----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的clearSecurityAlert(#{type},#{timeout})" ,'N')
return alter_content
end
else
$logger.log("The Security Alert Windows is not exist!")
$logger.log('-----------deal with Security dialog end-----------')
$logger.log("调用函数结束:LibAutoit.rb文件中的clearSecurityAlert(#{type},#{timeout})",'N' ) return false
end
end
end #功能说明:模拟键盘输入字符
#
#参数说明:
#- string:输入的字符串信息,
#- timeout:对话框处理的超时时间
#
#调用示例:
#- Send("#r") 将发送 Win+r,这将打开“运行”对话框.
#- Send("^!a") 发送按键 "CTRL+ALT+a".
#- Send(" !a") 按下"ALT+a".
#
#返回值说明:无
def SendKey(string = '{ENTER}')
@autoit.Send(string)
end #功能说明:给对话框中的某个控件设置值
#
#参数说明:
#- win_title:对话框窗口的标题
#- win_text:对话框窗口中显示的文本
#- id:对话框窗口中某个控件的ID
#- string:控件设置的值
#
#调用示例: 无
#
#返回值说明:无
def ControlSetText(win_title,win_text,id,string = '',flag = 1)
#修改指定控件的文本
@autoit.WinActivate(win_title,win_text) if (ControlFocus(win_title,win_text,id) == 1)
@autoit.ControlSetText(win_title,win_text,id,string)
end
end #功能说明:向指定控件发送鼠标点击命令
#
#参数说明:
#- win_title:目标窗口标题.
#- win_text:目标窗口文本.
#- id:目标控件ID
#- button_type:按键 [可选参数] 要点击的按钮, 可以是"left", "right", "middle", "main", "menu", "primary", "secondary". 默认为left(左键).
#- click_time :要点击鼠标按钮的次数. 默认值为 1.
#
#调用示例: 无
#
#返回值说明:无
def ControlClick(win_title,win_text,id,button_type =1,click_time = 1)
@autoit.AutoItSetOption("WinTitleMatchMode", 3) @autoit.WinActivate(win_title,win_text) case button_type
when 1 #点击鼠标左键
button_type = 'left'
when 2 #点击鼠标右键
button_type = 'right'
when 3 #点击鼠标中间键
button_type = 'middle'
end @autoit.ControlClick(win_title,win_text,id,button_type,click_time)
end #功能说明:获取指定控件值
#
#参数说明:
#- win_title:目标窗口标题.
#- win_text:目标窗口文本.
#- id:目标控件ID
#
#调用示例: 无
#
#返回值说明:
#- 返回获取的文本内容
def ControlGetText(win_title,win_text,id)
if (ControlGetHandle(win_title,win_text,id) != "")
control_text = @autoit.ControlGetText(win_title,win_text,id) return control_text
end
end #功能说明:获取指定控件值的句柄
#
#参数说明:
#- win_title:目标窗口标题.
#- win_text:目标窗口文本.
#- id:目标控件ID
#
#调用示例: 无
#
#返回值说明:
#- 返回获取的控件句柄
def ControlGetHandle(win_title,win_text,id)
ret = @autoit.ControlGetHandle(win_title,win_text,id)
return ret
end #功能说明:设置输入焦点到指定窗口的某个控件上
#
#参数说明:
#- win_title:目标窗口标题.
#- win_text:目标窗口文本.
#- id:目标控件ID
#
#调用示例: 无
#
#返回值说明:无
def ControlFocus(win_title,win_text,id)
#设置输入焦点到指定窗口的某个控件上
ret = @autoit.ControlFocus(win_title,win_text,id)
return ret
end #功能说明:判断窗口是否存在
#
#参数说明:
#- win_title:目标窗口标题.
#- win_text:目标窗口文本,默认为空
#
#调用示例: 无
#
#返回值说明:返回窗口对象
def WinExists(win_title,win_text = '')
#检查指定的窗口是否存在
ret = @autoit.WinExists(win_title,win_text = '')
return ret
end end
end

窗口处理类库libAutoit.rb

HTML示例,保存到d:\test.html

<html>
<head>
<title>watir处理对话框</title>
<script language= "javascript" type="text/javascript">
function clickbutton(flag)
{
if (flag == 1) alert("测试alter对话框");
if (flag == 2) prompt("测试prompt对话框");
if (flag == 3) confirm('测试confirm对话框', '测试confirm对话框?',"测试结果:");
}
</script>
</head> <body>
<center>
<H1>watir处理对话框<H1>
<hr> <table border ="">
<tr>
<th bgcolor = "#aaaaaa">测试内容</th>
<th bgcolor = "#aaaaaa">操作</th>
</tr> <tr>
<td>文件上传</td>
<td><input type="file" name="attach[]" /></td>
</tr> <tr>
<td>alter对话框</td>
<td>
<input type="button" name="alterbutton" value="测试alter对话框" onclick = "clickbutton(1);" />
</td>
</tr> <tr>
<td>prompt对话框</td>
<td>
<input type="button" name="promptbutton" value="测试prompt对话框" onclick = "clickbutton(2);" />
</td>
</tr> <tr>
<td>confirm对话框</td>
<td>
<input type="button" name="confirmbutton" value="测试confirm对话框" onclick = "clickbutton(3);" />
</td>
</tr> </table>
</center>
</body>
</html>

html Code

处理对话框示例:

require 'watir'
require 'libAutoit'
require 'jcode'
$KCODE = 'e' at = Autoit::AutoItApi.new
winClicker = WinClicker.new url = "D:\\test.html"
ie =Watir::IE.new
ie.goto(url)
ie.maximize() sleep(1)
at.DealSecurity("watir处理对话框 - Windows Internet Explorer")
puts "\n" sleep(1)
#test alter dialog
ie.button(:name,"alterbutton").click_no_wait
sleep(10)
at.DealAlterDialog puts "\n" #test prompt dialog
ie.button(:name,"promptbutton").click_no_wait
sleep(10)
at.DealPromptDialog('test') puts "\n" #test confirm dialog
ie.button(:name,"confirmbutton").click_no_wait
sleep(10)
at.DealConfirmDialog('Y')

testDialog.rb

2.

require 'watir\winClicker'
#require 'watir\contrib\enabled_popup'
ie = Watir::IE.new
ie.goto("http://mail.163.com/")
# 如果 IE 阻止了活动内容(JavaScript脚本)的运行,
# 需要利用这 5 秒时间手工点击IE信息栏,允许阻止的内容运行,
# 不然点击 Button 不会弹出窗口
sleep 5
ie.button(:id, 'loginBtn').click_no_wait
# 查找弹出窗口,设置查找超时时间为10秒
#如果窗口存在,则获取他的句柄,(10)指的是等待时间;
hwnd = ie.enabled_popup(10)
print hwnd
w = WinClicker.new
# 点击弹出窗口中的“确定”按钮
w.clickWindowsButton_hwnd(hwnd,"确定")

3.

require 'watir' 

#require 'win32ole'  # already included if you use 'require watir' 

# 

# Function to look for popups 

def check_for_popups 

    autoit = WIN32OLE.new('AutoItX3.Control') 

    # 

    # Do forever - assumes popups could occur anywhere/anytime in your application. 

    loop do 

        # Look for window with given title. Give up after 1 second. 

        ret = autoit.WinWait('Microsoft Internet Explorer', '', 1) 

        # 

        # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}). 

        if (ret==1) then autoit.Send('{enter}') end 

        # 

        # Take a rest to avoid chewing up cycles and give another thread a go. 

        # Then resume the loop. 

        sleep(3) 

    end 

end 

# 

# MAIN APPLICATION CODE 

# Setup popup handler 

$popup = Thread.new { check_for_popups }  # start popup handler 

at_exit { Thread.kill($popup) }           # kill thread on exit of main application 

# 

# Main application code follows 

ie = Watir::IE.new 

ie.goto("http://localhost:88/Test3.html") 

ie.link(:text,"Click Here").click 

检测弹出框是否存在,并消除

4.

autoit = WIN32OLE.new('AutoItX3.Control')
autoit.Send('{enter}')

5.在Watir中整合AutoIt处理JavaScript弹出窗口的方法
[摘要:以下例子整开了 AutoIt ,正在独自的线程中监控战处置惩罚 JavaScript 弹出窗心: require 'watir' #require 'win32ole' # already included if you use 'require watir' # # Function to look for popups def check_for_popups autoit =]

以下例子整合了AutoIt,在单独的线程中监控和处理JavaScript弹出窗口:

require 'watir'

#require 'win32ole'  # already included if you use 'require watir'

#

# Function to look for popups

def check_for_popups

    autoit = WIN32OLE.new('AutoItX3.Control')

    #

    # Do forever - assumes popups could occur anywhere/anytime in your application.

    loop do

        # Look for window with given title. Give up after 1 second.

        ret = autoit.WinWait('Microsoft Internet Explorer', '', 1)

        #

        # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).

        if (ret==1) then autoit.Send('{enter}') end

        #

        # Take a rest to avoid chewing up cycles and give another thread a go.

        # Then resume the loop.

        sleep(3)

    end

end

#

# MAIN APPLICATION CODE

# Setup popup handler

$popup = Thread.new { check_for_popups }  # start popup handler

at_exit { Thread.kill($popup) }           # kill thread on exit of main application

#

# Main application code follows

ie = Watir::IE.new

ie.goto("http://localhost:88/Test3.html")

ie.link(:text,"Click Here").click

6.Alert标题:

在火狐上 用 alert("你好");
弹出框的标题栏文字是(即时弹出框的上方)  “来自xxx的页面说:”  这个可以更改吗?
ie下是 Microsoft Internet Explorer

watir学习系列--对话框处理(转)的更多相关文章

  1. watir学习系列--Watir API介绍

    文本框:          <INPUT id="email" name="_fmu.u._0.e" value="" />   ...

  2. 日志学习系列(一)——Log4net的基础知识学习

    今天把Log4net日志记录做了封装,作为一个公共的类库.记录一下应该注意的地方.先了解一下log4net的理论知识. 参考百度百科 一.log4net是什么? log4net库是Apache log ...

  3. 03LaTeX学习系列之---TeXworks的使用

    目录 03TeXworks的使用 目录 前言 (一)Texworks的认识 1.TeXworks的安装 2.TeXworks的优点 3.TeXworks的界面 (二)Texworks的编译与查看 1. ...

  4. Android学习系列(18)--App工程结构搭建

     本文算是一篇漫谈,谈一谈关于Android开发中工程初始化的时候如何在初期我们就能搭建一个好的架构.      关于android架构,因为手机的限制,目前我觉得也确实没什么大谈特谈的,但是从开发的 ...

  5. TortoiseGit学习系列之TortoiseGit基本操作拉取项目(图文详解)

    前面博客 TortoiseGit学习系列之TortoiseGit基本操作克隆项目(图文详解) TortoiseGit学习系列之TortoiseGit基本操作修改提交项目(图文详解) TortoiseG ...

  6. TortoiseGit学习系列之TortoiseGit基本操作将提交到本地的项目推送到在线仓库(图文详解)

    前面博客 TortoiseGit学习系列之TortoiseGit基本操作克隆项目(图文详解) TortoiseGit学习系列之TortoiseGit基本操作修改提交项目(图文详解) TortoiseG ...

  7. TortoiseGit学习系列之TortoiseGit基本操作修改提交项目(图文详解)

    前面博客 TortoiseGit学习系列之TortoiseGit基本操作克隆项目(图文详解) TortoiseGit基本操作修改提交项目 项目克隆完成后(可以将克隆 clone 理解为 下载,检出 c ...

  8. TortoiseGit学习系列之TortoiseGit基本操作克隆项目(图文详解)

    前面博客 全网最详细的Git学习系列之介绍各个Git图形客户端(Windows.Linux.Mac系统皆适用ing)(图文详解) 全网最详细的Git学习系列之安装各个Git图形客户端(Windows. ...

  9. Android+Jquery Mobile学习系列(6)-个人信息设置

    本节开始,进行代码的实战练习.我的这个App是管理保险客户信息的,数据采用Sqlite存储在本地手机上,第一次使用需要先登记自己的个人信息,这个功能非常简单,也无关紧要,我是拿这个练手,方便做后面复杂 ...

随机推荐

  1. 07-django项目连接远程mysql数据库

    比如电脑a(ip地址为192.168.0.aaa)想要连接访问电脑b(ip地址为192.168.0.bbb)的数据库: 对电脑a(ip地址为192.168.0.aaa): 在项目settings.py ...

  2. 图片哈希概论及python中如何实现对比两张相似的图片

    Google 以图搜图的原理,其中的获取图片 hash 值的方法就是 AHash. 每张图片都可以通过某种算法得到一个 hash 值,称为图片指纹,两张指纹相近的图片可以认为是相似图片. 以图搜图的原 ...

  3. 使用HBuilder创建图表

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. NLP采用Bert进行简单文本情感分类

    参照当Bert遇上Kerashttps://spaces.ac.cn/archives/6736此示例准确率达到95.5%+ https://github.com/CyberZHG/keras-ber ...

  5. 基于Zabbix 3.2.6版本的low-level-discover(lld)

    个人使用理解:      1.使用一个返回值是JSON的KEY,在Templates或者Hosts中创建一个Discovery规则.该key的返回值类似于: 索引key -- value 类型     ...

  6. linux下如何查询jdk的安装路径

    首先这个问题困扰了我很久,由于是新装的系统还不熟悉,配置java环境变量时很头疼,找不到JDK位置,还好google一波,发现了这个方法. 首先确保安装了JDK java -version java ...

  7. shell脚本中的数组

    以下命令,都是以数组array=("20150417" "20150416" "20150415")为例. 注意bash中只支持一维数组,没 ...

  8. json文件处理四个函数

    import json # json.dumps(json_dict,ensure_asscii = False)函数的使用,将字典转化为字符串 ensure_ascii=False将Unicode编 ...

  9. Python 实用爬虫-04-使用 BeautifulSoup 去水印下载 CSDN 博客图片

    Python 实用爬虫-04-使用 BeautifulSoup 去水印下载 CSDN 博客图片 其实没太大用,就是方便一些,因为现在各个平台之间的图片都不能共享,比如说在 CSDN 不能用简书的图片, ...

  10. LogHelper

    原文链接 public class LogHelper { static string strLogCOMPath = Directory.GetCurrentDirectory() + " ...