commit d04709fe5f19b9c634ba326986da82af7519b437 Author: AndySkaura Date: Thu Jan 25 11:23:39 2024 +0800 init diff --git a/wcfHttpForm/.vs/wcfHttpForm/FileContentIndex/00a1fa23-2364-4749-aa4a-02cde7f4c209.vsidx b/wcfHttpForm/.vs/wcfHttpForm/FileContentIndex/00a1fa23-2364-4749-aa4a-02cde7f4c209.vsidx new file mode 100644 index 0000000..6380956 Binary files /dev/null and b/wcfHttpForm/.vs/wcfHttpForm/FileContentIndex/00a1fa23-2364-4749-aa4a-02cde7f4c209.vsidx differ diff --git a/wcfHttpForm/.vs/wcfHttpForm/FileContentIndex/29e3a297-8aee-4c32-9b62-706b911470bd.vsidx b/wcfHttpForm/.vs/wcfHttpForm/FileContentIndex/29e3a297-8aee-4c32-9b62-706b911470bd.vsidx new file mode 100644 index 0000000..8039902 Binary files /dev/null and b/wcfHttpForm/.vs/wcfHttpForm/FileContentIndex/29e3a297-8aee-4c32-9b62-706b911470bd.vsidx differ diff --git a/wcfHttpForm/.vs/wcfHttpForm/FileContentIndex/945309ff-bbab-44e2-ab5d-32b986473e54.vsidx b/wcfHttpForm/.vs/wcfHttpForm/FileContentIndex/945309ff-bbab-44e2-ab5d-32b986473e54.vsidx new file mode 100644 index 0000000..f057f72 Binary files /dev/null and b/wcfHttpForm/.vs/wcfHttpForm/FileContentIndex/945309ff-bbab-44e2-ab5d-32b986473e54.vsidx differ diff --git a/wcfHttpForm/.vs/wcfHttpForm/config/applicationhost.config b/wcfHttpForm/.vs/wcfHttpForm/config/applicationhost.config new file mode 100644 index 0000000..7a99442 --- /dev/null +++ b/wcfHttpForm/.vs/wcfHttpForm/config/applicationhost.config @@ -0,0 +1,1025 @@ + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wcfHttpForm/.vs/wcfHttpForm/v16/.suo b/wcfHttpForm/.vs/wcfHttpForm/v16/.suo new file mode 100644 index 0000000..8045b97 Binary files /dev/null and b/wcfHttpForm/.vs/wcfHttpForm/v16/.suo differ diff --git a/wcfHttpForm/.vs/wcfHttpForm/v17/.suo b/wcfHttpForm/.vs/wcfHttpForm/v17/.suo new file mode 100644 index 0000000..daa192b Binary files /dev/null and b/wcfHttpForm/.vs/wcfHttpForm/v17/.suo differ diff --git a/wcfHttpForm/App.config b/wcfHttpForm/App.config new file mode 100644 index 0000000..048c5ba --- /dev/null +++ b/wcfHttpForm/App.config @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wcfHttpForm/MessageInspector.cs b/wcfHttpForm/MessageInspector.cs new file mode 100644 index 0000000..d2effeb --- /dev/null +++ b/wcfHttpForm/MessageInspector.cs @@ -0,0 +1,178 @@ +using System; +using System.ServiceModel; +using System.ServiceModel.Channels; +using System.ServiceModel.Description; +using System.ServiceModel.Dispatcher; + +public class MessageInspector : IDispatchMessageInspector +{ + + + private ServiceEndpoint _serviceEndpoint; + + + public MessageInspector(ServiceEndpoint serviceEndpoint) + { + _serviceEndpoint = serviceEndpoint; + } + + + /// + /// Called when an inbound message been received + /// + /// The request message. + /// The incoming channel. + /// The current service instance. + /// + /// The object used to correlate stateMsg. + /// This object is passed back in the method. + /// + public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext) + { + StateMessage stateMsg = null; + HttpRequestMessageProperty requestProperty = null; + if (request.Properties.ContainsKey(HttpRequestMessageProperty.Name)) + { + requestProperty = request.Properties[HttpRequestMessageProperty.Name] + as HttpRequestMessageProperty; + } + + + if (requestProperty != null) + { + var origin = requestProperty.Headers["Origin"]; + if (!string.IsNullOrEmpty(origin)) + { + stateMsg = new StateMessage(); + // if a cors options request (preflight) is detected, + // we create our own reply message and don't invoke any + // operation at all. + if (requestProperty.Method == "OPTIONS") + { + stateMsg.Message = Message.CreateMessage(request.Version, null); + } + request.Properties.Add("CrossOriginResourceSharingState", stateMsg); + } + } + + + return stateMsg; + } + + + + + /// + /// Called after the operation has returned but before the reply message + /// is sent. + /// + /// The reply message. This value is null if the + /// operation is one way. + /// The correlation object returned from + /// the method. + public void BeforeSendReply(ref Message reply, object correlationState) + { + var stateMsg = correlationState as StateMessage; + + + if (stateMsg != null) + { + if (stateMsg.Message != null) + { + reply = stateMsg.Message; + } + + + HttpResponseMessageProperty responseProperty = null; + + + if (reply.Properties.ContainsKey(HttpResponseMessageProperty.Name)) + { + responseProperty = reply.Properties[HttpResponseMessageProperty.Name] + as HttpResponseMessageProperty; + } + + + if (responseProperty == null) + { + responseProperty = new HttpResponseMessageProperty(); + reply.Properties.Add(HttpResponseMessageProperty.Name, + responseProperty); + } + + + // Access-Control-Allow-Origin should be added for all cors responses + responseProperty.Headers.Set("Access-Control-Allow-Origin", "*"); + + + if (stateMsg.Message != null) + { + // the following headers should only be added for OPTIONS requests + responseProperty.Headers.Set("Access-Control-Allow-Methods", + "POST, OPTIONS, GET"); + responseProperty.Headers.Set("Content-Type", "application/json"); + responseProperty.Headers.Set("Access-Control-Allow-Headers", + "Content-Type, Accept, Authorization, x-requested-with"); + } + } + } +} + + +class StateMessage +{ + public Message Message; +} + + + + +public class BehaviorAttribute : Attribute, IEndpointBehavior, IOperationBehavior +{ + public void Validate(ServiceEndpoint endpoint) { } + + + public void AddBindingParameters(ServiceEndpoint endpoint, + BindingParameterCollection bindingParameters) + { } + + + /// + /// This service modify or extend the service across an endpoint. + /// + /// The endpoint that exposes the contract. + /// The endpoint dispatcher to be + /// modified or extended. + public void ApplyDispatchBehavior(ServiceEndpoint endpoint, + EndpointDispatcher endpointDispatcher) + { + // add inspector which detects cross origin requests + endpointDispatcher.DispatchRuntime.MessageInspectors.Add( + new MessageInspector(endpoint)); + } + + + public void ApplyClientBehavior(ServiceEndpoint endpoint, + ClientRuntime clientRuntime) + { } + + + public void Validate(OperationDescription operationDescription) { } + + + public void ApplyDispatchBehavior(OperationDescription operationDescription, + DispatchOperation dispatchOperation) + { } + + + public void ApplyClientBehavior(OperationDescription operationDescription, + ClientOperation clientOperation) + { } + + + public void AddBindingParameters(OperationDescription operationDescription, + BindingParameterCollection bindingParameters) + { } + + +} diff --git a/wcfHttpForm/Program.cs b/wcfHttpForm/Program.cs new file mode 100644 index 0000000..d4f80d7 --- /dev/null +++ b/wcfHttpForm/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WCF_FORM +{ + static class Program + { + /// + /// 应用程序的主入口点。 + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new mainForm()); + } + } +} diff --git a/wcfHttpForm/Properties/AssemblyInfo.cs b/wcfHttpForm/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e307d9f --- /dev/null +++ b/wcfHttpForm/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("wcfHttpForm")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("wcfHttpForm")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("fab24927-63bd-4829-950c-882a5b3248b3")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/wcfHttpForm/Properties/Resources.Designer.cs b/wcfHttpForm/Properties/Resources.Designer.cs new file mode 100644 index 0000000..f83c8ea --- /dev/null +++ b/wcfHttpForm/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace wcfHttpForm.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [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 { + + 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() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("wcfHttpForm.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/wcfHttpForm/Properties/Resources.resx b/wcfHttpForm/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/wcfHttpForm/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/wcfHttpForm/Properties/Settings.Designer.cs b/wcfHttpForm/Properties/Settings.Designer.cs new file mode 100644 index 0000000..c67693f --- /dev/null +++ b/wcfHttpForm/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace wcfHttpForm.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.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 { + return defaultInstance; + } + } + } +} diff --git a/wcfHttpForm/Properties/Settings.settings b/wcfHttpForm/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/wcfHttpForm/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/wcfHttpForm/UpgradeLog.htm b/wcfHttpForm/UpgradeLog.htm new file mode 100644 index 0000000..1d499a0 Binary files /dev/null and b/wcfHttpForm/UpgradeLog.htm differ diff --git a/wcfHttpForm/UpgradeLog2.htm b/wcfHttpForm/UpgradeLog2.htm new file mode 100644 index 0000000..d832b9b --- /dev/null +++ b/wcfHttpForm/UpgradeLog2.htm @@ -0,0 +1,273 @@ + + + + 迁移报告 +

+ 迁移报告 -

\ No newline at end of file diff --git a/wcfHttpForm/UpgradeLog3.htm b/wcfHttpForm/UpgradeLog3.htm new file mode 100644 index 0000000..50b2584 --- /dev/null +++ b/wcfHttpForm/UpgradeLog3.htm @@ -0,0 +1,268 @@ + + + + 迁移报告 +

+ 迁移报告 -

\ No newline at end of file diff --git a/wcfHttpForm/UpgradeLog4.htm b/wcfHttpForm/UpgradeLog4.htm new file mode 100644 index 0000000..50b2584 --- /dev/null +++ b/wcfHttpForm/UpgradeLog4.htm @@ -0,0 +1,268 @@ + + + + 迁移报告 +

+ 迁移报告 -

\ No newline at end of file diff --git a/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/wcfHttpForm.exe.config.deploy b/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/wcfHttpForm.exe.config.deploy new file mode 100644 index 0000000..048c5ba --- /dev/null +++ b/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/wcfHttpForm.exe.config.deploy @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/wcfHttpForm.exe.deploy b/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/wcfHttpForm.exe.deploy new file mode 100644 index 0000000..56779b9 Binary files /dev/null and b/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/wcfHttpForm.exe.deploy differ diff --git a/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/wcfHttpForm.exe.manifest b/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/wcfHttpForm.exe.manifest new file mode 100644 index 0000000..b9b69cb --- /dev/null +++ b/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/wcfHttpForm.exe.manifest @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + e5NLWwnOJ4cMWqOtbCMZadP+eT4dLRgPaOYStYZaWHw= + + + + + + + + + + + + dj3xwXKKrdL0/KL2cf2PTPWUfamwp7553Snik4ZywQc= + + + + + + + + + + x1UHmrCI86ad5HlmSSV8YhMDNA5i/qiZgwolh4RIVnc= + + + \ No newline at end of file diff --git a/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/webHttp.dll.deploy b/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/webHttp.dll.deploy new file mode 100644 index 0000000..cec4e10 Binary files /dev/null and b/wcfHttpForm/bin/Debug/app.publish/Application Files/wcfHttpForm_1_0_0_17/webHttp.dll.deploy differ diff --git a/wcfHttpForm/bin/Debug/app.publish/setup.exe b/wcfHttpForm/bin/Debug/app.publish/setup.exe new file mode 100644 index 0000000..bb9f684 Binary files /dev/null and b/wcfHttpForm/bin/Debug/app.publish/setup.exe differ diff --git a/wcfHttpForm/bin/Debug/app.publish/wcfHttpForm.application b/wcfHttpForm/bin/Debug/app.publish/wcfHttpForm.application new file mode 100644 index 0000000..3e852ed --- /dev/null +++ b/wcfHttpForm/bin/Debug/app.publish/wcfHttpForm.application @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + X3iVUoRiMxKaGo9cz8XsPmBQI/ZIjco2SPedu6GQ0+Q= + + + + \ No newline at end of file diff --git a/wcfHttpForm/bin/Debug/app.publish/wcfHttpForm.exe b/wcfHttpForm/bin/Debug/app.publish/wcfHttpForm.exe new file mode 100644 index 0000000..56779b9 Binary files /dev/null and b/wcfHttpForm/bin/Debug/app.publish/wcfHttpForm.exe differ diff --git a/wcfHttpForm/bin/Debug/wcfHttpForm.application b/wcfHttpForm/bin/Debug/wcfHttpForm.application new file mode 100644 index 0000000..7e2fc25 --- /dev/null +++ b/wcfHttpForm/bin/Debug/wcfHttpForm.application @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + X3iVUoRiMxKaGo9cz8XsPmBQI/ZIjco2SPedu6GQ0+Q= + + + + \ No newline at end of file diff --git a/wcfHttpForm/bin/Debug/wcfHttpForm.exe b/wcfHttpForm/bin/Debug/wcfHttpForm.exe new file mode 100644 index 0000000..56779b9 Binary files /dev/null and b/wcfHttpForm/bin/Debug/wcfHttpForm.exe differ diff --git a/wcfHttpForm/bin/Debug/wcfHttpForm.exe.config b/wcfHttpForm/bin/Debug/wcfHttpForm.exe.config new file mode 100644 index 0000000..048c5ba --- /dev/null +++ b/wcfHttpForm/bin/Debug/wcfHttpForm.exe.config @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wcfHttpForm/bin/Debug/wcfHttpForm.exe.manifest b/wcfHttpForm/bin/Debug/wcfHttpForm.exe.manifest new file mode 100644 index 0000000..b9b69cb --- /dev/null +++ b/wcfHttpForm/bin/Debug/wcfHttpForm.exe.manifest @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + e5NLWwnOJ4cMWqOtbCMZadP+eT4dLRgPaOYStYZaWHw= + + + + + + + + + + + + dj3xwXKKrdL0/KL2cf2PTPWUfamwp7553Snik4ZywQc= + + + + + + + + + + x1UHmrCI86ad5HlmSSV8YhMDNA5i/qiZgwolh4RIVnc= + + + \ No newline at end of file diff --git a/wcfHttpForm/bin/Debug/wcfHttpForm.pdb b/wcfHttpForm/bin/Debug/wcfHttpForm.pdb new file mode 100644 index 0000000..15e16ba Binary files /dev/null and b/wcfHttpForm/bin/Debug/wcfHttpForm.pdb differ diff --git a/wcfHttpForm/bin/Debug/webHttp.dll b/wcfHttpForm/bin/Debug/webHttp.dll new file mode 100644 index 0000000..cec4e10 Binary files /dev/null and b/wcfHttpForm/bin/Debug/webHttp.dll differ diff --git a/wcfHttpForm/bin/Debug/webHttp.dll.config b/wcfHttpForm/bin/Debug/webHttp.dll.config new file mode 100644 index 0000000..15d0bf6 --- /dev/null +++ b/wcfHttpForm/bin/Debug/webHttp.dll.config @@ -0,0 +1,72 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wcfHttpForm/bin/Debug/webHttp.pdb b/wcfHttpForm/bin/Debug/webHttp.pdb new file mode 100644 index 0000000..bc818f4 Binary files /dev/null and b/wcfHttpForm/bin/Debug/webHttp.pdb differ diff --git a/wcfHttpForm/mainForm.Designer.cs b/wcfHttpForm/mainForm.Designer.cs new file mode 100644 index 0000000..e3db780 --- /dev/null +++ b/wcfHttpForm/mainForm.Designer.cs @@ -0,0 +1,102 @@ +namespace WCF_FORM +{ + partial class mainForm + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.button1.Location = new System.Drawing.Point(133, 139); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(92, 97); + this.button1.TabIndex = 0; + this.button1.Text = "开启"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.button2.Location = new System.Drawing.Point(356, 139); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(92, 97); + this.button2.TabIndex = 1; + this.button2.Text = "关闭"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(179, 94); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(0, 12); + this.label1.TabIndex = 2; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(195, 307); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(173, 12); + this.label2.TabIndex = 3; + this.label2.Text = "鼎软官网dingruan.com留言服务"; + // + // mainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(586, 391); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Name = "mainForm"; + this.Text = "http服务"; + this.Load += new System.EventHandler(this.mainForm_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + } +} + diff --git a/wcfHttpForm/mainForm.cs b/wcfHttpForm/mainForm.cs new file mode 100644 index 0000000..c082a45 --- /dev/null +++ b/wcfHttpForm/mainForm.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.ServiceModel; +using System.ServiceModel.Description; +using System.Text; +using System.Threading.Tasks; +using System.Timers; +using System.Windows.Forms; + +namespace WCF_FORM +{ + public partial class mainForm : Form + { + public mainForm() + { + InitializeComponent(); + checkHost(); + } + ServiceHost host; + private void button1_Click(object sender, EventArgs ex) + { + this.openHost(); + + } + private void openHost() { + if (host == null) + { + host = new ServiceHost(typeof(webHttp.Service)); + + host.Opened += delegate { MessageBox.Show("启动服务OK"); }; + host.Closed += delegate { MessageBox.Show("服务关闭"); }; + foreach (ServiceEndpoint EP in host.Description.Endpoints) + { + EP.Behaviors.Add(new BehaviorAttribute()); + } + try + { + host.Open(); + } + catch (Exception e) + { + Console.WriteLine("youwenti"); + MessageBox.Show(e.Message); + } + } + else + { + MessageBox.Show("服务已经启动了"); + } + checkHost(); + } + + private void button2_Click(object sender, EventArgs e) + { + if (host != null) + { + host.Close(); + host = null; + } + checkHost(); + } + + private void mainForm_Load(object sender, EventArgs e) + { + this.openHost(); + + } + private void checkHost() + { + this.label1.Text = host != null? "服务已开启":"服务未开启"; + } + } +} diff --git a/wcfHttpForm/mainForm.resx b/wcfHttpForm/mainForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/wcfHttpForm/mainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/wcfHttpForm/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/wcfHttpForm/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs new file mode 100644 index 0000000..15efebf --- /dev/null +++ b/wcfHttpForm/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] diff --git a/wcfHttpForm/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/wcfHttpForm/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..18f056c Binary files /dev/null and b/wcfHttpForm/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/wcfHttpForm/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/wcfHttpForm/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..b397493 Binary files /dev/null and b/wcfHttpForm/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/wcfHttpForm/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/wcfHttpForm/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll new file mode 100644 index 0000000..d7d8415 Binary files /dev/null and b/wcfHttpForm/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/wcfHttpForm/obj/Debug/WCF_FORM.mainForm.resources b/wcfHttpForm/obj/Debug/WCF_FORM.mainForm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/wcfHttpForm/obj/Debug/WCF_FORM.mainForm.resources differ diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.Properties.Resources.resources b/wcfHttpForm/obj/Debug/wcfHttpForm.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/wcfHttpForm/obj/Debug/wcfHttpForm.Properties.Resources.resources differ diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.application b/wcfHttpForm/obj/Debug/wcfHttpForm.application new file mode 100644 index 0000000..7e2fc25 --- /dev/null +++ b/wcfHttpForm/obj/Debug/wcfHttpForm.application @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + X3iVUoRiMxKaGo9cz8XsPmBQI/ZIjco2SPedu6GQ0+Q= + + + + \ No newline at end of file diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.AssemblyReference.cache b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.AssemblyReference.cache new file mode 100644 index 0000000..b82935a Binary files /dev/null and b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.AssemblyReference.cache differ diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.CopyComplete b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.CoreCompileInputs.cache b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7f11fa2 --- /dev/null +++ b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +6b2d8d3028db20aa337b31b89274d164fb3d3eec diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.FileListAbsolute.txt b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..c36ad0c --- /dev/null +++ b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.FileListAbsolute.txt @@ -0,0 +1,37 @@ +C:\Users\dell\source\repos\wcfHttpForm\bin\Debug\wcfHttpForm.exe.config +C:\Users\dell\source\repos\wcfHttpForm\bin\Debug\wcfHttpForm.exe +C:\Users\dell\source\repos\wcfHttpForm\bin\Debug\wcfHttpForm.pdb +C:\Users\dell\source\repos\wcfHttpForm\bin\Debug\webHttp.dll +C:\Users\dell\source\repos\wcfHttpForm\bin\Debug\webHttp.pdb +C:\Users\dell\source\repos\wcfHttpForm\bin\Debug\webHttp.dll.config +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\WCF_FORM.mainForm.resources +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\wcfHttpForm.Properties.Resources.resources +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\wcfHttpForm.csproj.GenerateResource.cache +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\wcfHttpForm.csproj.CoreCompileInputs.cache +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\wcfHttpForm.csproj.CopyComplete +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\wcfHttpForm.exe +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\wcfHttpForm.pdb +C:\Users\dell\source\repos\wcfHttpForm\bin\Debug\wcfHttpForm.exe.manifest +C:\Users\dell\source\repos\wcfHttpForm\bin\Debug\wcfHttpForm.application +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\wcfHttpForm.csprojAssemblyReference.cache +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\wcfHttpForm.exe.manifest +C:\Users\dell\source\repos\wcfHttpForm\obj\Debug\wcfHttpForm.application +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.csproj.AssemblyReference.cache +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.csproj.SuggestedBindingRedirects.cache +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\WCF_FORM.mainForm.resources +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.Properties.Resources.resources +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.csproj.GenerateResource.cache +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.csproj.CoreCompileInputs.cache +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.exe +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.pdb +D:\work\netcore\httpApi\wcfHttpForm\bin\Debug\wcfHttpForm.exe.config +D:\work\netcore\httpApi\wcfHttpForm\bin\Debug\wcfHttpForm.exe.manifest +D:\work\netcore\httpApi\wcfHttpForm\bin\Debug\wcfHttpForm.application +D:\work\netcore\httpApi\wcfHttpForm\bin\Debug\wcfHttpForm.exe +D:\work\netcore\httpApi\wcfHttpForm\bin\Debug\wcfHttpForm.pdb +D:\work\netcore\httpApi\wcfHttpForm\bin\Debug\webHttp.dll +D:\work\netcore\httpApi\wcfHttpForm\bin\Debug\webHttp.pdb +D:\work\netcore\httpApi\wcfHttpForm\bin\Debug\webHttp.dll.config +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.exe.manifest +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.application +D:\work\netcore\httpApi\wcfHttpForm\obj\Debug\wcfHttpForm.csproj.CopyComplete diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.GenerateResource.cache b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.GenerateResource.cache new file mode 100644 index 0000000..5b826fd Binary files /dev/null and b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.GenerateResource.cache differ diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.SuggestedBindingRedirects.cache b/wcfHttpForm/obj/Debug/wcfHttpForm.csproj.SuggestedBindingRedirects.cache new file mode 100644 index 0000000..e69de29 diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.csprojAssemblyReference.cache b/wcfHttpForm/obj/Debug/wcfHttpForm.csprojAssemblyReference.cache new file mode 100644 index 0000000..dfa8708 Binary files /dev/null and b/wcfHttpForm/obj/Debug/wcfHttpForm.csprojAssemblyReference.cache differ diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.exe b/wcfHttpForm/obj/Debug/wcfHttpForm.exe new file mode 100644 index 0000000..56779b9 Binary files /dev/null and b/wcfHttpForm/obj/Debug/wcfHttpForm.exe differ diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.exe.manifest b/wcfHttpForm/obj/Debug/wcfHttpForm.exe.manifest new file mode 100644 index 0000000..b9b69cb --- /dev/null +++ b/wcfHttpForm/obj/Debug/wcfHttpForm.exe.manifest @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + e5NLWwnOJ4cMWqOtbCMZadP+eT4dLRgPaOYStYZaWHw= + + + + + + + + + + + + dj3xwXKKrdL0/KL2cf2PTPWUfamwp7553Snik4ZywQc= + + + + + + + + + + x1UHmrCI86ad5HlmSSV8YhMDNA5i/qiZgwolh4RIVnc= + + + \ No newline at end of file diff --git a/wcfHttpForm/obj/Debug/wcfHttpForm.pdb b/wcfHttpForm/obj/Debug/wcfHttpForm.pdb new file mode 100644 index 0000000..15e16ba Binary files /dev/null and b/wcfHttpForm/obj/Debug/wcfHttpForm.pdb differ diff --git a/wcfHttpForm/wcfHttpForm.csproj b/wcfHttpForm/wcfHttpForm.csproj new file mode 100644 index 0000000..d0532b2 --- /dev/null +++ b/wcfHttpForm/wcfHttpForm.csproj @@ -0,0 +1,128 @@ + + + + + Debug + AnyCPU + {FAB24927-63BD-4829-950C-882A5B3248B3} + WinExe + wcfHttpForm + wcfHttpForm + v4.8 + 512 + true + false + + D:\work\netcore\httpApi\publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 18 + 1.0.0.%2a + false + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + C316E9015CC268920324F1671214D73C1A8FB047 + + + wcfHttpForm_TemporaryKey.pfx + + + true + + + false + + + + + + + + + + + + + + + + + + + Form + + + mainForm.cs + + + + + mainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + {24200b2e-0e57-44bf-bd39-b177f24013c5} + webHttp + + + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/wcfHttpForm/wcfHttpForm.csproj.user b/wcfHttpForm/wcfHttpForm.csproj.user new file mode 100644 index 0000000..37f4199 --- /dev/null +++ b/wcfHttpForm/wcfHttpForm.csproj.user @@ -0,0 +1,16 @@ + + + + + + + + + + zh-CN + false + + + false + + \ No newline at end of file diff --git a/wcfHttpForm/wcfHttpForm.sln b/wcfHttpForm/wcfHttpForm.sln new file mode 100644 index 0000000..c4feb03 --- /dev/null +++ b/wcfHttpForm/wcfHttpForm.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29911.84 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wcfHttpForm", "wcfHttpForm.csproj", "{FAB24927-63BD-4829-950C-882A5B3248B3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "webHttp", "..\webHttp\webHttp\webHttp.csproj", "{24200B2E-0E57-44BF-BD39-B177F24013C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FAB24927-63BD-4829-950C-882A5B3248B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FAB24927-63BD-4829-950C-882A5B3248B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FAB24927-63BD-4829-950C-882A5B3248B3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FAB24927-63BD-4829-950C-882A5B3248B3}.Release|Any CPU.Build.0 = Release|Any CPU + {24200B2E-0E57-44BF-BD39-B177F24013C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {24200B2E-0E57-44BF-BD39-B177F24013C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {24200B2E-0E57-44BF-BD39-B177F24013C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {24200B2E-0E57-44BF-BD39-B177F24013C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {15F51102-542E-4E2E-9CB4-25CBC5603D23} + EndGlobalSection +EndGlobal diff --git a/wcfHttpForm/wcfHttpForm_TemporaryKey.pfx b/wcfHttpForm/wcfHttpForm_TemporaryKey.pfx new file mode 100644 index 0000000..a059b19 Binary files /dev/null and b/wcfHttpForm/wcfHttpForm_TemporaryKey.pfx differ diff --git a/webHttp/.vs/webHttp/v16/.suo b/webHttp/.vs/webHttp/v16/.suo new file mode 100644 index 0000000..9a33bba Binary files /dev/null and b/webHttp/.vs/webHttp/v16/.suo differ diff --git a/webHttp/.vs/webHttp/v17/.suo b/webHttp/.vs/webHttp/v17/.suo new file mode 100644 index 0000000..edd6782 Binary files /dev/null and b/webHttp/.vs/webHttp/v17/.suo differ diff --git a/webHttp/UpgradeLog.htm b/webHttp/UpgradeLog.htm new file mode 100644 index 0000000..10e9781 Binary files /dev/null and b/webHttp/UpgradeLog.htm differ diff --git a/webHttp/UpgradeLog2.htm b/webHttp/UpgradeLog2.htm new file mode 100644 index 0000000..549c30b Binary files /dev/null and b/webHttp/UpgradeLog2.htm differ diff --git a/webHttp/webHttp.sln b/webHttp/webHttp.sln new file mode 100644 index 0000000..d67766e --- /dev/null +++ b/webHttp/webHttp.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29911.84 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "webHttp", "webHttp\webHttp.csproj", "{24200B2E-0E57-44BF-BD39-B177F24013C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {24200B2E-0E57-44BF-BD39-B177F24013C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {24200B2E-0E57-44BF-BD39-B177F24013C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {24200B2E-0E57-44BF-BD39-B177F24013C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {24200B2E-0E57-44BF-BD39-B177F24013C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CCD50840-C5E7-4C53-AD96-735D203D7BAE} + EndGlobalSection +EndGlobal diff --git a/webHttp/webHttp/App.config b/webHttp/webHttp/App.config new file mode 100644 index 0000000..15d0bf6 --- /dev/null +++ b/webHttp/webHttp/App.config @@ -0,0 +1,72 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webHttp/webHttp/IService.cs b/webHttp/webHttp/IService.cs new file mode 100644 index 0000000..ed1086f --- /dev/null +++ b/webHttp/webHttp/IService.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.ServiceModel; +using System.ServiceModel.Web; +using System.Text; + +namespace webHttp +{ + // 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码和配置文件中的接口名“IService1”。 + [ServiceContract] + public interface IService + { + [OperationContract] + [WebGet( ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)] + string GetData(); + + [OperationContract] + [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)] + int SetData(string ip,string name,string comment,string phone,string type); + + [OperationContract] + [WebInvoke(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)] + string PostData(string ip); + + // TODO: 在此添加您的服务操作 + } + + + +} diff --git a/webHttp/webHttp/Properties/AssemblyInfo.cs b/webHttp/webHttp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..13d5cde --- /dev/null +++ b/webHttp/webHttp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("webHttp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("webHttp")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +//将 ComVisible 设置为 false 将使此程序集中的类型 +//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("24200b2e-0e57-44bf-bd39-b177f24013c5")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/webHttp/webHttp/Service.cs b/webHttp/webHttp/Service.cs new file mode 100644 index 0000000..fdaa6d4 --- /dev/null +++ b/webHttp/webHttp/Service.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Runtime.Serialization; +using System.ServiceModel; +using System.ServiceModel.Activation; +using System.ServiceModel.Channels; +using System.Text; +using webHttp.sqlLite; + +namespace webHttp +{ + // 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码和配置文件中的类名“Service1”。 + [AspNetCompatibilityRequirements(RequirementsMode = + AspNetCompatibilityRequirementsMode.Allowed)] + public class Service : IService + { + public string GetData() + { + sqlUtil sq = new sqlUtil(); + DataSet ds= sq.Query(); + return GetJsonByDataset(ds); + } + public int SetData(string ip, string name, string comment, string phone,string type) + { + if (string.IsNullOrEmpty(phone)) { + return 0; + } + //提供方法执行的上下文环境 + OperationContext context = OperationContext.Current; + //获取传进的消息属性 + MessageProperties properties = context.IncomingMessageProperties; + //获取消息发送的远程终结点IP和端口 + RemoteEndpointMessageProperty endpoint = properties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty; + sqlUtil sq = new sqlUtil(); + string sql = "INSERT INTO WB_Comment(ip, phone,text,name,time,type)VALUES('" + endpoint.Address + "','" + phone + "','" + comment + "','" + name + "','"+ DateTime.Now.ToString() +"','" + type + "')"; + int state= sq.NonQuery(sql); + return state; + } + + public string PostData(string ip) + { + return string.Format("" + ip); + } + public string GetJsonByDataset(DataSet ds) + { + if (ds == null || ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0) + { + //如果查询到的数据为空则返回标记ok:false + return "{\"ok\":false}"; + } + StringBuilder sb = new StringBuilder(); + sb.Append("{\"ok\":true,"); + foreach (DataTable dt in ds.Tables) + { + sb.Append(string.Format("\"{0}\":[", dt.TableName)); + + foreach (DataRow dr in dt.Rows) + { + sb.Append("{"); + for (int i = 0; i < dr.Table.Columns.Count; i++) + { + sb.AppendFormat("\"{0}\":\"{1}\",", dr.Table.Columns[i].ColumnName.Replace("\"", "\\\"").Replace("\'", "\\\'"), (dr[i]).ToString().Replace("\"", "\\\"").Replace("\'", "\\\'")).Replace(Convert.ToString((char)13), "\\r\\n").Replace(Convert.ToString((char)10), "\\r\\n"); + } + sb.Remove(sb.ToString().LastIndexOf(','), 1); + sb.Append("},"); + } + + sb.Remove(sb.ToString().LastIndexOf(','), 1); + sb.Append("],"); + } + sb.Remove(sb.ToString().LastIndexOf(','), 1); + sb.Append("}"); + return sb.ToString(); + } + + } +} diff --git a/webHttp/webHttp/SqlDatabaseSetup.cs b/webHttp/webHttp/SqlDatabaseSetup.cs new file mode 100644 index 0000000..67d5b27 --- /dev/null +++ b/webHttp/webHttp/SqlDatabaseSetup.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Data.Common; +using Microsoft.Data.Tools.Schema.Sql.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace webHttp +{ + [TestClass()] + public class SqlDatabaseSetup + { + + [AssemblyInitialize()] + public static void InitializeAssembly(TestContext ctx) + { + // Setup the test database based on setting in the + // configuration file + SqlDatabaseTestClass.TestService.DeployDatabaseProject(); + SqlDatabaseTestClass.TestService.GenerateData(); + } + + } +} diff --git a/webHttp/webHttp/SqlServerUnitTest1.cs b/webHttp/webHttp/SqlServerUnitTest1.cs new file mode 100644 index 0000000..8265a76 --- /dev/null +++ b/webHttp/webHttp/SqlServerUnitTest1.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.Common; +using System.Text; +using Microsoft.Data.Tools.Schema.Sql.UnitTesting; +using Microsoft.Data.Tools.Schema.Sql.UnitTesting.Conditions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace webHttp +{ + [TestClass()] + public class SqlServerUnitTest1 : SqlDatabaseTestClass + { + + public SqlServerUnitTest1() + { + InitializeComponent(); + } + + [TestInitialize()] + public void TestInitialize() + { + base.InitializeTest(); + } + [TestCleanup()] + public void TestCleanup() + { + base.CleanupTest(); + } + + [TestMethod()] + public void SqlTest1() + { + SqlDatabaseTestActions testActions = this.SqlTest1Data; + // Execute the pre-test script + // + System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script..."); + SqlExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction); + // Execute the test script + // + System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script..."); + SqlExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction); + // Execute the post-test script + // + System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script..."); + SqlExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction); + } + + #region Designer support code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SqlTest1Data = new SqlDatabaseTestActions(); + // + // SqlTest1Data + // + this.SqlTest1Data.PosttestAction = null; + this.SqlTest1Data.PretestAction = null; + this.SqlTest1Data.TestAction = null; + } + + #endregion + + + #region Additional test attributes + // + // You can use the following additional attributes as you write your tests: + // + // Use ClassInitialize to run code before running the first test in the class + // [ClassInitialize()] + // public static void MyClassInitialize(TestContext testContext) { } + // + // Use ClassCleanup to run code after all tests in a class have run + // [ClassCleanup()] + // public static void MyClassCleanup() { } + // + #endregion + + private SqlDatabaseTestActions SqlTest1Data; + } +} diff --git a/webHttp/webHttp/SqlServerUnitTest1.resx b/webHttp/webHttp/SqlServerUnitTest1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/webHttp/webHttp/SqlServerUnitTest1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/webHttp/webHttp/bin/Debug/Microsoft.Data.Tools.Components.dll b/webHttp/webHttp/bin/Debug/Microsoft.Data.Tools.Components.dll new file mode 100644 index 0000000..0297ab6 Binary files /dev/null and b/webHttp/webHttp/bin/Debug/Microsoft.Data.Tools.Components.dll differ diff --git a/webHttp/webHttp/bin/Debug/webHttp.dll b/webHttp/webHttp/bin/Debug/webHttp.dll new file mode 100644 index 0000000..cec4e10 Binary files /dev/null and b/webHttp/webHttp/bin/Debug/webHttp.dll differ diff --git a/webHttp/webHttp/bin/Debug/webHttp.dll.config b/webHttp/webHttp/bin/Debug/webHttp.dll.config new file mode 100644 index 0000000..15d0bf6 --- /dev/null +++ b/webHttp/webHttp/bin/Debug/webHttp.dll.config @@ -0,0 +1,72 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webHttp/webHttp/bin/Debug/webHttp.pdb b/webHttp/webHttp/bin/Debug/webHttp.pdb new file mode 100644 index 0000000..bc818f4 Binary files /dev/null and b/webHttp/webHttp/bin/Debug/webHttp.pdb differ diff --git a/webHttp/webHttp/bin/Debug/zh-Hans/Microsoft.Data.Tools.Components.resources.dll b/webHttp/webHttp/bin/Debug/zh-Hans/Microsoft.Data.Tools.Components.resources.dll new file mode 100644 index 0000000..28cbf68 Binary files /dev/null and b/webHttp/webHttp/bin/Debug/zh-Hans/Microsoft.Data.Tools.Components.resources.dll differ diff --git a/webHttp/webHttp/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/webHttp/webHttp/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs new file mode 100644 index 0000000..15efebf --- /dev/null +++ b/webHttp/webHttp/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] diff --git a/webHttp/webHttp/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/webHttp/webHttp/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..5f00ca8 Binary files /dev/null and b/webHttp/webHttp/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/webHttp/webHttp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/webHttp/webHttp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..335ec71 Binary files /dev/null and b/webHttp/webHttp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/webHttp/webHttp/obj/Debug/WcfConfigValidationData.tmp b/webHttp/webHttp/obj/Debug/WcfConfigValidationData.tmp new file mode 100644 index 0000000..4d0bdf7 --- /dev/null +++ b/webHttp/webHttp/obj/Debug/WcfConfigValidationData.tmp @@ -0,0 +1 @@ +2022-10-17T06:09:04.6030619Z2022-10-17T02:17:09.1477128Z2022-10-17T02:12:09.2204437Z \ No newline at end of file diff --git a/webHttp/webHttp/obj/Debug/webHttp.csproj.AssemblyReference.cache b/webHttp/webHttp/obj/Debug/webHttp.csproj.AssemblyReference.cache new file mode 100644 index 0000000..3c3a45f Binary files /dev/null and b/webHttp/webHttp/obj/Debug/webHttp.csproj.AssemblyReference.cache differ diff --git a/webHttp/webHttp/obj/Debug/webHttp.csproj.CopyComplete b/webHttp/webHttp/obj/Debug/webHttp.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/webHttp/webHttp/obj/Debug/webHttp.csproj.CoreCompileInputs.cache b/webHttp/webHttp/obj/Debug/webHttp.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..5035e5c --- /dev/null +++ b/webHttp/webHttp/obj/Debug/webHttp.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +60a9da402260b15b770cc9d5e0ece9bb0eab2753 diff --git a/webHttp/webHttp/obj/Debug/webHttp.csproj.FileListAbsolute.txt b/webHttp/webHttp/obj/Debug/webHttp.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..e826d02 --- /dev/null +++ b/webHttp/webHttp/obj/Debug/webHttp.csproj.FileListAbsolute.txt @@ -0,0 +1,20 @@ +C:\Users\dell\source\repos\webHttp\webHttp\bin\Debug\webHttp.dll.config +C:\Users\dell\source\repos\webHttp\webHttp\bin\Debug\webHttp.dll +C:\Users\dell\source\repos\webHttp\webHttp\bin\Debug\webHttp.pdb +C:\Users\dell\source\repos\webHttp\webHttp\bin\Debug\Microsoft.Data.Tools.Components.dll +C:\Users\dell\source\repos\webHttp\webHttp\bin\Debug\zh-Hans\Microsoft.Data.Tools.Components.resources.dll +C:\Users\dell\source\repos\webHttp\webHttp\obj\Debug\webHttp.csprojAssemblyReference.cache +C:\Users\dell\source\repos\webHttp\webHttp\obj\Debug\webHttp.csproj.CoreCompileInputs.cache +C:\Users\dell\source\repos\webHttp\webHttp\obj\Debug\webHttp.csproj.CopyComplete +C:\Users\dell\source\repos\webHttp\webHttp\obj\Debug\webHttp.dll +C:\Users\dell\source\repos\webHttp\webHttp\obj\Debug\webHttp.pdb +D:\work\netcore\httpApi\webHttp\webHttp\bin\Debug\webHttp.dll.config +D:\work\netcore\httpApi\webHttp\webHttp\bin\Debug\webHttp.dll +D:\work\netcore\httpApi\webHttp\webHttp\bin\Debug\webHttp.pdb +D:\work\netcore\httpApi\webHttp\webHttp\bin\Debug\Microsoft.Data.Tools.Components.dll +D:\work\netcore\httpApi\webHttp\webHttp\bin\Debug\zh-Hans\Microsoft.Data.Tools.Components.resources.dll +D:\work\netcore\httpApi\webHttp\webHttp\obj\Debug\webHttp.csproj.AssemblyReference.cache +D:\work\netcore\httpApi\webHttp\webHttp\obj\Debug\webHttp.csproj.CoreCompileInputs.cache +D:\work\netcore\httpApi\webHttp\webHttp\obj\Debug\webHttp.csproj.CopyComplete +D:\work\netcore\httpApi\webHttp\webHttp\obj\Debug\webHttp.dll +D:\work\netcore\httpApi\webHttp\webHttp\obj\Debug\webHttp.pdb diff --git a/webHttp/webHttp/obj/Debug/webHttp.csprojAssemblyReference.cache b/webHttp/webHttp/obj/Debug/webHttp.csprojAssemblyReference.cache new file mode 100644 index 0000000..0e99e51 Binary files /dev/null and b/webHttp/webHttp/obj/Debug/webHttp.csprojAssemblyReference.cache differ diff --git a/webHttp/webHttp/obj/Debug/webHttp.dll b/webHttp/webHttp/obj/Debug/webHttp.dll new file mode 100644 index 0000000..cec4e10 Binary files /dev/null and b/webHttp/webHttp/obj/Debug/webHttp.dll differ diff --git a/webHttp/webHttp/obj/Debug/webHttp.pdb b/webHttp/webHttp/obj/Debug/webHttp.pdb new file mode 100644 index 0000000..bc818f4 Binary files /dev/null and b/webHttp/webHttp/obj/Debug/webHttp.pdb differ diff --git a/webHttp/webHttp/sqlLite/sqlUtil.cs b/webHttp/webHttp/sqlLite/sqlUtil.cs new file mode 100644 index 0000000..8806901 --- /dev/null +++ b/webHttp/webHttp/sqlLite/sqlUtil.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Configuration; + +namespace webHttp.sqlLite +{ + class sqlUtil + { + public string connString = ConfigurationManager.AppSettings["connString"] as string; + public SqlConnection conn; + public int NonQuery(string sql) + { + conn = new SqlConnection(connString); + int a = -1; + try + { + conn.Open(); //打开数据库 + SqlCommand cmd = new SqlCommand(sql, conn); + a = cmd.ExecuteNonQuery(); + } + catch + { + Console.Write("sql出错了"); + } + finally + { + if (conn.State == ConnectionState.Open) + { + conn.Close(); //关闭数据库 + } + } + return a; + } + // 执行对数据表中数据的查询操作 + public DataSet Query() + { + conn = new SqlConnection(connString); + DataSet ds = new DataSet(); + try + { + conn.Open(); //打开数据库 + SqlDataAdapter adp = new SqlDataAdapter("select * from dbo.WB_Comment order by ID", conn); + adp.Fill(ds); + } + catch + { + Console.Write("sql出错了"); + } + finally + { + if (conn.State == ConnectionState.Open) + conn.Close(); //关闭数据库 + } + return ds; + } + } +} diff --git a/webHttp/webHttp/webHttp.Publish.xml b/webHttp/webHttp/webHttp.Publish.xml new file mode 100644 index 0000000..2cef649 --- /dev/null +++ b/webHttp/webHttp/webHttp.Publish.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/webHttp/webHttp/webHttp.csproj b/webHttp/webHttp/webHttp.csproj new file mode 100644 index 0000000..f0c5caa --- /dev/null +++ b/webHttp/webHttp/webHttp.csproj @@ -0,0 +1,127 @@ + + + $(VsInstallRoot)\Common7\IDE\Extensions\Microsoft\SQLDB + XmlSerializer + True + All + + %2a, webHttp.ContractTypes + System.Array%3bSystem.Collections.Generic.Dictionary`2 + + True + True + False + False + + + + $(VsInstallRoot)\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130 + + + 10.0 + + + true + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {24200B2E-0E57-44BF-BD39-B177F24013C5} + Library + Properties + webHttp + webHttp + {3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + /client:"WcfTestClient.exe" + v4.8 + True + True + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(SSDTPath)\Microsoft.Data.Tools.Schema.Sql.dll + True + + + $(SSDTUnitTestPath)\Microsoft.Data.Tools.Schema.Sql.UnitTesting.dll + True + + + $(SSDTUnitTestPath)\Microsoft.Data.Tools.Schema.Sql.UnitTestingAdapter.dll + True + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio + $(VSToolsPath)\WCF + + + + + + + False + + + + + + 3.1 + + + + + \ No newline at end of file diff --git a/webHttp/webHttp/webHttp.csproj.user b/webHttp/webHttp/webHttp.csproj.user new file mode 100644 index 0000000..b798d02 --- /dev/null +++ b/webHttp/webHttp/webHttp.csproj.user @@ -0,0 +1,17 @@ + + + + + + + + + + RunFiles + C:\Users\dell\Desktop\http微服务\ + True + + + + + \ No newline at end of file