Skip to content

Commit

Permalink
hawk2.0更新
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventdesert committed Nov 13, 2016
1 parent a2d71e9 commit e9542a8
Show file tree
Hide file tree
Showing 25 changed files with 424 additions and 2,814 deletions.
677 changes: 0 additions & 677 deletions Bin/tn/cnext

This file was deleted.

1,700 changes: 0 additions & 1,700 deletions Bin/tn/tnpy.py

This file was deleted.

13 changes: 13 additions & 0 deletions Docs/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,16 @@
4. 目前还有性能问题,无法对文本做处理


## 2016年11月12日

1. (重大更新)增加代理设置

2. 为请求详情增加中文标签

3. 考虑为软件增加国际化服务

4. 改进严重错误:当设置父节点xpath添加属性时,可能会失败

5. 所有代码升级到.net 4.5,避免同时还需安装.NET 4.0

6.
3 changes: 2 additions & 1 deletion Hawk.Core/Connectors/SQLServerConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

namespace Hawk.Core.Connectors
{
[XFrmWork("SQLServer数据库", "提供SQLServer交互的数据库服务", "")]
// [XFrmWork("SQLServer数据库", "提供SQLServer交互的数据库服务", "")]
[XFrmWorkIgnore]
public class SQLServerConnector : DBConnectorBase
{
//用于连接sql server
Expand Down
4 changes: 3 additions & 1 deletion Hawk.Core/Hawk.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Hawk.Core</RootNamespace>
<AssemblyName>Hawk.Core</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -29,6 +30,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
Expand Down
Binary file modified Hawk.Core/Hawk.Core.suo
Binary file not shown.
1 change: 1 addition & 0 deletions Hawk.Core/Utils/ControlsExtended.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public static bool SafeInvoke<T>(Func<T> action, ref T result, LogType type = Lo
UIInvoke(() => { MessageBox.Show(str, "提示信息"); });
}
result = res;
return true;
}
catch (Exception ex)
{
Expand Down
19 changes: 18 additions & 1 deletion Hawk.Core/Utils/HttpHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,28 @@ private static MemoryStream GetMemoryStream(Stream streamResponse)
return _stream;
}



public static void SetRequest(HttpItem item, HttpWebRequest request, string desturl = null, string post = null)
{
var docu = item.GetHeaderParameter();
// 设置代理
//SetProxy(item);
if (item.ProxyPort == 0 || string.IsNullOrEmpty(item.ProxyIP))
{
//不需要设置
}
else
{
//设置代理服务器
var myProxy = new WebProxy(item.ProxyIP, item.ProxyPort);

//建议连接
myProxy.Credentials = new NetworkCredential(item.ProxyUserName, item.ProxyPassword);
//给当前请求对象
request.Proxy = myProxy;
//设置安全凭证
request.Credentials = CredentialCache.DefaultNetworkCredentials;
}
//请求方式Get或者Post
request.Method = item.Method.ToString();
request.Timeout = item.Timeout;
Expand Down
51 changes: 46 additions & 5 deletions Hawk.Core/Utils/HttpItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,34 @@ public HttpItem()
Allowautoredirect = true;
Encoding = EncodingType.Unknown;
Parameters = "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36";
ProxyPort = 18888;
}

[PropertyEditor("CodeEditor")]
[LocalizedCategory("1.请求设置")]
[LocalizedDisplayName("Header")]
[PropertyOrder(5)]
public string Parameters { get; set; }

[LocalizedCategory("2.代理设置")]
[LocalizedDisplayName("代理IP")]
[PropertyOrder(1)]
public string ProxyIP { get; set; }


[LocalizedCategory("2.代理设置")]
[LocalizedDisplayName("端口")]
[PropertyOrder(2)]
public int ProxyPort { get; set; }

[LocalizedCategory("2.代理设置")]
[LocalizedDisplayName("用户名")]
[PropertyOrder(3)]
public string ProxyUserName { get; set; }

[LocalizedCategory("2.代理设置")]
[LocalizedDisplayName("密码")]
[PropertyOrder(4)]
public string ProxyPassword { get; set; }

public static string HeaderToString(FreeDocument docu)
{
Expand Down Expand Up @@ -106,51 +127,71 @@ public FreeDocument GetHeaderParameter()
/// <summary>
/// 请求URL必须填写
/// </summary>
[Browsable(false)]
public string URL { get; set; }


/// <summary>
/// 请求方式默认为GET方式
/// </summary>
[LocalizedCategory("1.请求设置")]
[LocalizedDisplayName("请求方法")]
[PropertyOrder(1)]
public MethodType Method { get; set; }

/// <summary>
/// 默认请求超时时间
/// </summary>
[LocalizedCategory("1.请求设置")]
[LocalizedDisplayName("超时时间")]
[PropertyOrder(3)]
public int Timeout { get; set; }

/// <summary>
/// 默认写入Post数据超时间
/// </summary>
[Browsable(false)]
public int ReadWriteTimeout { get; set; }








/// <summary>
/// 返回数据编码默认为NUll,可以自动识别
/// </summary>
[LocalizedCategory("1.请求设置")]
[LocalizedDisplayName("请求编码")]
[LocalizedDescription("当页面出现乱码时,可选择切换UTF-8或GBK")]
[PropertyOrder(3)]
public EncodingType Encoding { get; set; }



/// <summary>
/// Post请求时要发送的Post数据
/// </summary>
///
[LocalizedCategory("1.请求设置")]
[LocalizedDisplayName("Post参数")]
[PropertyOrder(7)]
[PropertyEditor("CodeEditor")]
public string Postdata { get; set; }









/// <summary>
/// 支持跳转页面,查询结果将是跳转后的页面
/// </summary>
///
[LocalizedCategory("1.请求设置")]
[LocalizedDisplayName("自动重定向")]
[PropertyOrder(6)]
public bool Allowautoredirect { get; set; }


Expand Down
2 changes: 1 addition & 1 deletion Hawk.ETL.Controls/DataViewers/AboutAuthor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<TextBlock Text="buptzym@qq.com" Margin="29,108,160,243" FontSize="16" FontWeight="Bold"/>
<TextBlock Margin="29,143,160,208" FontSize="16"><Run Text="欢迎关注微信公共号:《"/><Run FontWeight="Bold" Text="沙漠之鹰"/><Run Text=""/></TextBlock>
<TextBlock Text="如果软件帮到了你,可以为开发者捐赠" Margin="29,193,160,158" FontSize="16"/>
<TextBlock Text="版本: 1.50" Margin="268,10,43,335" FontSize="24" FontWeight="Bold"/>
<TextBlock Text="版本: 2.0" Margin="268,10,43,335" FontSize="24" FontWeight="Bold"/>
</Grid>
</Grid>
</UserControl>
2 changes: 1 addition & 1 deletion Hawk.ETL.Controls/Hawk.ETL.Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Hawk.ETL.Controls</RootNamespace>
<AssemblyName>Hawk.ETL.Controls</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand Down
1 change: 0 additions & 1 deletion Hawk.ETL.Controls/SmartETLUI.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:loc="clr-namespace:Hawk"

xmlns:mvvm="clr-namespace:Hawk.Core.Utils.MVVM;assembly=Hawk.Core"
xmlns:themes="clr-namespace:Hawk.Core.Themes;assembly=Hawk.Core"
Expand Down
Loading

0 comments on commit e9542a8

Please sign in to comment.