<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Jason Pettys Blog - Latest Comments</title><link>http://jasonpettysblog.disqus.com/</link><description></description><atom:link href="https://jasonpettysblog.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 22 Jun 2020 16:58:30 -0000</lastBuildDate><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-4964287488</link><description>&lt;p&gt;Thank you for this!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mokarenlam</dc:creator><pubDate>Mon, 22 Jun 2020 16:58:30 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-4964286955</link><description>&lt;p&gt;use scope = GmailService.Scope.MailGoogleCom&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mokarenlam</dc:creator><pubDate>Mon, 22 Jun 2020 16:58:05 -0000</pubDate></item><item><title>Re: Read MSMQ Messages from PowerShell</title><link>http://jason.pettys.name/2011/11/07/read-msmq-messages-from-powershell/#comment-4321680771</link><description>&lt;p&gt;Hi Hiren - I'm not certain, but it seems to me that this script can only work with MSMQ &lt;i&gt;directly&lt;/i&gt;, and a complete rewrite would be required to make it work "through WCF."&lt;/p&gt;&lt;p&gt;To say the same thing another way: the "System.Messaging.MessageQueue" object this script uses can only talk in the direct MSMQ language, and you're asking it to speak a WCF-ish language, and it can't do that.&lt;/p&gt;&lt;p&gt;I'm not certain about these things because I haven't used WCF and MSMQ together very much at all, but I guess this is what the problem is. Hope that helps.&lt;/p&gt;&lt;p&gt;Jason&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Mon, 04 Feb 2019 09:21:12 -0000</pubDate></item><item><title>Re: Read MSMQ Messages from PowerShell</title><link>http://jason.pettys.name/2011/11/07/read-msmq-messages-from-powershell/#comment-4321493842</link><description>&lt;p&gt;Hi Jason pettys,&lt;/p&gt;&lt;p&gt;by this powershell script I can able to read msmq queue which is on another forest. But if I try to attempt through WCF service (NetMSMQbinding) it gives me following error.&lt;/p&gt;&lt;p&gt;&lt;a href="https://social.msdn.microsoft.com/Forums/en-US/160e1ea2-8337-402e-a2af-6d1b09d75c8b/queue-path-name-to-the-format-name-unrecognized-error-1072824300-0xc00e0014?forum=msmq" rel="nofollow noopener" target="_blank" title="https://social.msdn.microsoft.com/Forums/en-US/160e1ea2-8337-402e-a2af-6d1b09d75c8b/queue-path-name-to-the-format-name-unrecognized-error-1072824300-0xc00e0014?forum=msmq"&gt;https://social.msdn.microso...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Kindly suggest me if I am doing anything wrong.&lt;/p&gt;&lt;p&gt;Thanks &amp;amp; Regards,&lt;br&gt;Hiren Bharadwa&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hiren Bharadwa</dc:creator><pubDate>Mon, 04 Feb 2019 06:05:11 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-3989966144</link><description>&lt;p&gt;Thank you so much...this saved my time. Google api usage has been causing trouble for me for some time !&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mangesh Tambulwadkar</dc:creator><pubDate>Sun, 15 Jul 2018 15:15:30 -0000</pubDate></item><item><title>Re: Write MSMQ Messages from PowerShell</title><link>http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/#comment-3980316549</link><description>&lt;p&gt;Ah, thanks for letting me know! Silent failures are the worst. I'll stick that piece of knowledge in my back pocket.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Mon, 09 Jul 2018 09:48:53 -0000</pubDate></item><item><title>Re: Write MSMQ Messages from PowerShell</title><link>http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/#comment-3980113445</link><description>&lt;p&gt;Hi Jason, thanks for the reply! As it turns out, the problem was the queue itself. It wasn't set up as a transactional queue, which I wasn't aware of. Unfortunately, there doesn't seem to be a way to transform an existing non-transactional queue into a transactional one, so I had to create a new queue and migrate the system over. Now, code such as the example in your post works fine! I still find it a bit irritating, though, that for a non-transactional queue, there is no feedback at all and messages are just silently dropped…&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/"> ᅠᅠᅠ</dc:creator><pubDate>Mon, 09 Jul 2018 06:20:14 -0000</pubDate></item><item><title>Re: Write MSMQ Messages from PowerShell</title><link>http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/#comment-3980096347</link><description>&lt;p&gt;Sorry, I have no idea why one would get that behavior -- no error on either the .send() or the .commit(), and no result either, seems very strange! Good luck figuring it out, and if you learn something that could improve this code, please let me know.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Mon, 09 Jul 2018 05:53:15 -0000</pubDate></item><item><title>Re: Write MSMQ Messages from PowerShell</title><link>http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/#comment-3976170382</link><description>&lt;p&gt;Any idea why this code might fail to do anything at all?&lt;/p&gt;&lt;p&gt;I'm on an old WS2K8R2 system, and have to administrate MSMQ with PowerShell scripts. I'm doing various other things related to reading, receiving, deleting and analysing messages in a queue with PowerShell scripts using System.Messaging. However, this code to send a message (and various other examples I've found around the web) don't have any effect. I get no error message or anything, the queue simply stays empty. There is no one consuming messages from the queue either (I used journalling to make sure).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/"> ᅠᅠᅠ</dc:creator><pubDate>Fri, 06 Jul 2018 06:02:43 -0000</pubDate></item><item><title>Re: PowerShell: solid password generator</title><link>http://jason.pettys.name/2016/02/12/powershell-solid-password-generator/#comment-3788317619</link><description>&lt;p&gt;Not dead! Just not much to say lately. :)&lt;/p&gt;&lt;p&gt; &lt;a href="https://uploads.disquscdn.com/images/a9a2fd34d1b1958a361cc47fa5ef1136cd5f03c9afa9cb3b30770f9003920bff.jpg" rel="nofollow noopener" target="_blank" title="https://uploads.disquscdn.com/images/a9a2fd34d1b1958a361cc47fa5ef1136cd5f03c9afa9cb3b30770f9003920bff.jpg"&gt;https://uploads.disquscdn.c...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Mon, 05 Mar 2018 11:15:14 -0000</pubDate></item><item><title>Re: PowerShell: solid password generator</title><link>http://jason.pettys.name/2016/02/12/powershell-solid-password-generator/#comment-3784306396</link><description>&lt;p&gt;blog dead ?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Admirador de Damas</dc:creator><pubDate>Fri, 02 Mar 2018 16:18:31 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-3746931462</link><description>&lt;p&gt;I believe you're asking the same question "kiquenet kiquenet" asked. Please refer to my answer there.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Wed, 07 Feb 2018 09:15:54 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-3746733581</link><description>&lt;p&gt;Context code ?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Preguntón Cojonero Cabrón</dc:creator><pubDate>Wed, 07 Feb 2018 06:25:24 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-3210431765</link><description>&lt;p&gt;kiquenet, as the code notes, the way you construct GmailService will be different than the way I did. Further explanation is given in my response to ravinder in this discus comment thread.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Sat, 18 Mar 2017 10:13:07 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-3208760445</link><description>&lt;p&gt;What is (Context.GoogleOAuthInitializer ? full source code ?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">kiquenet kiquenet</dc:creator><pubDate>Fri, 17 Mar 2017 08:47:37 -0000</pubDate></item><item><title>Re: Write MSMQ Messages from PowerShell</title><link>http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/#comment-2718626576</link><description>&lt;p&gt;Thanks, AaronD12 - not sure when that got ugly. I cleaned it up in the original.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Wed, 08 Jun 2016 09:34:07 -0000</pubDate></item><item><title>Re: Write MSMQ Messages from PowerShell</title><link>http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/#comment-2717326758</link><description>&lt;p&gt;Here it is cleaned up:&lt;/p&gt;&lt;p&gt;[Reflection.Assembly]::LoadWithPartialName("System.Messaging");&lt;/p&gt;&lt;p&gt;$queueName = '.\Private$\&lt;a href="http://your.queue.name" rel="nofollow noopener" target="_blank" title="your.queue.name"&gt;your.queue.name&lt;/a&gt;';&lt;br&gt;$queue = new-object System.Messaging.MessageQueue $queueName;&lt;br&gt;$utf8 = new-object System.Text.UTF8Encoding;&lt;/p&gt;&lt;p&gt;$tran = new-object System.Messaging.MessageQueueTransaction;&lt;br&gt;$tran.Begin();&lt;/p&gt;&lt;p&gt;$msgContent = '&amp;lt;messages xmlns="your-xml-namespace"&amp;gt;&amp;lt;iwebapplicationstartupcompleting&amp;gt;&amp;lt;/iwebapplicationstartupcompleting&amp;gt;&amp;lt;/messages&amp;gt;';&lt;br&gt;$msgBytes = $utf8.GetBytes($msgContent);&lt;/p&gt;&lt;p&gt;$msgStream = new-object System.IO.MemoryStream;&lt;br&gt;$msgStream.Write($msgBytes, 0, $msgBytes.Length);&lt;/p&gt;&lt;p&gt;$msg = new-object System.Messaging.Message;&lt;br&gt;$msg.BodyStream = $msgStream;&lt;br&gt;$queue.Send($msg, $tran);&lt;/p&gt;&lt;p&gt;$tran.Commit();&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">AaronD12</dc:creator><pubDate>Tue, 07 Jun 2016 15:07:58 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-2654001231</link><description>&lt;p&gt;Hi Juan,&lt;/p&gt;&lt;p&gt;I googled "GmailService c#" and the first link is the documentation from google on getting started, including sample code that demonstrates constructing an authenticating GmailService instance:&lt;/p&gt;&lt;p&gt;&lt;a href="https://developers.google.com/gmail/api/quickstart/dotnet" rel="nofollow noopener" target="_blank" title="https://developers.google.com/gmail/api/quickstart/dotnet"&gt;https://developers.google.c...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Good luck.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Mon, 02 May 2016 12:43:10 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-2651215589</link><description>&lt;p&gt;hi, i am getting this error.&lt;/p&gt;&lt;p&gt;Login Required [401]&lt;/p&gt;&lt;p&gt;Errors [&lt;/p&gt;&lt;p&gt;    Message[Login Required] Location[Authorization - header] Reason[required] Domain[global]&lt;/p&gt;&lt;p&gt;]&lt;/p&gt;&lt;p&gt;I think is because I constructed the gmailservice like this:&lt;/p&gt;&lt;p&gt;var gmail = new GmailService();&lt;/p&gt;&lt;p&gt;I get that I must give the constructor some kind of reference to the OAuth2, but I havent found a way to do it.&lt;/p&gt;&lt;p&gt;I am using the default MVC WebApp in visual studio 2013, on which you just have to uncomment a piece of code in Startup.Auth.cs to enable gmail validation.&lt;/p&gt;&lt;p&gt;Could you help me please.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Juan</dc:creator><pubDate>Sat, 30 Apr 2016 14:56:26 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-2621628529</link><description>&lt;p&gt;In addition to referring to you the info I gave to ravinder below, I just updated the blog post, adding a comment to clarify what Context is all about. Thanks for pointing out that it was unclear!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Wed, 13 Apr 2016 11:22:14 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-2621416931</link><description>&lt;p&gt;Benjamin, see the comment below by ravinder, and my reply. Does that explain?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Wed, 13 Apr 2016 09:13:00 -0000</pubDate></item><item><title>Re: Sending Email with the Gmail API in .NET / C#</title><link>http://jason.pettys.name/2014/10/27/sending-email-with-the-gmail-api-in-net-c/#comment-2620973537</link><description>&lt;p&gt;Context does not contain a definition for GoogleOAuthInitializer. &lt;br&gt;And/or Context does not have a namespace.&lt;br&gt;Any ideas?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benjamin Thomas Parnau</dc:creator><pubDate>Wed, 13 Apr 2016 00:51:53 -0000</pubDate></item><item><title>Re: PowerShell: solid password generator</title><link>http://jason.pettys.name/2016/02/12/powershell-solid-password-generator/#comment-2519344917</link><description>&lt;p&gt;I'm not seeing anything else. :)&lt;/p&gt;&lt;p&gt;I think another benefit of the RNGCryptServiceProvider isn't just the lack of a bias, but the fact that it is truly more random and harder to predict what the next number to be picked will be.&lt;/p&gt;&lt;p&gt;One thought is that if this is a code/password that is meant to be manually entered in by a user, it could be nice to eliminate somewhat ambiguous characters like 0 and O or I, l and 1 from the selection.  You've set it up in a very nice way to do that by just removing them from the allowed characters string.  It results in fewer possible combinations, but improves the experience for an end-user. :)  If it is just sent in a way that it can be copy-pasted, or used in a link, it probably isn't a concern, though.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dan Jenkins</dc:creator><pubDate>Wed, 17 Feb 2016 11:41:39 -0000</pubDate></item><item><title>Re: PowerShell: solid password generator</title><link>http://jason.pettys.name/2016/02/12/powershell-solid-password-generator/#comment-2519188599</link><description>&lt;p&gt;Excellent - I've updated the code snippet per your recommendation - it was quite a bit more straightforward than I had originally thought it would be. Thanks!&lt;/p&gt;&lt;p&gt;Of course you're right that the bias is trivial. In fact my first version did modulus on a random unsigned long, and so the bias was like 1 x 10^-18 or something... but it still seemed odd to take the time to use RNGCryptoServiceProvider rather than just Random, and then add any bias back. If you start with RNGCryptoServiceProvider, might as well make it Solid all the way down, I guess.&lt;/p&gt;&lt;p&gt;Thanks again for helping me improve it. Anything else you see, now that we minimize thrown-away bits? There's definitely some places where an off-by-one error may be lurking. :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason</dc:creator><pubDate>Wed, 17 Feb 2016 11:07:58 -0000</pubDate></item><item><title>Re: PowerShell: solid password generator</title><link>http://jason.pettys.name/2016/02/12/powershell-solid-password-generator/#comment-2517261081</link><description>&lt;p&gt;Yep.  That makes sense.  Most applications that extra 1/256 (0.39%) chance of the lower bounds being selected is not significant enough to matter much.   As you stated, though, instead of throwing away everything &amp;gt; $allowedChars.Length you could reduce the number of characters thrown away by instead throwing away everything greater than Floor(256 / $allowedChars.Length).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dan Jenkins</dc:creator><pubDate>Tue, 16 Feb 2016 14:49:05 -0000</pubDate></item></channel></rss>