编辑:任何人都可以帮助我使用正则表达式为这样的字符串?:
[Header 1], [Head,er 2], Header 3
这样我就可以把它分成几块:
[Header 1]
[Head,er 2]
Header 3
我已经达到了这个目的:
(?<=,|^).*?(?=,|$)
Run Code Online (Sandbox Code Playgroud)
哪个会给我:
[Header 1]
[Head
,er 2]
Header 3
这是我为CRM 2011编写的插件的一个工作示例.我在此插件的插件注册工具中创建了一个"创建"步骤.这执行得很好.我还为插件注册了"更新"步骤.由于返回的主要联系人为空,因此无法执行.这些步骤都注册为异步.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xrm.Sdk;
using System.ServiceModel;
using System.IO;
using System.Net;
namespace CRMNewsletterPlugin
{
public class NewsletterSignup : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
// Obtain the execution context from the service provider.
IPluginExecutionContext context = (IPluginExecutionContext)
serviceProvider.GetService(typeof(IPluginExecutionContext));
tracingService.Trace("Begin load");
// The InputParameters collection contains all the data passed in the message request.
if (context.InputParameters.Contains("Target") &&
context.InputParameters["Target"] is Entity)
{
tracingService.Trace("We have a target.");
// Obtain the target …Run Code Online (Sandbox Code Playgroud)