升级到.NET 4.6.2之前备份

This commit is contained in:
紫林软件 2023-12-04 09:26:23 +08:00
parent 4afd0f7c6f
commit 0e070635ae
22 changed files with 212 additions and 207 deletions

Binary file not shown.

BIN
Bin/Debug/VSoft/RaUI.dll Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
[VSoft]
hwnd=132806
hwnd=331696
width=745
height=543
[VSoft_Test]

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>

View File

@ -26,6 +26,7 @@ namespace DyLine
clsMsg ryMsg = new clsMsg();
ryMsg.SendMsgToryProcess(0, item);//向流程软件发送连接信息
}
}
}
}

View File

@ -30,7 +30,7 @@ namespace VSoftBox
{
ProcessPath = Application.StartupPath.Substring(0, Application.StartupPath.Length - sub_dir.Length);
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
Soft_Info.UserDataFolder = ProcessPath+"\\UserDb\\VSoft";
Soft_Info.UserDataFolder = ProcessPath+"\\UserDb\\Tools\\VSoft";
}
#endif
Application.EnableVisualStyles();

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2205.2701")]
[assembly: AssemblyFileVersion("1.0.2205.2701")]
[assembly: AssemblyVersion("1.0.2302.1501")]
[assembly: AssemblyFileVersion("1.0.2302.1501")]

View File

@ -1,49 +1,44 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// 对此文件的更改可能导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VSoftBox.Properties
{
namespace VSoftBox.Properties {
using System;
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// 一个强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VSoftBox.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
@ -52,18 +47,15 @@ namespace VSoftBox.Properties
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型资源类的资源查找。
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}

View File

@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VSoftBox.Properties
{
namespace VSoftBox.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}

View File

@ -8,9 +8,10 @@
<OutputType>WinExe</OutputType>
<RootNamespace>VSoftBox</RootNamespace>
<AssemblyName>VSoftBox</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -18,9 +19,10 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Bin\Debug\VSoft\</OutputPath>
<DefineConstants>TRACE;DEBUG;DY;TEST</DefineConstants>
<DefineConstants>TRACE;DEBUG;DY</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -30,18 +32,15 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>项目5.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="MyDb, Version=2.1.2011.901, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="RaUI, Version=4.0.2302.1401, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\Debug\VSoft\MyDb.dll</HintPath>
</Reference>
<Reference Include="ryControls, Version=2.1.2006.3001, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\Debug\VSoft\ryControls.dll</HintPath>
<HintPath>..\..\Bin\Debug\VSoft\RaUI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -66,7 +65,9 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>

View File

@ -52,7 +52,6 @@
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Menu修改分类 = new System.Windows.Forms.ToolStripMenuItem();
this.Menu删除分类 = new System.Windows.Forms.ToolStripMenuItem();
this.LblDrag = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.MenuTray = new System.Windows.Forms.ContextMenuStrip(this.components);
@ -222,15 +221,6 @@
this.Menu删除分类.Text = "删除分类";
this.Menu删除分类.Click += new System.EventHandler(this.Menu删除分类_Click);
//
// LblDrag
//
this.LblDrag.BackColor = System.Drawing.Color.Black;
this.LblDrag.Location = new System.Drawing.Point(123, 54);
this.LblDrag.Name = "LblDrag";
this.LblDrag.Size = new System.Drawing.Size(2, 89);
this.LblDrag.TabIndex = 6;
this.LblDrag.Visible = false;
//
// notifyIcon1
//
this.notifyIcon1.ContextMenuStrip = this.MenuTray;
@ -368,8 +358,8 @@
this.rySearch1.Name = "rySearch1";
this.rySearch1.Size = new System.Drawing.Size(142, 27);
this.rySearch1.TabIndex = 2;
this.rySearch1.OnSearch += new System.EventHandler(this.rySearch1_OnSearch);
this.rySearch1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.rySearch1_KeyDown);
this.rySearch1.OnSearch += new System.EventHandler(this.RySearch1_OnSearch);
this.rySearch1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RySearch1_KeyDown);
//
// panelEx1
//
@ -378,7 +368,6 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.panelEx1.BackColor = System.Drawing.Color.White;
this.panelEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(216)))), ((int)(((byte)(223)))));
this.panelEx1.Controls.Add(this.LblDrag);
this.panelEx1.Controls.Add(this.LblEmpty);
this.panelEx1.Controls.Add(this.IconViewEx1);
this.panelEx1.Location = new System.Drawing.Point(84, 65);
@ -388,7 +377,7 @@
this.panelEx1.Size = new System.Drawing.Size(656, 473);
this.panelEx1.TabIndex = 1;
this.panelEx1.TileBackColor = System.Drawing.Color.White;
this.panelEx1.Resize += new System.EventHandler(this.panelEx1_Resize);
this.panelEx1.Resize += new System.EventHandler(this.PanelEx1_Resize);
//
// LblEmpty
//
@ -663,7 +652,6 @@
private System.Windows.Forms.ToolStripMenuItem Menu修改分类;
private System.Windows.Forms.ToolStripMenuItem Menu删除分类;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.Label LblDrag;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.NotifyIcon notifyIcon1;

