### 2021-09-15更新
------ #### MyDb V3.0.2109.1501 - *.[新增]QuickWeb类的GetSize函数新增支持返回异常信息。 - *.[新增]MSSQL数据库操作新增对byte[]字段的支持。 #### MyDb_SQLite V3.0.2109.1501 - *.[新增]新增对byte[]字段的支持。 #### MyDb_MySQL V3.0.2109.1501 - *.[新增]新增对byte[]字段的支持。
This commit is contained in:
parent
83d0e095d5
commit
95bffb50bf
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -7498,6 +7498,13 @@
|
||||||
<param name="field"></param>
|
<param name="field"></param>
|
||||||
<param name="value"></param>
|
<param name="value"></param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Byte[])">
|
||||||
|
<summary>
|
||||||
|
添加byte[]字段
|
||||||
|
</summary>
|
||||||
|
<param name="field"></param>
|
||||||
|
<param name="value"></param>
|
||||||
|
</member>
|
||||||
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Boolean)">
|
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
添加bool字段
|
添加bool字段
|
||||||
|
@ -8150,6 +8157,14 @@
|
||||||
<param name="url"></param>
|
<param name="url"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:RyWeb.QuickWeb.GetSize(System.String,System.String@)">
|
||||||
|
<summary>
|
||||||
|
获取网址对应的文件大小
|
||||||
|
</summary>
|
||||||
|
<param name="url"></param>
|
||||||
|
<param name="errormsg"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="P:RyWeb.QuickWeb.UserAgent">
|
<member name="P:RyWeb.QuickWeb.UserAgent">
|
||||||
<summary>
|
<summary>
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -7498,6 +7498,13 @@
|
||||||
<param name="field"></param>
|
<param name="field"></param>
|
||||||
<param name="value"></param>
|
<param name="value"></param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Byte[])">
|
||||||
|
<summary>
|
||||||
|
添加byte[]字段
|
||||||
|
</summary>
|
||||||
|
<param name="field"></param>
|
||||||
|
<param name="value"></param>
|
||||||
|
</member>
|
||||||
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Boolean)">
|
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
添加bool字段
|
添加bool字段
|
||||||
|
@ -8150,6 +8157,14 @@
|
||||||
<param name="url"></param>
|
<param name="url"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:RyWeb.QuickWeb.GetSize(System.String,System.String@)">
|
||||||
|
<summary>
|
||||||
|
获取网址对应的文件大小
|
||||||
|
</summary>
|
||||||
|
<param name="url"></param>
|
||||||
|
<param name="errormsg"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="P:RyWeb.QuickWeb.UserAgent">
|
<member name="P:RyWeb.QuickWeb.UserAgent">
|
||||||
<summary>
|
<summary>
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -7471,6 +7471,13 @@
|
||||||
<param name="field"></param>
|
<param name="field"></param>
|
||||||
<param name="value"></param>
|
<param name="value"></param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Byte[])">
|
||||||
|
<summary>
|
||||||
|
添加byte[]字段
|
||||||
|
</summary>
|
||||||
|
<param name="field"></param>
|
||||||
|
<param name="value"></param>
|
||||||
|
</member>
|
||||||
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Boolean)">
|
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
添加bool字段
|
添加bool字段
|
||||||
|
@ -8123,6 +8130,14 @@
|
||||||
<param name="url"></param>
|
<param name="url"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:RyWeb.QuickWeb.GetSize(System.String,System.String@)">
|
||||||
|
<summary>
|
||||||
|
获取网址对应的文件大小
|
||||||
|
</summary>
|
||||||
|
<param name="url"></param>
|
||||||
|
<param name="errormsg"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="P:RyWeb.QuickWeb.UserAgent">
|
<member name="P:RyWeb.QuickWeb.UserAgent">
|
||||||
<summary>
|
<summary>
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -7471,6 +7471,13 @@
|
||||||
<param name="field"></param>
|
<param name="field"></param>
|
||||||
<param name="value"></param>
|
<param name="value"></param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Byte[])">
|
||||||
|
<summary>
|
||||||
|
添加byte[]字段
|
||||||
|
</summary>
|
||||||
|
<param name="field"></param>
|
||||||
|
<param name="value"></param>
|
||||||
|
</member>
|
||||||
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Boolean)">
|
<member name="M:ryCommonDb.RyQuickSQL.AddField(System.String,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
添加bool字段
|
添加bool字段
|
||||||
|
@ -8123,6 +8130,14 @@
|
||||||
<param name="url"></param>
|
<param name="url"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:RyWeb.QuickWeb.GetSize(System.String,System.String@)">
|
||||||
|
<summary>
|
||||||
|
获取网址对应的文件大小
|
||||||
|
</summary>
|
||||||
|
<param name="url"></param>
|
||||||
|
<param name="errormsg"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="P:RyWeb.QuickWeb.UserAgent">
|
<member name="P:RyWeb.QuickWeb.UserAgent">
|
||||||
<summary>
|
<summary>
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -1,4 +1,17 @@
|
||||||
### 2021-09-12更新
|
### 2021-09-15更新
|
||||||
|
------
|
||||||
|
#### MyDb V3.0.2109.1501
|
||||||
|
- *.[新增]QuickWeb类的GetSize函数新增支持返回异常信息。
|
||||||
|
- *.[新增]MSSQL数据库操作新增对byte[]字段的支持。
|
||||||
|
|
||||||
|
#### MyDb_SQLite V3.0.2109.1501
|
||||||
|
- *.[新增]新增对byte[]字段的支持。
|
||||||
|
|
||||||
|
#### MyDb_MySQL V3.0.2109.1501
|
||||||
|
|
||||||
|
- *.[新增]新增对byte[]字段的支持。
|
||||||
|
|
||||||
|
### 2021-09-12更新
|
||||||
------
|
------
|
||||||
#### ryControls V3.0.2109.1201
|
#### ryControls V3.0.2109.1201
|
||||||
- *.[改进]ObjectListView控件的AspectToStringConverter函数新增行数据参数。
|
- *.[改进]ObjectListView控件的AspectToStringConverter函数新增行数据参数。
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -5,49 +5,207 @@ using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace RySkins
|
namespace RySkins
|
||||||
{
|
{
|
||||||
|
[ComVisible(true)]
|
||||||
public partial class SKinForm : GMForm
|
public partial class SKinForm : GMForm
|
||||||
{
|
{
|
||||||
public SKinForm()
|
/// <summary>
|
||||||
|
/// 无参数启动
|
||||||
|
/// </summary>
|
||||||
|
public SKinForm() : base()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
public SKinForm(string[] args)
|
private IntPtr ActiveHandle = IntPtr.Zero;
|
||||||
|
protected override void OnCreateControl()
|
||||||
|
{
|
||||||
|
//ActiveHandle= ryCommon.RyForm.GetActiveWindow();
|
||||||
|
base.OnCreateControl();
|
||||||
|
InitForm();
|
||||||
|
}
|
||||||
|
protected override void OnHandleCreated(EventArgs e)
|
||||||
|
{
|
||||||
|
ActiveHandle = ryCommon.RyForm.GetActiveWindow();
|
||||||
|
base.OnHandleCreated(e);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 以参数方式启动
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="args"></param>
|
||||||
|
public SKinForm(string[] args) : base()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 以单参数方式启动
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="arg"></param>
|
||||||
|
public SKinForm(string arg) : base()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
private void InitForm()
|
||||||
|
{
|
||||||
|
if (this.Parent == null)
|
||||||
|
{
|
||||||
|
if (this.StartPosition == FormStartPosition.CenterParent)
|
||||||
|
{
|
||||||
|
var handle = ActiveHandle;
|
||||||
|
var parent_handle = WinAPI.User32.GetParent(Handle);
|
||||||
|
//var dd= this.ParentForm;
|
||||||
|
if (parent_handle == IntPtr.Zero) { parent_handle = handle; }
|
||||||
|
var forms = Application.OpenForms;
|
||||||
|
for (int i = 0; i < forms.Count; i++)
|
||||||
|
{
|
||||||
|
if (forms[i].Handle == handle)
|
||||||
|
{
|
||||||
|
ShowInCenter(forms[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this.StartPosition == FormStartPosition.CenterScreen)
|
||||||
|
{
|
||||||
|
ShowInCenter(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 显示在父窗体中间,如果没有父窗体,则显示在显示器中间
|
/// 显示在父窗体中间,如果没有父窗体,则显示在显示器中间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parent"></param>
|
/// <param name="parent"></param>
|
||||||
public void ShowInCenter(Form parent)
|
public void ShowInCenter(Form parent)
|
||||||
{
|
{
|
||||||
this.StartPosition = FormStartPosition.Manual;
|
ShowInCenter(this, parent);
|
||||||
var screen = Screen.FromControl(this);
|
}
|
||||||
if (parent==null) //如果没有父窗体,则显示在显示器中间
|
/// <summary>
|
||||||
|
/// 显示在父窗体中间,如果没有父窗体,则显示在显示器中间
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="CurForm"></param>
|
||||||
|
/// <param name="parent"></param>
|
||||||
|
public static void ShowInCenter(Form CurForm, Form parent)
|
||||||
|
{
|
||||||
|
CurForm.StartPosition = FormStartPosition.Manual;
|
||||||
|
var screen = Screen.FromControl(CurForm);
|
||||||
|
if (parent == null) //如果没有父窗体,则显示在显示器中间
|
||||||
{
|
{
|
||||||
Location = new Point((screen.WorkingArea.Width-Width)/2,(screen.WorkingArea.Height-Height)/2);
|
CurForm.Location = new Point((screen.WorkingArea.Width - CurForm.Width) / 2, (screen.WorkingArea.Height - CurForm.Height) / 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var x = parent.Left+(parent.Width - Width) / 2;
|
var x = parent.Left + (parent.Width - CurForm.Width) / 2;
|
||||||
var y =parent.Top+ (parent.Height - Height) / 2;
|
var y = parent.Top + (parent.Height - CurForm.Height) / 2;
|
||||||
if((x+Width)> screen.WorkingArea.X+ screen.WorkingArea.Width)
|
if ((x + CurForm.Width) > screen.WorkingArea.X + screen.WorkingArea.Width)
|
||||||
{
|
{
|
||||||
x = screen.WorkingArea.X + screen.WorkingArea.Width - Width;
|
x = screen.WorkingArea.X + screen.WorkingArea.Width - CurForm.Width;
|
||||||
}
|
}
|
||||||
if ((y + Height) > screen.WorkingArea.Y + screen.WorkingArea.Height)
|
if ((y + CurForm.Height) > screen.WorkingArea.Y + screen.WorkingArea.Height)
|
||||||
{
|
{
|
||||||
y = screen.WorkingArea.Y + screen.WorkingArea.Height - Height;
|
y = screen.WorkingArea.Y + screen.WorkingArea.Height - CurForm.Height;
|
||||||
}
|
}
|
||||||
Location = new Point(x, y);
|
CurForm.Location = new Point(x, y);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 激活窗体
|
||||||
|
/// </summary>
|
||||||
|
public void ActiveSkinForm()
|
||||||
|
{
|
||||||
|
ryCommon.RyForm.BringToTop(Handle);
|
||||||
|
ryCommon.RyForm.SetActiveWindow(Handle);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 显示窗体
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">指定要显示的窗体类型名</param>
|
||||||
|
public static void ShowForm(Type type)
|
||||||
|
{
|
||||||
|
RySkins.SKinForm form = (RySkins.SKinForm)Activator.CreateInstance(type);
|
||||||
|
form.Show();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 显示窗体
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">指定要显示的窗体类型名</param>
|
||||||
|
/// <param name="arg">参数</param>
|
||||||
|
public static void ShowForm(Type type, string arg)
|
||||||
|
{
|
||||||
|
RySkins.SKinForm form = (RySkins.SKinForm)Activator.CreateInstance(type, new object[] { arg });
|
||||||
|
form.Show();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 显示窗体
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">指定要显示的窗体类型名</param>
|
||||||
|
/// <param name="arg">参数</param>
|
||||||
|
public static void ShowForm(Type type, string[] arg)
|
||||||
|
{
|
||||||
|
RySkins.SKinForm form = (RySkins.SKinForm)Activator.CreateInstance(type, arg);
|
||||||
|
form.Show();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 显示模式窗体
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">指定要显示的窗体类型名</param>
|
||||||
|
/// <param name="arg">参数</param>
|
||||||
|
public static void ShowDialogForm(Type type, string[] arg)
|
||||||
|
{
|
||||||
|
RySkins.SKinForm form = (RySkins.SKinForm)Activator.CreateInstance(type, arg);
|
||||||
|
form.ShowDialog();
|
||||||
|
form.Dispose();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 显示窗体,如果当前已经显示过,则激活窗体。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">指定要显示的窗体类型名</param>
|
||||||
|
public static void ShowFormOne(Form parent, Type type)
|
||||||
|
{
|
||||||
|
ShowFormOne(parent, type, null);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 显示窗体,如果当前已经显示过,则激活窗体。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">指定要显示的窗体类型名</param>
|
||||||
|
/// <param name="arg">参数</param>
|
||||||
|
public static void ShowFormOne(Form parent, Type type, string[] arg)
|
||||||
|
{
|
||||||
|
var forms = Application.OpenForms;
|
||||||
|
for (int i = 0; i < forms.Count; i++)
|
||||||
|
{
|
||||||
|
if (forms[i].GetType() == type)
|
||||||
|
{
|
||||||
|
if (forms[i] is RySkins.SKinForm)
|
||||||
|
{
|
||||||
|
var skin_form = (RySkins.SKinForm)forms[i];
|
||||||
|
skin_form.ShowInCenter(parent);
|
||||||
|
skin_form.ActiveSkinForm();
|
||||||
|
skin_form.Show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
forms[i].Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Form form;
|
||||||
|
if (arg == null)
|
||||||
|
{ form = (Form)Activator.CreateInstance(type); }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
form = (Form)Activator.CreateInstance(type, arg);
|
||||||
|
}
|
||||||
|
ShowInCenter(form, parent);
|
||||||
|
ryCommon.RyForm.BringToTop(form.Handle);
|
||||||
|
ryCommon.RyForm.SetActiveWindow(form.Handle);
|
||||||
|
form.Show();
|
||||||
}
|
}
|
||||||
private void SKinForm_Load(object sender, EventArgs e)
|
private void SKinForm_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!this.DesignMode)
|
if (!this.DesignMode)
|
||||||
{ base.XTheme = new ThemeForm(); }
|
{ base.XTheme = new ThemeForm(); }
|
||||||
//Opacity = 0.97;
|
//Opacity = 0.97;
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,10 @@ namespace ryCommonDb
|
||||||
{
|
{
|
||||||
mySQL.AddField(col.ColumnName, ds.Tables[0].Rows[i][col].ToBool());
|
mySQL.AddField(col.ColumnName, ds.Tables[0].Rows[i][col].ToBool());
|
||||||
}
|
}
|
||||||
|
else if (col.DataType == typeof(byte[]))
|
||||||
|
{
|
||||||
|
mySQL.AddField(col.ColumnName, (byte[])ds.Tables[0].Rows[i][col]);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
list.Add(mySQL);
|
list.Add(mySQL);
|
||||||
|
|
|
@ -320,6 +320,10 @@ namespace ryCommonDb
|
||||||
{
|
{
|
||||||
tmpSQL += "[" + item.Field + "] [DATETIME],";
|
tmpSQL += "[" + item.Field + "] [DATETIME],";
|
||||||
}
|
}
|
||||||
|
else if (item.value is byte[])
|
||||||
|
{
|
||||||
|
tmpSQL += "[" + item.Field + "] [varbinary](max),";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
object[] param = null;
|
object[] param = null;
|
||||||
return ExecuteNonQuery(tmpSQL.Substring(0, tmpSQL.Length - 1) + ")", param);
|
return ExecuteNonQuery(tmpSQL.Substring(0, tmpSQL.Length - 1) + ")", param);
|
||||||
|
|
|
@ -152,6 +152,15 @@ namespace ryCommonDb
|
||||||
/// <param name="field"></param>
|
/// <param name="field"></param>
|
||||||
/// <param name="value"></param>
|
/// <param name="value"></param>
|
||||||
public void AddField(string field, decimal value)
|
public void AddField(string field, decimal value)
|
||||||
|
{
|
||||||
|
ListAdd(new SQLIitem(field, value));
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 添加byte[]字段
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="field"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
public void AddField(string field, byte[] value)
|
||||||
{
|
{
|
||||||
ListAdd(new SQLIitem(field, value));
|
ListAdd(new SQLIitem(field, value));
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,5 +32,5 @@ using System;
|
||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||||
// 方法是按如下所示使用“*”: :
|
// 方法是按如下所示使用“*”: :
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("3.0.2109.0801")]
|
[assembly: AssemblyVersion("3.0.2109.1501")]
|
||||||
[assembly: AssemblyFileVersion("3.0.2109.0801")]
|
[assembly: AssemblyFileVersion("3.0.2109.1501")]
|
|
@ -1,7 +1,9 @@
|
||||||
using DotNet4.Utilities;
|
using DotNet4.Utilities;
|
||||||
|
using ryCommon;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace RyWeb
|
namespace RyWeb
|
||||||
|
@ -65,7 +67,8 @@ namespace RyWeb
|
||||||
Timeout = Timeout,
|
Timeout = Timeout,
|
||||||
ReadWriteTimeout = Timeout,
|
ReadWriteTimeout = Timeout,
|
||||||
UserAgent = UserAgent,
|
UserAgent = UserAgent,
|
||||||
Referer=Referer
|
Referer=Referer,
|
||||||
|
KeepAlive = false
|
||||||
};
|
};
|
||||||
if (cookie.Length > 0)
|
if (cookie.Length > 0)
|
||||||
{
|
{
|
||||||
|
@ -97,6 +100,17 @@ namespace RyWeb
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public long GetSize(string url)
|
public long GetSize(string url)
|
||||||
{
|
{
|
||||||
|
return GetSize(url, out _);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获取网址对应的文件大小
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url"></param>
|
||||||
|
/// <param name="errormsg"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public long GetSize(string url,out string errormsg)
|
||||||
|
{
|
||||||
|
errormsg = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
HttpHelper t = new HttpHelper();
|
HttpHelper t = new HttpHelper();
|
||||||
|
@ -109,12 +123,27 @@ namespace RyWeb
|
||||||
Timeout = Timeout,
|
Timeout = Timeout,
|
||||||
ReadWriteTimeout = Timeout,
|
ReadWriteTimeout = Timeout,
|
||||||
UserAgent = UserAgent,
|
UserAgent = UserAgent,
|
||||||
Referer = Referer
|
Referer = Referer,
|
||||||
};
|
KeepAlive=false
|
||||||
|
};
|
||||||
HttpResult r = t.GetHtml(m);
|
HttpResult r = t.GetHtml(m);
|
||||||
if (r.StatusCode == System.Net.HttpStatusCode.OK)
|
if (r.StatusCode == System.Net.HttpStatusCode.OK)
|
||||||
{
|
{
|
||||||
return Convert.ToInt64(r.Header["Content-Length"]);
|
return GetContentLen();
|
||||||
|
}
|
||||||
|
else if (r.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||||
|
{
|
||||||
|
errormsg = "404错误";
|
||||||
|
return -404;
|
||||||
|
}
|
||||||
|
else if (r.StatusCode == System.Net.HttpStatusCode.Found)
|
||||||
|
{
|
||||||
|
return GetContentLen();
|
||||||
|
}
|
||||||
|
else if (r.StatusCode == 0)
|
||||||
|
{
|
||||||
|
errormsg = r.Html;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
else if (r.StatusCode == System.Net.HttpStatusCode.MethodNotAllowed)
|
else if (r.StatusCode == System.Net.HttpStatusCode.MethodNotAllowed)
|
||||||
{
|
{
|
||||||
|
@ -126,9 +155,29 @@ namespace RyWeb
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
long GetContentLen()
|
||||||
|
{
|
||||||
|
var size = r.Header["Content-Length"].ToInt64(0);
|
||||||
|
if (size == 0)
|
||||||
|
{
|
||||||
|
System.Net.ServicePointManager.DefaultConnectionLimit = 512;
|
||||||
|
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
|
||||||
|
request.AllowAutoRedirect = true;
|
||||||
|
request.Timeout = 3000;
|
||||||
|
request.ReadWriteTimeout = 3000;
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
long totalBytes = response.ContentLength;
|
||||||
|
return totalBytes;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
|
errormsg = ex.Message;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,7 +202,8 @@ namespace RyWeb
|
||||||
HttpItem m = new HttpItem()
|
HttpItem m = new HttpItem()
|
||||||
{
|
{
|
||||||
URL = url,
|
URL = url,
|
||||||
ContentType= "application/x-www-form-urlencoded"
|
ContentType= "application/x-www-form-urlencoded",
|
||||||
|
KeepAlive = false
|
||||||
};
|
};
|
||||||
if (cookie.Length>0)
|
if (cookie.Length>0)
|
||||||
{
|
{
|
||||||
|
@ -190,7 +240,8 @@ namespace RyWeb
|
||||||
HttpHelper t = new HttpHelper();
|
HttpHelper t = new HttpHelper();
|
||||||
HttpItem m = new HttpItem()
|
HttpItem m = new HttpItem()
|
||||||
{
|
{
|
||||||
URL = url
|
URL = url,
|
||||||
|
KeepAlive = false
|
||||||
};
|
};
|
||||||
if (cookie != "")
|
if (cookie != "")
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// 有关程序集的一般信息由以下
|
// 有关程序集的一般信息由以下
|
||||||
// 控制。更改这些特性值可修改
|
// 控制。更改这些特性值可修改
|
||||||
// 与程序集关联的信息。
|
// 与程序集关联的信息。
|
||||||
[assembly: AssemblyTitle("MyDb_MySQL")]
|
[assembly: AssemblyTitle("MyDb_MySQL")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("MyDb_MySQL")]
|
[assembly: AssemblyProduct("MyDb_MySQL")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
//将 ComVisible 设置为 false 将使此程序集中的类型
|
//将 ComVisible 设置为 false 将使此程序集中的类型
|
||||||
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
||||||
//请将此类型的 ComVisible 特性设置为 true。
|
//请将此类型的 ComVisible 特性设置为 true。
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||||
[assembly: Guid("631290d3-7cb8-4b62-833e-361c20a5f2e0")]
|
[assembly: Guid("631290d3-7cb8-4b62-833e-361c20a5f2e0")]
|
||||||
|
|
||||||
// 程序集的版本信息由下列四个值组成:
|
// 程序集的版本信息由下列四个值组成:
|
||||||
//
|
//
|
||||||
// 主版本
|
// 主版本
|
||||||
// 次版本
|
// 次版本
|
||||||
// 生成号
|
// 生成号
|
||||||
// 修订号
|
// 修订号
|
||||||
//
|
//
|
||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||||
// 方法是按如下所示使用“*”: :
|
// 方法是按如下所示使用“*”: :
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("3.0.2105.2201")]
|
[assembly: AssemblyVersion("3.0.2109.1501")]
|
||||||
[assembly: AssemblyFileVersion("3.0.2105.2201")]
|
[assembly: AssemblyFileVersion("3.0.2109.1501")]
|
|
@ -317,6 +317,10 @@ namespace ryCommonDb
|
||||||
{
|
{
|
||||||
tmpSQL += "[" + item.Field + "] [DATETIME],";
|
tmpSQL += "[" + item.Field + "] [DATETIME],";
|
||||||
}
|
}
|
||||||
|
else if (item.value is byte[])
|
||||||
|
{
|
||||||
|
tmpSQL += "[" + item.Field + "] [LONGBLOB],";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
object[] param = null;
|
object[] param = null;
|
||||||
return ExecuteNonQuery(tmpSQL.Substring(0, tmpSQL.Length - 1) + ")", param);
|
return ExecuteNonQuery(tmpSQL.Substring(0, tmpSQL.Length - 1) + ")", param);
|
||||||
|
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||||
// 方法是按如下所示使用“*”: :
|
// 方法是按如下所示使用“*”: :
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("3.0.2105.2201")]
|
[assembly: AssemblyVersion("3.0.2109.1501")]
|
||||||
[assembly: AssemblyFileVersion("3.0.2105.2201")]
|
[assembly: AssemblyFileVersion("3.0.2109.1501")]
|
|
@ -353,6 +353,10 @@ namespace ryCommonDb
|
||||||
{
|
{
|
||||||
Field = "[" + item.Field.TrimStart('[').TrimEnd(']') + "] DATETIME";
|
Field = "[" + item.Field.TrimStart('[').TrimEnd(']') + "] DATETIME";
|
||||||
}
|
}
|
||||||
|
else if (item.value is byte[])
|
||||||
|
{
|
||||||
|
Field = "[" + item.Field.TrimStart('[').TrimEnd(']') + "] BLOB";
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
object[] param = null;
|
object[] param = null;
|
||||||
|
@ -386,6 +390,10 @@ namespace ryCommonDb
|
||||||
{
|
{
|
||||||
tmpSQL += "[" + item.Field.TrimStart('[').TrimEnd(']') + "] DATETIME,";
|
tmpSQL += "[" + item.Field.TrimStart('[').TrimEnd(']') + "] DATETIME,";
|
||||||
}
|
}
|
||||||
|
else if (item.value is byte[])
|
||||||
|
{
|
||||||
|
tmpSQL += "[" + item.Field.TrimStart('[').TrimEnd(']') + "] BLOB,";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
object[] param = null;
|
object[] param = null;
|
||||||
return ExecuteNonQuery(tmpSQL.Substring(0, tmpSQL.Length - 1) + ")", param);
|
return ExecuteNonQuery(tmpSQL.Substring(0, tmpSQL.Length - 1) + ")", param);
|
||||||
|
|
|
@ -652,7 +652,7 @@ namespace BrightIdeasSoftware
|
||||||
this.Layout += new LayoutEventHandler(this.HandleLayout);
|
this.Layout += new LayoutEventHandler(this.HandleLayout);
|
||||||
this.ColumnWidthChanging += new ColumnWidthChangingEventHandler(this.HandleColumnWidthChanging);
|
this.ColumnWidthChanging += new ColumnWidthChangingEventHandler(this.HandleColumnWidthChanging);
|
||||||
this.ColumnWidthChanged += new ColumnWidthChangedEventHandler(this.HandleColumnWidthChanged);
|
this.ColumnWidthChanged += new ColumnWidthChangedEventHandler(this.HandleColumnWidthChanged);
|
||||||
|
base.ShowGroups = false;
|
||||||
base.View = View.Details;
|
base.View = View.Details;
|
||||||
base.FullRowSelect = true;
|
base.FullRowSelect = true;
|
||||||
// Turn on owner draw so that we are responsible for our own fates (and isolated from bugs in the underlying ListView)
|
// Turn on owner draw so that we are responsible for our own fates (and isolated from bugs in the underlying ListView)
|
||||||
|
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||||
// 方法是按如下所示使用“*”: :
|
// 方法是按如下所示使用“*”: :
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("3.0.2109.1201")]
|
[assembly: AssemblyVersion("3.0.2109.1301")]
|
||||||
[assembly: AssemblyFileVersion("3.0.2109.1201")]
|
[assembly: AssemblyFileVersion("3.0.2109.1301")]
|
Loading…
Reference in New Issue
Block a user