本文整理汇总了C#中System.Stream.StartStream方法的典型用法代码示例。如果您正苦于以下问题:C# Stream.StartStream方法的具体用法?C# Stream.StartStream怎么用?C# Stream.StartStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Stream
的用法示例。
在下文中一共展示了Stream.StartStream方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public override void Run()
{
// This is a sample worker implementation. Replace with your logic.
Trace.WriteLine("Shadow.UShadow.Cloud.Worker entry point called", "Information");
// Connect to Twitter.
//
Stream.ProcessTweetDelegate produceTweetDelegate = new Stream.ProcessTweetDelegate(processTweet);
// Creating the stream and specifying the delegate
Stream myStream = new Stream(produceTweetDelegate);
Token token = new Token()
{
AccessToken = "14910567-1AnQzrOuwPFsPd9HrcXrCPBmW7Cwf7doxXqd5vdgi",
AccessTokenSecret = "hHzkPdejgaJkt9VKxW7JGDC0AnJ5GzvlRjhNaHzYzW4",
ConsumerKey = "WFYdWcCCTZk4ASituGqhqQ",
ConsumerSecret = "DfOmNZOrhN31vuEDpm10lxkSSB1MfjVA4Y9oPzSK0gc"
};
myStream.StreamUrl = "https://userstream.twitter.com/1.1/user.json?with=user&track=!Shadow";
// Starting the stream by specifying credentials thanks to the Token
myStream.StartStream(token);
while (true)
{
Thread.Sleep(10000);
Trace.WriteLine("Working", "Information");
}
}