View File

@ -15,14 +15,16 @@ using System.Windows.Forms;
using VSoft.Config;
using VSoft.Prams;
using VSoft.Skins;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Header;
namespace VSoft
{
public partial class FrmVSoft : SKinForm
{
string[] prog_args;
string SQLConnStr = Itrycn_Db.SQLConnStr;
MouseHook mouse = new MouseHook();
readonly string[] prog_args;
readonly string SQLConnStr = Itrycn_Db.SQLConnStr;
readonly MouseHook mouse = new MouseHook();
public FrmVSoft(string[] args)
{
InitializeComponent();
@ -49,7 +51,7 @@ namespace VSoft
PnlLeft.BackColor = backcolor;
}
private ToolTip lvTp = new ToolTip();
private readonly System.Windows.Forms.ToolTip lvTp = new System.Windows.Forms.ToolTip();
private void FrmVSoft_FormClosed(object sender, FormClosedEventArgs e)
{
mouse.Stop();
@ -95,7 +97,8 @@ namespace VSoft
{
LoadDb(false);
}
Dictionary<string, Image> dictCacheImg = new Dictionary<string, Image>();
readonly Dictionary<string, Image> dictCacheImg = new Dictionary<string, Image>();
private void LoadDb(bool isSearch)
{
IconViewEx1.Items.Clear();
@ -292,6 +295,7 @@ namespace VSoft
SysFuns.WinHotReg hotkey;
private void FrmVSoft_Load(object sender, EventArgs e)
{
//IconViewEx1.SetInterval(100, 100);
Config.Soft_Config.MainForm = this;
MinimumSize = new Size(400, 200);
LblEmpty.Left =((panelEx1.Width - LblEmpty.Width) / 2);
@ -464,16 +468,18 @@ namespace VSoft
if (ds.HaveData())
{
DataRow row = ds.GetFirstRowData();
SoftInfo info = new SoftInfo();
info.Id = row["id"].ToInt();
info.SoftType = row["SoftType"].ToInt();
info.ColumnId = row["ColumnId"].ToInt();
info.Name = row["Name"].ToString();
info.Path = row["Path"].ToString();
info.RunPram = row["RunPram"].ToString();
info.SetJson = row["SetJson"].ToString();
info.StartPath = row["StartPath"].ToString();
info.IconPath = row["IconPath"].ToString();
SoftInfo info = new SoftInfo
{
Id = row["id"].ToInt(),
SoftType = row["SoftType"].ToInt(),
ColumnId = row["ColumnId"].ToInt(),
Name = row["Name"].ToString(),
Path = row["Path"].ToString(),
RunPram = row["RunPram"].ToString(),
SetJson = row["SetJson"].ToString(),
StartPath = row["StartPath"].ToString(),
IconPath = row["IconPath"].ToString()
};
VSoft.Prams.Run.Open(info, false);
}
db.Free();
@ -561,7 +567,7 @@ namespace VSoft
}
}
private void rySearch1_OnSearch(object sender, EventArgs e)
private void RySearch1_OnSearch(object sender, EventArgs e)
{
if(rySearch1.Text.Length==0)
{
@ -597,8 +603,10 @@ namespace VSoft
}
private void BtnAddColumn_Click(object sender, EventArgs e)
{
FrmAddColumn frm = new FrmAddColumn();
frm.TopMost = TopMost;
FrmAddColumn frm = new FrmAddColumn
{
TopMost = TopMost
};
frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK)
{
@ -621,9 +629,11 @@ namespace VSoft
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (TabList_Column.SelectedItems.Count == 0) { return; }
FrmAddColumn frm = new FrmAddColumn();
frm.TopMost = TopMost;
frm.IsAdd = 0;
FrmAddColumn frm = new FrmAddColumn
{
TopMost = TopMost,
IsAdd = 0
};
frm.GetInfo(TabList_Column.SelectedItems[0].Tag.ToInt());
frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK)
@ -708,9 +718,11 @@ namespace VSoft
return;
}
var id = TabList_Column.SelectedItems[0].Tag.ToInt();
FrmAddType frm = new FrmAddType();
frm.TopMost = TopMost;
frm.ParentId = id;
FrmAddType frm = new FrmAddType
{
TopMost = TopMost,
ParentId = id
};
frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK)
{
@ -752,9 +764,11 @@ namespace VSoft
Msg.ShowMsg("默认分类不支持修改", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
FrmAddType frm = new FrmAddType();
frm.TopMost = TopMost;
frm.IsAdd = 0;
FrmAddType frm = new FrmAddType
{
TopMost = TopMost,
IsAdd = 0
};
frm.GetInfo(id);
frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK)
@ -895,9 +909,11 @@ namespace VSoft
Msg.ShowMsg("当前模式下不支持添加软件。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
FrmAddSoft frm = new FrmAddSoft();
frm.TopMost = TopMost;
frm.ColumnId = ColumnId;
FrmAddSoft frm = new FrmAddSoft
{
TopMost = TopMost,
ColumnId = ColumnId
};
frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK)
{
@ -912,10 +928,12 @@ namespace VSoft
{
if (IconViewEx1.SelectedItems.Count == 0) { return; }
var info = (SoftInfo)IconViewEx1.SelectedItems[0].Tag;
FrmAddSoft frm = new FrmAddSoft();
frm.TopMost = TopMost;
frm.SelectId = info.Id;
frm.IsAdd = 0;
FrmAddSoft frm = new FrmAddSoft
{
TopMost = TopMost,
SelectId = info.Id,
IsAdd = 0
};
frm.GetInfo(info.Id);
frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK)
@ -1089,8 +1107,6 @@ namespace VSoft
private void IconViewEx1_DragEnter(object sender, DragEventArgs e)
{
LblDrag.Height = IconViewEx1.TileSize.Height;
LblDrag.Parent = IconViewEx1;
ListViewItem lvi = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
if (lvi != null)
{
@ -1104,7 +1120,6 @@ namespace VSoft
}
private void IconViewEx1_DragDrop(object sender, DragEventArgs e)
{
LblDrag.Visible = false;
var filedrop = e.Data.GetData(DataFormats.FileDrop);
if (filedrop != null)
{
@ -1141,6 +1156,7 @@ namespace VSoft
var pram = "";
var StartPath = "";
var des = "";
var icon = "";
var name = System.IO.Path.GetFileNameWithoutExtension(path);
if (System.IO.Path.GetExtension(path).ToLower() == ".lnk")
{
@ -1148,6 +1164,10 @@ namespace VSoft
path = shortcut.TargetPath;
pram = shortcut.Arguments;
StartPath = shortcut.WorkDir;
if(shortcut.IconLocation!= path)
{
icon = shortcut.IconLocation;
}
des = shortcut.Description;
}
else
@ -1160,7 +1180,7 @@ namespace VSoft
mySQL.AddField("Path", path);
mySQL.AddField("RunPram", pram);
mySQL.AddField("StartPath", StartPath);//起始路径
mySQL.AddField("IconPath", "");//图标路径
mySQL.AddField("IconPath", icon);//图标路径
Json json = new Json("");
json.Add("RunAsAdmin", false);
mySQL.AddField("SetJson", json.Text);//设置
@ -1173,16 +1193,18 @@ namespace VSoft
mySQL.AddField("sortindex", Itrycn_Db.GetSoftCount(db3, ColumnId) + 1);
mySQL.AddField("addTime", DateTime.Now);
var ds = db3.ReadData(mySQL.GetInsertSQL() + ";select last_insert_rowid();", mySQL);
SoftInfo info = new SoftInfo();
info.Id = ds.Tables[0].Rows[0][0].ToInt();
info.SoftType = 0;
info.ColumnId = ColumnId;
info.Name = name;
info.Path = path;
info.RunPram = pram;
info.SetJson = json.Text;
info.StartPath = StartPath;
info.IconPath = "";
SoftInfo info = new SoftInfo
{
Id = ds.Tables[0].Rows[0][0].ToInt(),
SoftType = 0,
ColumnId = ColumnId,
Name = name,
Path = path,
RunPram = pram,
SetJson = json.Text,
StartPath = StartPath,
IconPath = ""
};
string img_path = info.TruePath;
if (dictCacheImg.ContainsKey(img_path))
{
@ -1203,6 +1225,9 @@ namespace VSoft
Point pt;
pt = ((IconViewEx)(sender)).PointToClient(new Point(e.X, e.Y));
var to_item = IconViewEx1.GetItemAt(pt.X, pt.Y);
IconViewEx1.InsertionMark.Index = -1;
TabList_Type.InsertionMark.Index = -1;
TabList_Column.InsertionMark.Index = -1;
if (to_item == null) { return; }
//获得拖放中的项
ListViewItem lvi = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
@ -1224,53 +1249,61 @@ namespace VSoft
}
private void IconViewEx1_DragOver(object sender, DragEventArgs e)
{
ListViewItem item = null;
if (sender is IconViewEx)
if (sender is IconViewEx list)
{
var filedrop = e.Data.GetData(DataFormats.FileDrop);
if (filedrop != null) {
if (LblDrag.Visible) { LblDrag.Visible = false; }
if (filedrop != null)
{
list.InsertionMark.Index = -1;
return;
}
var lvi = e.Data.GetData(typeof(ListViewItem));
if(lvi==null)
if (lvi == null)
{
if (LblDrag.Visible) { LblDrag.Visible = false; }
list.InsertionMark.Index = -1;
return;
}
else
{
var lvi2 = (ListViewItem)lvi;
if(lvi2.ListView!=IconViewEx1)
if (lvi2.ListView != IconViewEx1)
{
if (LblDrag.Visible){LblDrag.Visible = false;}
list.InsertionMark.Index = -1;
return;
}
}
var list = ((IconViewEx)(sender));
var pt = list.PointToClient(new Point(e.X, e.Y));
item = list.GetItemAt(pt.X, pt.Y);
}
else if (sender is TabList)
int targetIndex = list.InsertionMark.NearestIndex(pt);
if (targetIndex > -1)
{
var list = ((TabList)(sender));
var pt = list.PointToClient(new Point(e.X, e.Y));
item = list.GetItemAt(pt.X, pt.Y);
}
if (item == null)
// Determine whether the mouse pointer is to the left or
// the right of the midpoint of the closest item and set
// the InsertionMark.AppearsAfterItem property accordingly.
Rectangle itemBounds = list.GetItemRect(targetIndex);
if (pt.X > itemBounds.Left + (itemBounds.Width / 2))
{
if (LblDrag.Visible)
{
LblDrag.Visible = false;
}
list.InsertionMark.AppearsAfterItem = true;
}
else
{
if (!LblDrag.Visible)
{
LblDrag.Visible = true;
list.InsertionMark.AppearsAfterItem = false;
}
LblDrag.Location = item.Position;
}
list.InsertionMark.Index = targetIndex;
list.InsertionMark.Color = Color.Black; ;
//item = list.GetItemAt(pt.X, pt.Y);
}
else if (sender is TabList list2)
{
var pt = list2.PointToClient(new Point(e.X, e.Y));
int targetIndex = list2.InsertionMark.NearestIndex(pt);
if (targetIndex > -1)
{
// Rectangle itemBounds = list2.GetItemRect(targetIndex);
list2.InsertionMark.AppearsAfterItem = false;
}
list2.InsertionMark.Index = targetIndex;
list2.InsertionMark.Color = Color.Black; ;
}
}
#endregion
@ -1281,15 +1314,15 @@ namespace VSoft
ListViewItem lvi = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
if (lvi != null)
{
LblDrag.Height = TabList_Column.TileSize.Height;
LblDrag.Parent = TabList_Column;
e.Effect = DragDropEffects.Move;
}
}
private void TabList_Column_DragDrop(object sender, DragEventArgs e)
{
LblDrag.Visible = false;
Point pt;
IconViewEx1.InsertionMark.Index = -1;
TabList_Type.InsertionMark.Index = -1;
TabList_Column.InsertionMark.Index = -1;
pt = ((TabList)(sender)).PointToClient(new Point(e.X, e.Y));
var item = TabList_Column.GetItemAt(pt.X, pt.Y);
if (item == null) { return; }
@ -1368,16 +1401,16 @@ namespace VSoft
ListViewItem lvi = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
if (lvi != null)
{
LblDrag.Height = TabList_Type.TileSize.Height;
LblDrag.Parent = TabList_Type;
e.Effect = DragDropEffects.Move;
}
}
private void TabList_Type_DragDrop(object sender, DragEventArgs e)
{
LblDrag.Visible = false;
Point pt;
IconViewEx1.InsertionMark.Index = -1;
TabList_Type.InsertionMark.Index = -1;
TabList_Column.InsertionMark.Index = -1;
pt = ((TabList)(sender)).PointToClient(new Point(e.X, e.Y));
var item = TabList_Type.GetItemAt(pt.X, pt.Y);
if (item == null) { return; }
@ -1521,9 +1554,11 @@ namespace VSoft
private void ShowSetting(bool ShowInScreenCenter)
{
hotkey.Enabled = false;
FrmSetting frm = new FrmSetting();
frm.TopMost = TopMost;
if(!ShowInScreenCenter)
FrmSetting frm = new FrmSetting
{
TopMost = TopMost
};
if (!ShowInScreenCenter)
{
frm.ShowInCenter(this);
}
@ -1591,7 +1626,7 @@ namespace VSoft
}
}
private void rySearch1_KeyDown(object sender, KeyEventArgs e)
private void RySearch1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Down)
{
@ -1649,8 +1684,10 @@ namespace VSoft
Msg.ShowMsg("当前模式下不支持添加软件。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
FrmInCMD frm = new FrmInCMD();
frm.TopMost = TopMost;
FrmInCMD frm = new FrmInCMD
{
TopMost = TopMost
};
frm.ShowInCenter(this);
if (frm.ShowDialog()==DialogResult.OK)
{
@ -1749,7 +1786,7 @@ namespace VSoft
}
private void panelEx1_Resize(object sender, EventArgs e)
private void PanelEx1_Resize(object sender, EventArgs e)
{
// LblEmpty.Left = panelEx1.Left + ((panelEx1.Width - LblEmpty.Width) / 2);
}

View File

@ -124,7 +124,7 @@
<data name="以管理员方式启动ToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAAYRJREFUOE+NkztPwlAUx8/gakIYWFwYHB1w8FUQCEpI1KiTYpSHQVQisviYjZsJ
wAAADsABataJCQAAAYRJREFUOE+NkztPwlAUx8/gakIYWFwYHB1w8FUQCEpI1KiTYpSHQVQisviYjZsJ
k4OJMT6ILhgTFheDiongc4AP4HdgcO/xnPZWaG81/JN/Qu49v1972wJ2iUQiQWqFiqL82yO2/w4Nuann
DA3MrqMrWcDaSRB30uOGiPfcYrwVWuQr1HnIPxXFnsQxQvYDYeMd1Scf1Yt3hwGMz4UNEc9WBK4JsHfx
AJ0r1wibBAoYMizwolpR9D6OYOPCh5f7AU0kcF0AuU8JhsybCVYfhvXeD9kIbGBYEwILrJYHZYEzVZRg
@ -137,7 +137,7 @@
<data name="新增内置功能ToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAAIpJREFUOE/tktEGxDAQRef/v6NLly5dQpfQtSXkixJJHu661R36NC/70NJhiDnH
wAAADsABataJCQAAAIpJREFUOE/tktEGxDAQRef/v6NLly5dQpfQtSXkixJJHu661R36NC/70NJhiDnH
mImRv0SMESEELJ8F73mG9x6vacKGTS6ErbVdOudUsLiwM4s55zX5fo6jChYXjvUTUkqoteIxDCpYXLgT
BSZhKQX3vlfB4sIP4U4ci50Jb12ngsUPENcdnPsORL5USPZgYQ6cHAAAAABJRU5ErkJggg==
</value>
@ -182,7 +182,7 @@
<data name="IconViewEx1.Icon" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
EAAACxABrSO9dQAABvRJREFUeF7tnE2IHEUUxwcjIjkE1JMREnMWD7phd7uzfuBJEPSkd0+55BLQc9ds
DwAACw8BkvkDpQAABvRJREFUeF7tnE2IHEUUxwcjIjkE1JMREnMWD7phd7uzfuBJEPSkd0+55BLQc9ds
ooIXT+bix8kgbtSYgxA1hsWLImLAPYTEXBRUNGiMEojpnpTvdWpIT2/Nm+6e7uqerv+DH0tPVfVs7/t1
ffTHDopEoPS9QTQ6FKrkbKjiC/TzCqFBp6CcpLk5G6h4GK7rYKD0HSaF1WL5iN4XqOR4ECU3cl8GFoAg
ii8eWNePmXQWjyWld4ZRcox2kuR3ChYPOonfeVLpu0165TgQ6d3UlWzZdgQWF+oNvufcmjTbIzyq99KZ

View File

@ -90,7 +90,7 @@ namespace VSoft.Prams
{
case DialogResult.Yes:
SHEmptyRecycleBin(IntPtr.Zero, "", SHERB_NOCONFIRMATION + SHERB_NOPROGRESSUI + SHERB_NOSOUND);
return 1;
return 37;
}
break;
case "trans"://翻译
@ -98,7 +98,7 @@ namespace VSoft.Prams
{
RyForm.ShowOne(new Tools.FrmTrans());
}));
break;
return 37;
}
return 0;
}

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2211.3001")]
[assembly: AssemblyFileVersion("1.0.2211.3001")]
[assembly: AssemblyVersion("1.0.2310.2401")]
[assembly: AssemblyFileVersion("1.0.2310.2401")]

View File

@ -19,7 +19,7 @@ namespace VSoft.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@ -47,8 +47,8 @@ namespace VSoft.Properties {
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {

View File

@ -39,26 +39,16 @@ namespace VSoft.Tools
string salt = rd.Next(100000).ToString();
// 改成您的密钥
string secretKey = "l6ngE7GjtdvRESJqQzDL";
RyWeb.QuickWeb web = new RyWeb.QuickWeb();
string sign = EncryptString(appId + q + salt + secretKey);
string url = "http://api.fanyi.baidu.com/api/trans/vip/translate?";
url += "q=" + RyWeb.WebDecode.UrlEncode(q);
url += "&from=" + from;
url += "&to=" + to;
url += "&appid=" + appId;
url += "&salt=" + salt;
url += "&sign=" + sign;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "GET";
request.ContentType = "text/html;charset=UTF-8";
request.UserAgent = null;
request.Timeout = 6000;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream myResponseStream = response.GetResponseStream();
StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
string retString = myStreamReader.ReadToEnd();
myStreamReader.Close();
myResponseStream.Close();
JObject jo = JObject.Parse(retString);
string post_data = "q=" + web.UrlEncode(q);
post_data += "&from=" + from;
post_data += "&to=" + to;
post_data += "&appid=" + appId;
post_data += "&salt=" + salt;
post_data += "&sign=" + sign;
var http= web.Post("http://api.fanyi.baidu.com/api/trans/vip/translate", post_data);
JObject jo = JObject.Parse(http.Html);
var trans_result = jo["trans_result"];
if (trans_result != null)
{

View File

@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VSoft</RootNamespace>
<AssemblyName>VSoft</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -22,6 +23,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -30,24 +32,16 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="MyDb, Version=2.1.2005.1901, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\Debug\VSoft\MyDb.dll</HintPath>
</Reference>
<Reference Include="MyDb_SQLite">
<HintPath>..\..\Bin\Debug\VSoft\MyDb_SQLite.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\Debug\VSoft\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="ryControls">
<HintPath>..\..\Bin\Debug\VSoft\ryControls.dll</HintPath>
</Reference>
<Reference Include="ryUpdate">
<HintPath>..\..\Bin\Debug\VSoft\ryUpdate.dll</HintPath>
<Reference Include="RaUI, Version=4.0.2302.1401, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\Debug\VSoft\RaUI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />