想要对EWS方法进行多线程 [英] Want to multi-thread a EWS method

查看:59
本文介绍了想要对EWS方法进行多线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

我正在EWS(Exchange Web服务)项目上工作,我想对一种方法进行多线程处理.
我有一个像这样的删除方法:

CustomClass.Delete(). //如果被调用
,则此项仅删除一项
如何使用多线程Delete()方法?此方法将仅删除1个项目
从collection.but我希望能够删除多个项目
同时.就像发射火箭一样.
我用了这个但没有成功:

Hi Friends,

I am working on EWS(Exchange Web Service) project and i want to multi-thread one method.
I have a delete method like this:

CustomClass.Delete(). //this delete only one item if called

How to multi-thread Delete() method?This method will delete only 1 item
from the collection.But i want to be able to delete multiple items
at the same time.Like firing a rocket.
I used this but no success:

ThreadStart operation=new ThreadStart(Delete())

for(int x=1;x<=10;++x)
{
   Thread th=new Thread(operation)
   th,Start();
}



在此先谢谢您.
Talley



Thanks in advanced.
Talley

推荐答案

假定Delete方法具有正确的签名void Delete()

Assuming the Delete method has the proper signature, void Delete()

ThreadStart operation=new ThreadStart(Delete);

for(int x=1;x<=10;++x)
{
   Thread th=new Thread(operation);
   th.Start();
}



http://msdn.microsoft.com/en-us/library/system.threading. threadstart.aspx [ ^ ]



http://msdn.microsoft.com/en-us/library/system.threading.threadstart.aspx[^]


因为它已被删除,我正在重新发布它,以便所有人都能看到您卑鄙的态度.

谢谢您的答复.Dave Kreskowiak.如果您不能帮忙,请不用争论.我是MCSD.多线程是指同时执行操作."多线程旨在通过允许已经存在的资源来更明智地利用计算机资源.可以同时使用".
Because it was deleted I''m reposting it so all can see your despicable attitude.

Thank you for reply Dave Kreskowiak.If you cannot help then please there is no need to argue.I am MCSD.Multi-thread is about executing action concurrently." multithreading is intended to make wiser use of computer resources by allowing resources that are already in use to be simultaneously"


谢谢你!戴夫!我是个忙碌的人,回答你的无稽之谈确实没什么不礼貌.我问了一个问题,我收到了很多反馈时不加判断.您是带着态度来找我的,优秀的程序员每天都在做事.对您来说,最简单的事情是如果不能帮助就保持安静,那样简单.如果您不能解决问题,则需要停止对人的问题发表评论.您输入的所有内容都保存在codeproject.com的日志表中.我向您报告了codeproject.为您提供的信息,我不仅讲5种计算机语言,而且还讲.net,php,objective-c和ruby.您会发现我编写了一个完美的多线程代码.自己解决了我的问题以获取您的信息.

希望您一切都好!

保重!
塔利
MCSD/EAD
Thank you Dave!I am a busy guy and truly there is nothing rude about answering to your non-sense.I asked a question and i received a lot of feedbacks without judgment.You came to me with attitude and great programmers are moderate on what they do everyday.The simplest thing for you is to be quiet if you cannot help,simple like that.You need to stop commenting on people questions if you cannot help.Everything you type here is being saved on a log table on codeproject.com .I reported you to codeproject.For your information i speak 5 computer languages not only .net but php,objective-c and ruby.Look at my post and you will find out i wrote a perfect multi-thread code.I solved my problem by myself for your info.

I hope everything is clear with you!

Take care!
Talley
MCSD/EAD


这篇关于想要对EWS方法进行多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