序列化 .NET WCF 服务的类型时出现问题:服务 WSDL 在 XSD 中定义空类型

2024-05-08

我正在使用 WCF 编写一个 Web 服务。

  1. 我创建了数据合约。

  2. 我创建了我的服务合同(界面)。我定义了方法(其参数的类型与数据契约相同)。

  3. 我实现了创建服务类的服务合同。

  4. 我使用 svc 文件和 IIS 托管我的服务。

  5. 我尝试了我的服务,寻找http://localhost/myvirtdiriis/myservice.svc http://localhost/myvirtdiriis/myservice.svc--> 服务已加载,并且显示了一个漂亮的网页,描述了我的服务的存在。

  6. 我想看看 WSDL。使用提供的链接,我可以看到类型仅被定义,我只能看到类型定义(例如<complexType>),但里面什么也没有(类型为空)。

  7. 我编写了一个简单的客户端,对操作的调用进展顺利,但是当返回类型时它是空的(内部字段具有构造值,而我的服务在那里放置一些值),例如,对返回类型的操作的调用通过操作契约方法将三个字符串设置为“Hello”、“Hello2”和“Hello3”,返回将这些字符串设置为的类型""(构造值,就好像没有发生变化一样)。

发生了什么?

看来序列化失败了。

我提供一些:

A1) 服务合同的一部分:

[ServiceContract(Namespace = "http://opcfoundation.org/webservices/XMLDA/1.0/")]
   public interface IOCXSService {
      [OperationContract(Action = "http://opcfoundation.org/webservices/XMLDA/1.0/Browse")]
      BrowseResponse Browse(BrowseRequest request);
      ...
}

A2) 服务实施:

public class MyService : IOCXSService {
      ...
      public BrowseResponse Browse(BrowseRequest request) {
         ...
      }
      ...
   }

B) 类型:

[DataContract(Namespace = "http://opcfoundation.org/webservices/XMLDA/1.0/", Name = "BrowseResponse")]
    [System.ServiceModel.MessageContractAttribute(WrapperName = "BrowseResponse", WrapperNamespace = "http://opcfoundation.org/webservices/XMLDA/1.0/", IsWrapped = true)]
    public class BrowseResponse {

        [DataMember(Name = "BrowseResult", Order = 0)]
        public OCXS.OCXSServiceLibrary.OPCXMLDA10.ReplyBase BrowseResult;

        [DataMember(Name = "Elements", Order = 1)]
        public BrowseElement[] Elements;

        [DataMember(Name = "Errors", Order = 2)]
        public OPCError[] Errors;

        [DataMember(Name = "ContinuationPoint", Order = 3)]
        public string ContinuationPoint;

        [DataMember(Name = "MoreElements", Order = 4)]
        public bool MoreElements;

        public BrowseResponse() {
        }

        public BrowseResponse(OCXS.OCXSServiceLibrary.OPCXMLDA10.ReplyBase BrowseResult, BrowseElement[] Elements, OPCError[] Errors, string ContinuationPoint, bool MoreElements) {
            this.BrowseResult = BrowseResult;
            this.Elements = Elements;
            this.Errors = Errors;
            this.ContinuationPoint = ContinuationPoint;
            this.MoreElements = MoreElements;
        }

[DataContract(Namespace = "http://opcfoundation.org/webservices/XMLDA/1.0/", Name = "ReplyBase")]
    public class ReplyBase : System.ComponentModel.INotifyPropertyChanged {

        private System.DateTime rcvTimeField;

        private System.DateTime replyTimeField;

        private string clientRequestHandleField;

        private string revisedLocaleIDField;

        private serverState serverStateField;

        [DataMember(Name = "RcvTime", Order = 0)]
        public System.DateTime RcvTime {
            get {
                return this.rcvTimeField;
            }
            set {
                this.rcvTimeField = value;
                this.RaisePropertyChanged("RcvTime");
            }
        }

        [DataMember(Name = "ReplyTime", Order = 1)]
        public System.DateTime ReplyTime {
            get {
                return this.replyTimeField;
            }
            set {
                this.replyTimeField = value;
                this.RaisePropertyChanged("ReplyTime");
            }
        }

        [DataMember(Name = "ClientRequestHandle", Order = 2)]
        public string ClientRequestHandle {
            get {
                return this.clientRequestHandleField;
            }
            set {
                this.clientRequestHandleField = value;
                this.RaisePropertyChanged("ClientRequestHandle");
            }
        }

        [DataMember(Name = "RevisedLocaleID", Order = 3)]
        public string RevisedLocaleID {
            get {
                return this.revisedLocaleIDField;
            }
            set {
                this.revisedLocaleIDField = value;
                this.RaisePropertyChanged("RevisedLocaleID");
            }
        }

        [DataMember(Name = "ServerState", Order = 4)]
        public serverState ServerState {
            get {
                return this.serverStateField;
            }
            set {
                this.serverStateField = value;
                this.RaisePropertyChanged("ServerState");
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }

[DataContract(Namespace = "http://opcfoundation.org/webservices/XMLDA/1.0/", Name = "BrowseElement")]
    public class BrowseElement : INotifyPropertyChanged {

        private ItemProperty[] propertiesField;

        private string nameField;

        private string itemPathField;

        private string itemNameField;

        private bool isItemField;

        private bool hasChildrenField;

        [DataMember(Name = "Properties", Order = 0)]
        public ItemProperty[] Properties {
            get {
                return this.propertiesField;
            }
            set {
                this.propertiesField = value;
                this.RaisePropertyChanged("Properties");
            }
        }

        [DataMember(Name = "Name", Order = 1)]
        public string Name {
            get {
                return this.nameField;
            }
            set {
                this.nameField = value;
                this.RaisePropertyChanged("Name");
            }
        }

        [DataMember(Name = "ItemPath", Order = 2)]
        public string ItemPath {
            get {
                return this.itemPathField;
            }
            set {
                this.itemPathField = value;
                this.RaisePropertyChanged("ItemPath");
            }
        }

        [DataMember(Name = "ItemName", Order = 3)]
        public string ItemName {
            get {
                return this.itemNameField;
            }
            set {
                this.itemNameField = value;
                this.RaisePropertyChanged("ItemName");
            }
        }

        [DataMember(Name = "IsItem", Order = 4)]
        public bool IsItem {
            get {
                return this.isItemField;
            }
            set {
                this.isItemField = value;
                this.RaisePropertyChanged("IsItem");
            }
        }

        [DataMember(Name = "HasChildren", Order = 5)]
        public bool HasChildren {
            get {
                return this.hasChildrenField;
            }
            set {
                this.hasChildrenField = value;
                this.RaisePropertyChanged("HasChildren");
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }

    }

[DataContract(Namespace = "http://opcfoundation.org/webservices/XMLDA/1.0/", Name = "OPCError")]
    public class OPCError : System.ComponentModel.INotifyPropertyChanged {

        private string textField;

        private System.Xml.XmlQualifiedName idField;

        [DataMember(Name = "Text", Order = 0)]
        public string Text {
            get {
                return this.textField;
            }
            set {
                this.textField = value;
                this.RaisePropertyChanged("Text");
            }
        }

        [DataMember(Name = "ID", Order = 1)]
        public System.Xml.XmlQualifiedName ID {
            get {
                return this.idField;
            }
            set {
                this.idField = value;
                this.RaisePropertyChanged("ID");
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }

C) WSDL(一部分,涉及类型定义的部分)

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:tns="http://opcfoundation.org/webservices/XMLDA/1.0/" targetNamespace="http://opcfoundation.org/webservices/XMLDA/1.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Browse">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="BrowseResponse">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="GetProperties">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="GetPropertiesResponse">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="GetStatus">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="GetStatusResponse">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="Read">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="ReadResponse">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="Subscribe">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="SubscribeResponse">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="SubscriptionCancel">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="SubscriptionCancelResponse">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="SubscriptionPolledRefresh">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="SubscriptionPolledRefreshResponse">
      <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
   <xs:element name="Write">-<xs:complexType><xs:sequence/></xs:complexType></xs:element>
      <xs:element name="WriteResponse">
         <xs:complexType>
         <xs:sequence/>
      </xs:complexType>
   </xs:element>
</xs:schema>

上面的部分包含在这里:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:tns="http://opcfoundation.org/webservices/XMLDA/1.0/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://opcfoundation.org/webservices/XMLDA/1.0/">
<wsdl:types>
<xsd:schema targetNamespace="http://opcfoundation.org/webservices/XMLDA/1.0/Imports">
<xsd:import namespace="http://opcfoundation.org/webservices/XMLDA/1.0/" schemaLocation="http://localhost/OCXS/OCXS.svc?xsd=xsd0"/></xsd:schema></wsdl:types>
<wsdl:message name="BrowseRequest"><wsdl:part name="parameters" element="tns:Browse"/></wsdl:message>
<wsdl:message name="BrowseResponse"><wsdl:part name="parameters" element="tns:BrowseResponse"/></wsdl:message>
<wsdl:message name="GetPropertiesRequest"><wsdl:part name="parameters" element="tns:GetProperties"/></wsdl:message>
<wsdl:message name="GetPropertiesResponse"><wsdl:part name="parameters" element="tns:GetPropertiesResponse"/></wsdl:message>
<wsdl:message name="GetStatusRequest"><wsdl:part name="parameters" element="tns:GetStatus"/></wsdl:message>
<wsdl:message name="GetStatusResponse"><wsdl:part name="parameters" element="tns:GetStatusResponse"/></wsdl:message>
<wsdl:message name="ReadRequest"><wsdl:part name="parameters" element="tns:Read"/></wsdl:message>-<wsdl:message name="ReadResponse"><wsdl:part name="parameters" element="tns:ReadResponse"/></wsdl:message>
<wsdl:message name="SubscribeRequest"><wsdl:part name="parameters" element="tns:Subscribe"/></wsdl:message>
<wsdl:message name="SubscribeResponse"><wsdl:part name="parameters" element="tns:SubscribeResponse"/></wsdl:message>
<wsdl:message name="SubscriptionCancelRequest"><wsdl:part name="parameters" element="tns:SubscriptionCancel"/></wsdl:message><wsdl:message name="SubscriptionCancelResponse"><wsdl:part name="parameters" element="tns:SubscriptionCancelResponse"/></wsdl:message>
<wsdl:message name="SubscriptionPolledRefreshRequest"><wsdl:part name="parameters" element="tns:SubscriptionPolledRefresh"/></wsdl:message>
<wsdl:message name="SubscriptionPolledRefreshResponse"><wsdl:part name="parameters" element="tns:SubscriptionPolledRefreshResponse"/></wsdl:message>
<wsdl:message name="WriteRequest"><wsdl:part name="parameters" element="tns:Write"/></wsdl:message>-<wsdl:message name="WriteResponse"><wsdl:part name="parameters" element="tns:WriteResponse"/></wsdl:message>
<wsdl:portType name="IOCXSService">-<wsdl:operation name="Browse"><wsdl:input name="BrowseRequest" message="tns:BrowseRequest" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/Browse"/><wsdl:output name="BrowseResponse" message="tns:BrowseResponse" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/IOCXSService/BrowseResponse"/></wsdl:operation>
<wsdl:operation name="GetProperties"><wsdl:input name="GetPropertiesRequest" message="tns:GetPropertiesRequest" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/GetProperties"/><wsdl:output name="GetPropertiesResponse" message="tns:GetPropertiesResponse" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/IOCXSService/GetPropertiesResponse"/></wsdl:operation>
<wsdl:operation name="GetStatus"><wsdl:input name="GetStatusRequest" message="tns:GetStatusRequest" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/GetStatus"/><wsdl:output name="GetStatusResponse" message="tns:GetStatusResponse" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/IOCXSService/GetStatusResponse"/></wsdl:operation>
<wsdl:operation name="Read"><wsdl:input name="ReadRequest" message="tns:ReadRequest" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/Read"/><wsdl:output name="ReadResponse" message="tns:ReadResponse" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/IOCXSService/ReadResponse"/></wsdl:operation>-<wsdl:operation name="Subscribe"><wsdl:input name="SubscribeRequest" message="tns:SubscribeRequest" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/Subscribe"/><wsdl:output name="SubscribeResponse" message="tns:SubscribeResponse" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/IOCXSService/SubscribeResponse"/></wsdl:operation>
<wsdl:operation name="SubscriptionCancel"><wsdl:input name="SubscriptionCancelRequest" message="tns:SubscriptionCancelRequest" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/SubscriptionCancel"/><wsdl:output name="SubscriptionCancelResponse" message="tns:SubscriptionCancelResponse" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/IOCXSService/SubscriptionCancelResponse"/></wsdl:operation>
<wsdl:operation name="SubscriptionPolledRefresh"><wsdl:input name="SubscriptionPolledRefreshRequest" message="tns:SubscriptionPolledRefreshRequest" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/SubscriptionPolledRefresh"/><wsdl:output name="SubscriptionPolledRefreshResponse" message="tns:SubscriptionPolledRefreshResponse" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/IOCXSService/SubscriptionPolledRefreshResponse"/></wsdl:operation>
<wsdl:operation name="Write"><wsdl:input name="WriteRequest" message="tns:WriteRequest" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/Write"/><wsdl:output name="WriteResponse" message="tns:WriteResponse" wsaw:Action="http://opcfoundation.org/webservices/XMLDA/1.0/IOCXSService/WriteResponse"/></wsdl:operation></wsdl:portType></wsdl:definitions>

笔记: 如果我删除MessageContract属性来自BrowseResponse and BrowseRequest(两者都删除了,否则运行时会变得疯狂),问题仍然存在...... 这真的是一个关于消息合同的问题吗???

也许是解决方案

好吧大家,也许我能看到曙光...... 如果我删除所有DataContract(s) and ServiceContract(s) 属性名称空间和名称(始终不带MessageContract(s)),一切正常。好吧,我得到了 wsdl 和类型,但即使使用它们也能工作(但总是没有MessageContract(s))。 原因如下(我想得到您的确认):

我指定的命名空间:http://opcfoundation.org/webservices/XMLDA/1.0/ http://opcfoundation.org/webservices/XMLDA/1.0/这不是一个简单的名称,好吧,在这里您可以找到我的操作和类型的 WSDL 定义(已定义)。我的 svc 不会生成带有类型的完整 WSDL 定义,因为它已经在我提供的名称空间中定义了它们!

你怎么看待这件事?


您将 BrowseResponse 类定义为[MessageContract], 此外[DataContract]。根据您所说的,似乎 [MessageContract] 优先(这是有道理的 - [MC] 定义了消息的 SOAP 信封,其中可以包含members,这些成员可以是数据合约。消息合约的成员定义为[MessageHeader] or [MessageBodyMember]属性,并且由于您没有任何属性,因此合同本质上是空的。

您没有显示 BrowseRequest 的定义,但由于您在请求中使用 [MC] 类型,因此您还需要在响应中使用 [MC] 类型,所以我假设它有同样的问题。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

序列化 .NET WCF 服务的类型时出现问题:服务 WSDL 在 XSD 中定义空类型 的相关文章

  • ComboBox DataBinding 导致 ArgumentException

    我的几个类对象 class Person public string Name get set public string Sex get set public int Age get set public override string
  • 查找进程的完整路径

    我已经编写了 C 控制台应用程序 当我启动应用程序时 不使用cmd 我可以看到它列在任务管理器的进程列表中 现在我需要编写另一个应用程序 在其中我需要查找以前的应用程序是否正在运行 我知道应用程序名称和路径 所以我已将管理对象搜索器查询写入
  • 当一组凭据下的计划任务启动的进程在另一组凭据下运行另一个程序时,Windows 是否有限制

    所以我有一个简单的例子 其中我有应用程序 A 它对用户 X 本地管理员 有一些硬编码的凭据 然后它使用硬编码的绝对路径启动带有这些凭据的应用程序 B A 和 B 以及 dotnet 控制台应用程序 但是它们不与控制台交互 只是将信息写入文件
  • 从同一个类中的另一个构造函数调用构造函数

    我有一个带有两个构造函数的类 C 这是代码片段 public class FooBar public FooBar string s constructor 1 some functionality public FooBar int i
  • C# 数据表更新多行

    我如何使用数据表进行多次更新 我找到了这个更新 1 行 http support microsoft com kb 307587 my code public void ExportCSV string SQLSyntax string L
  • 在Linux中,找不到框架“.NETFramework,Version=v4.5”的参考程序集

    我已经设置了 Visual studio 来在我的 Ubuntu 机器上编译 C 代码 我将工作区 我的代码加载到 VS 我可以看到以下错误 The reference assemblies for framework NETFramewo
  • 识别 Visual Studio 中的重载运算符 (c++)

    有没有办法使用 Visual Studio 快速直观地识别 C 中的重载运算符 在我看来 C 中的一大问题是不知道您正在使用的运算符是否已重载 Visual Studio 或某些第三方工具中是否有某些功能可以自动突出显示重载运算符或对重载运
  • 为什么从字典中获取时会得到 Action<> 的克隆?

    我有以下字典 private Dictionary
  • 在视口中查找 WPF 控件

    Updated 这可能是一个简单或复杂的问题 但在 wpf 中 我有一个列表框 我用一个填充数据模板从列表中 有没有办法找出特定的数据模板项位于视口中 即我已滚动到其位置并且可以查看 目前我连接到了 listbox ScrollChange
  • 在 NaN 情况下 to_string() 可以返回什么

    我使用 VS 2012 遇到了非常令人恼火的行为 有时我的浮点数是 NaN auto dbgHelp std to string myFloat dbgHelp最终包含5008角色 你不能发明这个东西 其中大部分为0 最终结果是 0 INF
  • 如何在 C 中安全地声明 16 位字符串文字?

    我知道已经有一个标准方法 前缀为L wchar t test literal L Test 问题是wchar t不保证是16位 但是对于我的项目 我需要16位wchar t 我还想避免通过的要求 fshort wchar 那么 C 不是 C
  • 为什么这个二维指针表示法有效,而另一个则无效[重复]

    这个问题在这里已经有答案了 这里我编写了一段代码来打印 3x3 矩阵的对角线值之和 这里我必须将矩阵传递给函数 矩阵被传递给指针数组 代码可以工作 但问题是我必须编写参数的方式如下 int mat 3 以下导致程序崩溃 int mat 3
  • 检测到严重错误 c0000374 - C++ dll 将已分配内存的指针返回到 C#

    我有一个 c dll 它为我的主 c 应用程序提供一些功能 在这里 我尝试读取一个文件 将其加载到内存 然后返回一些信息 例如加载数据的指针和内存块的计数到 c Dll 成功将文件读取到内存 但在返回主应用程序时 程序由于堆损坏而崩溃 检测
  • C++ new * char 不为空

    我有一个问题 我在 ASIO 中开发服务器 数据包采用尖头字符 当我创建新字符时 例如char buffer new char 128 我必须手动将其清理为空 By for int i 0 i lt 128 i buffer i 0x00
  • String.Empty 与 "" [重复]

    这个问题在这里已经有答案了 可能的重复 String Empty 和 有什么区别 https stackoverflow com questions 151472 what is the difference between string
  • 将数组作为参数传递

    如果我们修改作为方法内参数传递的数组的内容 则修改是在参数的副本而不是原始参数上完成的 因此结果不可见 当我们调用具有引用类型参数的方法时 会发生什么过程 这是我想问的代码示例 using System namespace Value Re
  • 可访问性不一致:参数类型的可访问性低于方法

    我试图在两个表单之间传递一个对象 基本上是对当前登录用户的引用 目前 我在登录表单中有一些类似的内容 private ACTInterface oActInterface public void button1 Click object s
  • 如何在richtextbox中使用多颜色[重复]

    这个问题在这里已经有答案了 我使用 C windows 窗体 并且有 richtextbox 我想将一些文本设置为红色 一些设置为绿色 一些设置为黑色 怎么办呢 附图片 System Windows Forms RichTextBox有一个
  • 使用 C 在 OS X 中获取其他进程的 argv

    我想获得其他进程的argv 例如ps 我使用的是在 Intel 或 PowerPC 上运行的 Mac OS X 10 4 11 首先 我阅读了 ps 和 man kvm 的代码 然后编写了一些 C 代码 include
  • 不区分大小写的字符串比较 C++ [重复]

    这个问题在这里已经有答案了 我知道有一些方法可以进行忽略大小写的比较 其中涉及遍历字符串或一个good one https stackoverflow com questions 11635 case insensitive string

随机推荐