.NET Framework Networking and Communication ForumDiscuss general managed code networking topics not relating to System.Net or Windows Communication Foundation (WCF).© 2009 Microsoft Corporation. All rights reserved.Sat, 28 Nov 2009 11:00:38 Z9a657749-56cc-4c35-af80-b514c8693c79http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/326c0c05-d833-4bae-8f64-b3738cfb2e8chttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/326c0c05-d833-4bae-8f64-b3738cfb2e8cJohnStocktonhttp://social.msdn.microsoft.com/Profile/en-US/?user=JohnStocktonThe specified string is not in the form required for an e-mail addressI have searched and searched and searched for an answer to this problem...<br><br>I have been using the System.Net.Mail namespace for quite a while to send emails from my websites. A problem occurs though on certain (VALID) email addresses. For example, when the name field of the email address has a dot (.) in it (example: my.name@email.com), an exception is raised when this address is added to the TO property of the MailAdddress object. It seems the dot between my and name causes the exception.<br><br>Please note that these are valid email addresses, but the MailAddress object considers them to be invalid.<br><br>Any suggestions/workarounds?<br><br>Error Message: The specified string is not in the form required for an e-mail address.<br>Stack Trace: at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32&amp; offset, String&amp; displayName)<br>at System.Net.Mail.MailAddress.ParseValue(String address)<br>at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding)<br>at System.Net.Mail.MailAddress..ctor(String address, String displayName)<br>Fri, 07 Sep 2007 16:44:04 Z2009-11-28T11:00:37Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/8a0c4c74-4465-4c09-8e29-57c31e04c7aahttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/8a0c4c74-4465-4c09-8e29-57c31e04c7aaDelademhttp://social.msdn.microsoft.com/Profile/en-US/?user=DelademCould not load file or assembly 'xe.Data.SqlClient' or one of its dependencies. The system cannot find the file specified. (C:\Documents and Settings\Vortex\My Documents\Visual Studio 2005\WebSites\test\web.config line 25)<p>I use visual studio 2005.I was using netTiers to create an instance of a class. After running I got the following error;</p> <p>Could not load file or assembly 'xe.Data.SqlClient' or one of its dependencies. The system cannot find the file specified. (C:\Documents and Settings\Vortex\My Documents\Visual Studio 2005\WebSites\test\web.config line 25)<br/><br/>I use a toshiba L25 series laptop with the following specifications;<br/>1.50 GHz, 1.12 GB of RAM<br/>1.50GHz processor Intel Celeron M<br/>running on a microsoft windows vista ultimate edition(version 2006, service pack1, build 6001)</p>Thu, 26 Nov 2009 11:33:30 Z2009-11-28T08:02:03Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/2c2ad45d-b2db-491b-8b38-18173ab6e4cchttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/2c2ad45d-b2db-491b-8b38-18173ab6e4ccgrmotildhttp://social.msdn.microsoft.com/Profile/en-US/?user=grmotildDelete file from FTP with PROXY<p>Hello. I need to delete file from FTP with option to pass Proxy. I have found code for <strong>upload</strong> file but can't find for <strong>delete</strong>. <br/>Here is the code for upload that works for me (the main function calls first):<br/><br/>    Private Function CreateProxyAndCheckBypass(ByVal bypassLocal As Boolean, ByVal ftpIp As String, ByVal ftpName As String) As WebProxy<br/>        Dim bypassList As String() = New String() {&quot;;*.&quot; &amp; ftpIp}<br/>        Dim proxy As New WebProxy(ftpIp, bypassLocal, bypassList)<br/>        If Not proxy.IsBypassed(New Uri(ftpName)) Then<br/>                 Return Nothing        'Bypass not working<br/>        Else<br/>                 Return proxy           'Bypass is working<br/>        End If<br/>    End Function</p> <p>    Public Function ftpUpload(ByVal ftpIP As String, ByVal ftpUserName As String, ByVal ftpPassword As String, ByVal fileNameToUpload As String, ByVal filePathToUpload As String) As Boolean<br/>        Dim ftpName As String = &quot;ftp://&quot; &amp; ftpIP<br/>        Try<br/>            Using client As New System.Net.WebClient()<br/>                Dim ur As New System.Uri(ftpName)<br/>                client.Proxy = CreateProxyAndCheckBypass(True, ftpIP, ftpName)<br/>                client.Credentials = New System.Net.NetworkCredential(ftpUserName, ftpPassword)<br/>                client.UploadFile((ftpName &amp; &quot;/&quot;) + fileNameToUpload, &quot;STOR&quot;, filePathToUpload)<br/>            End Using<br/>            Return True<br/>        Catch ex As Exception<br/>            Return False<br/>        End Try<br/>    End Function<br/><br/>Any help very appreciated. Thanks</p><hr class="sig">MichaelThu, 26 Nov 2009 11:54:10 Z2009-11-28T07:58:13Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/673817a5-bab9-47bb-adf2-654f9f42738bhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/673817a5-bab9-47bb-adf2-654f9f42738bshortcutshttp://social.msdn.microsoft.com/Profile/en-US/?user=shortcutsIp connection not foundHey,<br/><br/>I made a little client and server so i could chat between 2computers, using ip connection.<br/><br/>It works fine, but i doesn't work with everyone. <br/>I tried to login from different computers, but it only works when i try from my dad's computer and also with one of my friends computer.<br/><br/><br/>So i'm wondering what the problem could be, that other computers can't find my server?<br/>I gues it has something to do with properties but don't know what yet.<br/><br/>thnx..<br/><br/>Thu, 19 Nov 2009 17:48:51 Z2009-11-27T15:48:49Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/b9ea4c38-7890-4b74-894d-666b3ef11e4bhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/b9ea4c38-7890-4b74-894d-666b3ef11e4bRoetjehttp://social.msdn.microsoft.com/Profile/en-US/?user=RoetjeWindows Server 2008 outlook comException 0x8000401AHey guys, <br/><br/>i'm having a problem with the windows server 2008. The same code does work in server 2003. Last weak we switched to 2008. Now i am getting the following error:<br/><br/>System.Runtime.InteropServices.COMException (0x8000401A): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 8000401a.<br/><br/>I'm trying to start a new outlook application, but it seems that the server won't let me. However, i'm impersonating to the server, tried several account( system, interactive, network etc. etc) But nothing seems to help. <br/>I've also modified the dcomcnfg for excel (same problem, if is skip outlook). And gave everything rights for everything. <br/><br/>Now... here comes the strange part: when i remote login tothe server as the impersonated user (acc-dbuser) then it will work fine. The proces is going perfect. So i was thinking, it must be something with rights. BUT, if i log in as a(ny random) user to the server,the process also runs, and it starts opening outlook as acc-dbuser(impersonated user). However, if there is no session on the server, it holds and stops doing everything.<br/><br/>Any clues? I can't seem to find the problem!<br/>The code: <br/> <div style="background-color:white;color:black"> <pre><span style="color:blue">Private</span> <span style="color:blue">Sub</span> ReadUufMsg(<span style="color:blue">ByVal</span> msgFileName <span style="color:blue">As</span> <span style="color:blue">String</span>) <span style="color:green">'Instellingen.</span> <span style="color:blue">Dim</span> uufPath <span style="color:blue">As</span> <span style="color:blue">String</span> = <span style="color:blue">Me</span>.GetImportPath(<span style="color:blue">False</span>) <span style="color:blue">Dim</span> uufPathBackup <span style="color:blue">As</span> <span style="color:blue">String</span> = <span style="color:blue">Me</span>.GetImportPath(<span style="color:blue">True</span>) <span style="color:blue">Dim</span> uufPathEmail <span style="color:blue">As</span> <span style="color:blue">String</span> = System.Configuration.ConfigurationManager.AppSettings(<span style="color:#a31515">&quot;PathNameUufFilesEmail&quot;</span>).ToUpper <span style="color:blue">If</span> <span style="color:blue">Not</span> File.Exists(msgFileName) <span style="color:blue">Then</span> <span style="color:blue">Throw</span> <span style="color:blue">New</span> ApplicationException(<span style="color:#a31515">&quot;Het bestand bestaat niet.&quot;</span>) <span style="color:green">'Outlook objecten.</span> <span style="color:blue">Dim</span> olApplication <span style="color:blue">As</span> Outlook.Application = <span style="color:blue">Nothing</span> <span style="color:blue">Dim</span> olItem <span style="color:blue">As</span> Outlook.MailItem = <span style="color:blue">Nothing</span> <span style="color:blue">Dim</span> olAttachments <span style="color:blue">As</span> Outlook.Attachments = <span style="color:blue">Nothing</span> <span style="color:blue">Try</span> <span style="color:green">'XML Importeren.</span> ToolboxTracing.LogInfo(<span style="color:#a31515">&quot;aaanmaken outlook.application&quot;</span>) <em><strong><span style="text-decoration:underline">olApplication = <span style="color:blue">New</span> Outlook.Application</span></strong></em> <span style="color:green">'CType(CreateObject(&quot;Outlook.Application&quot;), Outlook.Application) 'NOT WORKING</span> ToolboxTracing.LogInfo(<span style="color:#a31515">&quot;Outlook aangemaakt.&quot;</span>) olItem = <span style="color:blue">CType</span>(olApplication.CreateItemFromTemplate(msgFileName), Outlook.MailItem) olAttachments = olItem.Attachments ToolboxTracing.LogInfo(<span style="color:#a31515">&quot;Items aangemaakt.&quot;</span>) <span style="color:blue">For</span> iAttachment <span style="color:blue">As</span> <span style="color:blue">Integer</span> = 1 <span style="color:blue">To</span> olAttachments.<span style="color:blue">Count</span> <span style="color:green">'1-Based.</span> <span style="color:blue">Dim</span> olAttachment <span style="color:blue">As</span> Outlook.Attachment = olAttachments(iAttachment) <br/><br/> <span style="color:blue">Try</span> <span style="color:green">'Import.</span> <span style="color:blue">If</span> ((olAttachment.FileName.ToLower.EndsWith(<span style="color:#a31515">&quot;.xlsx&quot;</span>)) <span style="color:blue">Or</span> (olAttachment.FileName.ToLower.EndsWith(<span style="color:#a31515">&quot;.xls&quot;</span>))) <span style="color:blue">Then</span> <span style="color:green">'If olAttachment.FileName.ToLower.EndsWith(&quot;.xls&quot;) Then</span> <span style="color:blue">Dim</span> xlsFilePath <span style="color:blue">As</span> <span style="color:blue">String</span> <span style="color:blue">If</span> olAttachment.FileName.ToLower.EndsWith(<span style="color:#a31515">&quot;.xlsx&quot;</span>) <span style="color:blue">Then</span> xlsFilePath = msgFileName.Substring(0, msgFileName.Length - 4) + <span style="color:#a31515">&quot;.xlsx&quot;</span> <span style="color:blue">Else</span> xlsFilePath = msgFileName.Substring(0, msgFileName.Length - 4) + <span style="color:#a31515">&quot;.xls&quot;</span> <span style="color:blue">End</span> <span style="color:blue">If</span> olAttachment.SaveAsFile(xlsFilePath) <span style="color:blue">Try</span> ToolboxTracing.LogInfo(<span style="color:#a31515">&quot;ImportUUF&quot;</span>) <span style="color:blue">Me</span>.ImportUufXls(xlsFilePath, iAttachment) <span style="color:blue">Catch</span> ex <span style="color:blue">As</span> Exception MailMessageUuf(xlsFilePath) ToolboxTracing.LogError(ex.ToString + vbCrLf + ex.StackTrace) <span style="color:blue">End</span> <span style="color:blue">Try</span> <span style="color:green">'etc etc</span> </pre> </div>Fri, 27 Nov 2009 12:01:12 Z2009-11-27T12:01:13Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/f2920f3c-987b-4686-bb89-29b796a56560http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/f2920f3c-987b-4686-bb89-29b796a56560Herbalshttp://social.msdn.microsoft.com/Profile/en-US/?user=HerbalsA Professional Piece of Software to Rip DVD and Convert Video<span class=postbody>Some of you would like to put your DVD collections on your computers or share the classical Movies with your friends. <br/>Or some of you prefer to put wonderful videos on portable devices such as iPod, iPhone, PSP, Mobile Phone, Zune, Creative Zen, iRiver, Sansa, etc., to be served as DVD Players or Video players. <br/><br/>So you have to think out a way of solving the conversion. Recently Tipard Studio release a third-party conversion software named <span style="font-weight:bold"><a class=postlink href="http://www.tipard.com/dvd-ripper-pack.html">DVD Ripper Pack</a></span>. It is the professional combination of <span style="font-weight:bold"><a class=postlink href="http://www.tipard.com/dvd-ripper.html">DVD Rip Software</a></span> and <span style="font-weight:bold"><a class=postlink href="http://www.tipard.com/video-converter.html">Video Converter </a></span>. This software can rip DVD and convert video formats to many other video formats such as MP4, H.264, AVI, MP3, WMV, WMA, FLV, MKV, MPEG-1, MPEG-2, 3GP, 3GPP, VOB, DivX, MOV, RM, RMVB, M4A, AAC, WAV, etc. supported by the portable devices. <br/><br/>This guide shows you how to Rip DVD and convert videos to AVI, WMV video formats supported by your portable devices. <br/><br/>To start the conversion you should free download <span style="font-weight:bold"><a class=postlink href="http://tipard.com/download/dvd-ripper-pack.exe">Tipard DVD Ripper Pack </a>and install it. <br/><br/><img src="http://www.tipard.com/guide/dvd-ripper-pack/interface.jpg" border=0 alt=""> <br/><br/><span style="font-weight:bold">Note:</span> <br/>Shown as the image above, if you want to rip DVD, please select DVD Ripper; otherwise, please select Video Converter. <br/><br/>Next the specific steps are explained as follows: <br/><br/><span style="font-weight:bold">Part 1: How to Rip DVD and edit DVD to popular video</span> <br/><br/><span style="font-weight:bold">Step 1:</span> Load your DVD by clicking “Load DVD”. <br/><br/><img src="http://www.tipard.com/guide/dvd-ripper-pack/dvd-ripper-interface.jpg" border=0 alt=""> <br/><br/><span style="font-weight:bold">Step 2:</span> Choose the output format and set the exact parameters <br/>Click “Profile” drop down arrow to choose the output format you want. <br/>Click “Settings” to set the exact video and audio parameters to fit for your player. <br/><span style="font-weight:bold">Step 3:</span> Select your file path by clicking “Browse” button or select the default path by software. <br/><span style="font-weight:bold">Step 4:</span> Click “Start” button to begin the conversion <br/>Wait for a short moment, the conversion will be finished soon. <br/><br/><span style="font-weight:bold">The software has other editing functions:</span> <br/><br/><span style="font-weight:bold">1. Set audio track and subtitles for your converted video</span> <br/>“Audio Track” and “Subtitle” are under the preview window <br/><br/><span style="font-weight:bold">2. Get any time-length video clips</span> <br/>Click “Trim” button to open the trim window, you can set the exact begin and end time for your clips or just drag the slider bar. <br/><br/><span style="font-weight:bold">3. Adjust the video play region</span> <br/>Click “Crop” to open the crop window to crop off the black edges around your video or adjust any video play region. You can also set the video play ratio when playing on player: keep original, full screen, 16:9, 4:3. <br/><br/><span style="font-weight:bold">4. Set the video effect</span> <br/>Click “Effect” to adjust the video Brightness, Contrast, Saturation and Volume for you to get the perfect playing effect. <br/><span style="font-weight:bold">5. Join several chapters of your DVD into one file</span> <br/>Select the chapters that you want to join, and then pick “Merge into one file”. After conversion, these chapters will be saved into one file. <br/><br/><span style="font-weight:bold">Part 2: How to Convert video to popular video</span> <br/><br/>After you click “Video Converter”, another interface appears as follows: <br/><br/><img src="http://www.tipard.com/guide/tipard-video-converter/import.jpg" border=0 alt=""> <br/><br/><span style="font-weight:bold">Step 1: </span>Add files <br/>Click “Add File” to add your video files. <br/><span style="font-weight:bold">Step 2: </span>Set output video format <br/>Click “Profile” button from the drop-down list to select the output video format such as AVI, MPG, MPEG and WMV. You can click the “Settings” button to set parameters of your output video such as Frame Rate, Bitrate to get the best video quality as you want. <br/><span style="font-weight:bold">Step 3: </span>Click the “Start” button to start the conversion. <br/><br/><span style="font-weight:bold">Note:</span> <br/>The powerful editing functions of the video converter: <br/><span style="font-weight:bold">1: Snapshot</span> <br/>If you like the current image of the video you can use the “Snapshot” option, just click the “Snapshot” button and the image will be saved and then click the “Open” button next to “Snapshot” button to open your picture. <br/><span style="font-weight:bold">2: Merge</span> <br/>If you want to merge several videos into one file you can choose them at one time and click the “Merge into one file” to do it. <br/><span style="font-weight:bold">3: Effect</span> <br/>Click “Effect” button you can do these actions: adjusting brightness, contrast and saturation of the video. You can easily adjust the video through two windows in the same interface. <br/><br/><img src="http://www.tipard.com/guide/tipard-video-converter/effect.jpg" border=0 alt=""> <br/><br/><span style="font-weight:bold">4: Trim</span> <br/>If you just want convert a clip of your video, then you can use the &quot;Trim&quot; icon to set the Start time and End time of the clip or you can directly drag the slide bar to the accurate position. <br/><br/><img src="http://www.tipard.com/guide/tipard-video-converter/trim.jpg" border=0 alt=""> <br/><br/><span style="font-weight:bold">5: Crop</span> <br/>By using the “Crop” function you can crop the black edge of your video and you can also drag the line around the video image to adjust your video to your Google Phone. <br/><br/><img src="http://www.tipard.com/guide/tipard-video-converter/crop.jpg" border=0 alt=""> <br/><br/>With it you can Rip and edit your DVD or convert video to any video formats you like with fast conversion speed and excellent image/sound quality. <br/><br/><a class=postlink href="http://www.tipard.com/iphone-video-converter.html">iPhone Video Converter</a> <br/><br/><a class=postlink href="http://www.tipard.com/flv-converter.html">FLV Converter</a></span></span>Fri, 27 Nov 2009 01:16:00 Z2009-11-27T01:16:01Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/1eb467b8-e0ce-4dd0-b5dd-4bcd115c15dbhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/1eb467b8-e0ce-4dd0-b5dd-4bcd115c15dbRoger Moorehttp://social.msdn.microsoft.com/Profile/en-US/?user=Roger%20MooreServer Error in '/FormsAuthorization' Application... Request for the permission of type 'System.Web.AspNetHostingPermission...' failed.Please note that I have been abled to get a forms authorization website working without a problem using Visual Studio 2008 with IIS 6.0 on Microsoft Windows Xp (cf. <a href="http://www.codeproject.com/KB/web-security/RolesFormsAuthorization.aspx">http://www.codeproject.com/KB/web-security/RolesFormsAuthorization.aspx</a>); however, when I attempt to access the website on a Windows 7 server <a href="http://localhost/FormsAuthorization/Admin/Default.aspx">http://localhost/FormsAuthorization/Admin/Default.aspx</a>[<a title="New Window" href="http://localhost/FormsAuthorization/Admin/Default.aspx">^</a>] using IIS 7.5 with Visual Studio 2010 Beta 2, I receive the following errors:<br/><br/> <pre>Server Error in '/FormsAuthorization' Application. -------------------------------------------------------------------------------- Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Source Error: Line 38: protected void Application_AuthenticateRequest(Object sender,EventArgs e) Line 39: { Line 40: FormsAuthenticationUtil.AttachRolesToUser(); Line 41: } Line 42: Source File: c:\inetpub\wwwroot\FormsAuthorization\Global.asax Line: 40 Stack Trace: [SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] FormsAuthenticationUtil.AttachRolesToUser() +0 ASP.global_asax.Application_AuthenticateRequest(Object sender, EventArgs e) in c:\inetpub\wwwroot\FormsAuthorization\Global.asax:40 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +171 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 </pre> <br/><br/><br/>Also, when I open the existing website in Visual Studio 2010 Beta 2, it has the following error messages (there are no error messages when I open the website on IIS 6.0/Windows Xp with Visual Studio 2008):<br/><br/> <pre>Warning 1 C:\inetpub\wwwroot\FormsAuthorization\Default.aspx: ASP.NET runtime error: Value cannot be null. Parameter name: frameworkName C:\inetpub\wwwroot\FormsAuthorization\Default.aspx 1 1 C:\...\FormsAuthorization\ Warning 2 C:\inetpub\wwwroot\FormsAuthorization\Login.aspx: ASP.NET runtime error: Value cannot be null. Parameter name: frameworkName C:\inetpub\wwwroot\FormsAuthorization\Login.aspx 1 1 C:\...\FormsAuthorization\ Warning 3 C:\inetpub\wwwroot\FormsAuthorization\Global.asax: ASP.NET runtime error: Value cannot be null. Parameter name: frameworkName C:\inetpub\wwwroot\FormsAuthorization\Global.asax 1 1 C:\...\FormsAuthorization\ Error 4 Value cannot be null. Parameter name: frameworkName </pre> <br/><br/>Does anyone have any suggestions?  Why would it work on IIS 6.0 but not on IIS 7.5?  I've tried modifying the permissions on IIS 7.5 Manager .NET Trust Levels from Full (internal) to Minimal, but that results in the website giving the error &quot;Debugging is not supported under current trust level settings.&quot;  Please note that I'm new to IIS 7.5 and in fact to Microsoft web servers in general, so if you have any ideas they would be greatly appreciated.  <br/>Thu, 26 Nov 2009 22:48:01 Z2009-11-26T23:38:35Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c0f1eaac-92f6-42cc-8e49-5820bda1dfcfhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c0f1eaac-92f6-42cc-8e49-5820bda1dfcfRobert Ovenshttp://social.msdn.microsoft.com/Profile/en-US/?user=Robert%20OvensHow do I authenticate with a WCF service in a different domain that is using Integrated Authentication?I have a WPF client that connects to a set of WCF web services. We have a Dev, Test, Volume and Production domains, with the services available on a server in each domain. The domains have only partial trust relationships.<br/> <br/> The goal is to have the client connect the the services of any domain. If the client and server are on the same domain then the Default Network Credentials should be sent to authenticate/authorize. If the server is in a different domain, then it should challenge the user for credentials, much in the same way Internet Explorer does when you hit a site on a different domain with Integrated Security set.<br/> <br/> At the moment i'm trying to fetch the clients credentials by setting DisplayInitializationUI() when creating an instance of the ClientBase for my service.<br/> <br/> <br/> <pre lang="x-c#">Client client = new Client(); // &lt;- the wcf ClientBase implementation for the serivce.<br/> client.Endpoint.Behaviors.Remove&lt;ClientCredentials&gt;();<br/> client.Endpoint.Behaviors.Add&lt;ClientCredentialsEx&gt;();<br/> client.DisplayInitializationUI();<br/> client.InnerChannel.Open();</pre> The ClientCredentialsEx class.<br/> <br/> <pre lang="x-c#">public class ClientCredentialsEx : ClientCredentials { public ClientCredentialsEx() : base() { } public ClientCredentialsEx(ClientCredentialsEx other) : base(\ public override void ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior) { behavior.InteractiveChannelInitializers.Add(new ShowCredentialUI()); base.ApplyClientBehavior(serviceEndpoint, behavior); } protected override ClientCredentials CloneCore() { return new ClientCredentialsEx(this); } } </pre> The ShowCredentialUI class implements IInteractiveChannelInitializer. The business end of the class is the BeginDisplayInitializationUI method;<br/> <br/> <pre lang="x-c#">public IAsyncResult BeginDisplayInitializationUI(IClientChannel channel, AsyncCallback callback, object state) { string host = &quot;&quot;; CREDUI_INFO info = new CREDUI_INFO(); string username = string.Empty, password = string.Empty; CREDUI_FLAGS flags = CREDUI_FLAGS.GENERIC_CREDENTIALS | CREDUI_FLAGS.SHOW_SAVE_CHECK_BOX | CREDUI_FLAGS.EXPECT_CONFIRMATION; bool savePwd = false; // PromptForCredentials calls interop credui to challenge the user for username/password/smartcard. CredUIReturnCodes result = PromptForCredentials(ref info, host, 0, ref username,ref password, ref savePwd, flags); ChannelParameterCollection collection = channel.GetProperty&lt;ChannelParameterCollection&gt;(); collection.Add(new NetworkCredential(username, password)); return new AsyncResult(); }</pre> The problem is when I investigate the iis logs, the credentials are never sent. I know that I am missing something crucial. Has anyone had a similar scenario implemented successfully? Is there an easier way to achieve this? <br/> <br/> Thanks for reading!<br/>Wed, 25 Nov 2009 23:20:28 Z2009-11-27T01:59:32Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c32de7ed-fe70-4bec-9311-e9a2d1fd4ed5http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c32de7ed-fe70-4bec-9311-e9a2d1fd4ed5efigueroahttp://social.msdn.microsoft.com/Profile/en-US/?user=efigueroaWhat tools do I need to develop web-based applications? Hi, I'm new on .NET and Frameworks and all of this tools. I would like to know what tools do I need to create an application that people can access using a simple internet connection (as a webpage); it have to be connected to a database in order to record information and need funtionalities as remainders, to-do lists, calendars, events, lifecycle management, contact profiles, users privileges, etc... must to be a kind of mix between outlook, access and excel and accessible through internet. I have read some stuff but it seems to be complicated.... can someone give me some advice please? Thanks...Thu, 26 Nov 2009 14:27:29 Z2009-11-26T18:16:17Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/7e503891-bb21-4b61-b5b1-291564341896http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/7e503891-bb21-4b61-b5b1-291564341896Montagohttp://social.msdn.microsoft.com/Profile/en-US/?user=MontagoHow do i make a virtual "shared folder" (not a windows folder) using code ?Hello <div><br/></div> <div>first off, what i really would like to do, is to share a windows 7/vista/2008 [saved search] - but that's impossible...</div> <div><br/></div> <div><br/></div> <div>I would like to create a shared folder, available on my network eg. \\mycomputer\virtualshare</div> <div><br/></div> <div>the files in that folder should be dynamic (opposed to static files/folders in windows)</div> <div><br/></div> <div>example: </div> <div>1. PC2 accesses the shared folder \\PC1\Share</div> <div>2. a script or some code generates virtual files, which populates the share</div> <div>3. PC2 downloads start to download File1</div> <div>4. PC1 links/streams the filecontent to PC2</div> <div><br/></div> <div><br/></div> <div><br/></div> <div>is this possible ?</div> <div><br/></div> <div><br/></div> <div>Thanks !</div>Thu, 26 Nov 2009 09:43:29 Z2009-11-26T09:43:30Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/ac785f19-40da-4efe-b570-1374d2b2ce36http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/ac785f19-40da-4efe-b570-1374d2b2ce36Palani Namahttp://social.msdn.microsoft.com/Profile/en-US/?user=Palani%20NamaWebProxy.GetDefaultProxy() is now Obsolete, is there any alternative for this in .Net Framework 2.0?WebProxy.GetDefaultProxy() is now Obsolete, is there any alternative for this in .Net Framework 2.0?Fri, 11 Nov 2005 08:12:45 Z2009-11-26T06:40:26Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/0de06966-8312-43d9-b2a4-1610e87b79a9http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/0de06966-8312-43d9-b2a4-1610e87b79a9ShemoPThttp://social.msdn.microsoft.com/Profile/en-US/?user=ShemoPTSend Data Via SocketsI am trying to make simple peer to peer chat. <div><br/></div> <div>But I don't know the sockets at all. I tried several examples found on Google but wasn't able to study much from them. </div> <div><br/></div> <div>I have to Programs Client + Server</div> <div><br/></div> <div>Server <div style="color:Black;background-color:White"> <pre><span style="color:Blue">Dim</span> XListener <span style="color:Blue">As</span> <span style="color:Blue">New</span> Sockets.TcpListener(12345) XListener.Start() <span style="color:Blue">Do</span> <span style="color:Blue">While</span> <span style="color:Blue">True</span> XListener.AcceptSocket() <span style="color:Blue">Loop</span> </pre> </div> Client</div> <div><br/></div> <div> <div style="color:Black;background-color:White"> <pre> <span style="color:Blue">Dim</span> myclient <span style="color:Blue">As</span> <span style="color:Blue">New</span> Sockets.TcpClient <span style="color:Blue">Dim</span> SendData <span style="color:Blue">As</span> Sockets.Socket <span style="color:Blue">Dim</span> sendBytes <span style="color:Blue">As</span> [<span style="color:Blue">Byte</span>]() = System.Text.Encoding.ASCII.GetBytes(<span style="color:#A31515">&quot;TesT&quot;</span>) myclient.Connect(<span style="color:#A31515">&quot;127.0.0.1&quot;</span>, 12345) <span style="color:Blue">If</span> myclient.Connected <span style="color:Blue">Then</span> MsgBox(<span style="color:#A31515">&quot;Connected&quot;</span>) SendData.BeginSend(sendBytes, 0, sendBytes.Length, Sockets.SocketFlags.None, <span style="color:Blue">AddressOf</span> (<span style="color:#A31515">&quot;What should I write here??&quot;</span>), what should I write here??) <span style="color:Blue">Else</span> MsgBox(<span style="color:#A31515">&quot;eror&quot;</span>) <span style="color:Blue">End</span> <span style="color:Blue">If</span> <span style="color:Blue">End</span> <span style="color:Blue">Sub</span> </pre> </div> I am able to connect but not able to send text, because I don't understand the meaning of  - <span style="font-family:monospace;white-space:pre">AddressOf - <span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;white-space:normal">Function.</span></span></div> <div><br/></div> <div>Please write the very simple example how I can send text via sockets and receive .</div> <div><br/></div> <div>Thanks in advance</div> <div>  </div>Tue, 24 Nov 2009 22:35:49 Z2009-11-26T21:00:30Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/7594a098-4631-491c-98b4-39a592e88642http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/7594a098-4631-491c-98b4-39a592e88642Please help with my query.http://social.msdn.microsoft.com/Profile/en-US/?user=Please%20help%20with%20my%20query.Tcp Client / listener application Hi,,<br/>I need to develop an application which will use TCP to transfer data between applications.<br/>The scenario is application A will need to pass data to application B, who in turn will need to pass on to application C.<br/>Application C, will need to reply with valid data to application B, after which application B will do some processing and then pass the result back to application A.<br/><br/>Furthermore application B will need to accept requests from a number of clients and then return the associated data to the calling client.<br/><br/>I have looked at a number of samples, but I can't find a sample to suit my scenario.  I have achieve the communication from application A to b, from b to C, but need to return the data back to application A.<br/><br/><br/>I have very little knowledge of tcp and sockets, so and example as to how to do this would be great.<br/><br/>Any help would be appreciated.Wed, 25 Nov 2009 21:07:50 Z2009-11-26T00:31:08Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c0d8ef52-0485-4a4f-bcb0-2abcc5d2e179http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c0d8ef52-0485-4a4f-bcb0-2abcc5d2e179Pletzkyhttp://social.msdn.microsoft.com/Profile/en-US/?user=PletzkyProxy with no WSDL?I need to call a web service, but it has no WSDL.  All I have is a PHP code snippet, and the SOAP request.  Unfortunately, I don't know WCF well enough to create a proxy from this.  Can someone help?<br/><br/>Here is the PHP code snippet:<br/> <pre>$soapclient = new nusoap_client('serviceURL'); $parameters= array('preferences'=&gt;array('version_id'=&gt;'1','utc_offset'=&gt;'-5'),'options'=&gt;array('include-copyright'=&gt;'both')); $results = $soapclient-&gt;call('methodName',$parameters); </pre> <br/>Here is a sample SOAP request:<br/> <pre lang=x-xml>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt; &lt;SOAP-ENV:Envelope SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&gt; &lt;SOAP-ENV:Body&gt; &lt;ns5857:methodName xmlns:ns5857=&quot;http://tempuri.org&quot;&gt; &lt;preferences&gt; &lt;version_id xsi:type=&quot;xsd:string&quot;&gt;1&lt;/version_id&gt; &lt;utc_offset xsi:type=&quot;xsd:string&quot;&gt;-5&lt;/utc_offset&gt; &lt;/preferences&gt; &lt;options&gt; &lt;include-copyright xsi:type=&quot;xsd:string&quot;&gt;both&lt;/include-copyright&gt; &lt;/options&gt; &lt;/ns5857:methodName&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt;</pre> Any help would be much appreciated!<br/><br/>Thanks!<br/>Brad.Thu, 26 Nov 2009 00:00:32 Z2009-11-26T00:00:34Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/33ee65b7-2208-445f-97ae-2433792b59f5http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/33ee65b7-2208-445f-97ae-2433792b59f5Joesoft11ahttp://social.msdn.microsoft.com/Profile/en-US/?user=Joesoft11aGetting an Ip Address from the clientI setting a small server. When the client connects. How do I get the Ipaddress from the client that connected.<br/><br/>I tried this <p align=left><span style="color:#2b91af;font-size:x-small">IPHostEntry</span><span style="font-size:x-small"> ip = </span><span style="color:#2b91af;font-size:x-small">Dns</span><span style="font-size:x-small">.GetHostEntry (</span><span style="color:#2b91af;font-size:x-small">Dns</span><span style="font-size:x-small">.GetHostName());<font size=2> <p align=left> </p> </font></span></p> <p align=left>and well as you know that doesn't. Any ideas from any one.<br/><br/><br/></p><hr class="sig">Toppers BBS http://toppersbbs.dtdns.net Wed, 25 Nov 2009 20:59:14 Z2009-11-27T07:07:20Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/b5ee4ffb-8cf8-4411-94b8-8f08064869f4http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/b5ee4ffb-8cf8-4411-94b8-8f08064869f4Josef2009http://social.msdn.microsoft.com/Profile/en-US/?user=Josef2009.Net and IMAPIs there any free .Net library to retrieve emails from an email server using IMAP?<br>Wed, 11 Mar 2009 10:08:51 Z2009-11-25T19:14:08Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c51af1e5-8b71-411e-b342-3418fa307c24http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c51af1e5-8b71-411e-b342-3418fa307c24ramgautamhttp://social.msdn.microsoft.com/Profile/en-US/?user=ramgautamhow to detect dtmf in C#.net<hr size=1> <div>Description:<br/><br/>I am working for developing the application which shoud track the key pad of phone set (i.e 1-9 .*,#.) after the call receive .<br/>This program should receive phone call.Our phone line is connected to computer using modem.After it receive the call ,it<br/>Should display that each character pressed by caller into the system(1,2...,9 and #,* also).<br/>i developing this system by using C#.NET<br/>I am waiting your reply about this problem<br/><br/>If you know about this problem,send me message on following mailing address..<br/>My email address is<br/><a href="mailto:ramgau@gmail.com"><span style="color:#0033cc">ramgau@gmail.com</span></a><br/><a href="mailto:laxmangautam@gmail.com"><span style="color:#0033cc">laxmangautam@gmail.com</span></a></div>Wed, 25 Nov 2009 11:25:17 Z2009-11-25T18:10:06Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/144c827c-4e40-457a-95d6-e8db5c244cd1http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/144c827c-4e40-457a-95d6-e8db5c244cd1raghu naraharihttp://social.msdn.microsoft.com/Profile/en-US/?user=raghu%20narahariHow to use the WebBrowser control to open Office documents in web page<p>i want the functionality for my web application like open as google document <br/>Google API functionality for my site</p>Tue, 24 Nov 2009 09:51:42 Z2009-11-25T07:27:08Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/b2dc78f7-5cba-4525-8df2-be936f33cf80http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/b2dc78f7-5cba-4525-8df2-be936f33cf80Todd Ninehttp://social.msdn.microsoft.com/Profile/en-US/?user=Todd%20NinePublishing WCF via http in a windows service results in "System.Runtime.Remoting.RemotingException: Tcp channel protocol violation: expecting preamble"Hi all,<br/>   I'm creating a WCF service that I will ultimately publish via http, and named pipes.  I'm just trying to get the http portion working at the moment.  I receive this error in my browser when I browse to my endpoint at http://localhost:10000/SpidertracksTaskRunner.<br/> <br/> <br/> .NET System.Runtime.Remoting.RemotingException: Tcp channel protocol violation: expecting preamble. at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadAndMatchPreamble() at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadVersionAndOperation(UInt16&amp; operation) at System.Runtime.Remoting.Channels.Tcp.TcpServerSocketHandler.ReadHeaders() at System.Runtime.Remoting.Channels.Tcp.TcpServerTransportSink.ServiceRequest(Object state) at System.Runtime.Remoting.Channels.SocketHandler.ProcessRequestNow()<br/> <br/> <br/> <br/> <br/> I've created numerous services with Java before, but this is my first attempt with .NET 3.5 and WCF.  I have the config below, everything looks to be in order according to the book &quot;Pro C# 2008 and the .NET 3.5 Platform&quot;, but I'm just not getting any data.  Here is my relevant config section.  As you can see, I've created an http endpoint, so why does it seem to be expecting connections via the tcp protocol?  Any help would be greatly appreciated, I get absolutely no logging or console output, so I have no idea what could be causing this problem.<br/> <br/> Thanks,<br/> Todd<br/> <br/> <pre lang=x-xml> &lt;system.serviceModel&gt; &lt;diagnostics wmiProviderEnabled=&quot;true&quot; performanceCounters=&quot;Default&quot;&gt; &lt;messageLogging logMalformedMessages=&quot;true&quot; logMessagesAtServiceLevel=&quot;true&quot; logMessagesAtTransportLevel=&quot;true&quot; /&gt; &lt;/diagnostics&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name=&quot;SchedulerMetaBehavior&quot;&gt; &lt;serviceMetadata httpGetEnabled=&quot;true&quot; /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;bindings /&gt; &lt;services&gt; &lt;service behaviorConfiguration=&quot;SchedulerMetaBehavior&quot; name=&quot;SpidertracksScheduledTaskRunner.Services.WcfSchedulerExporter&quot;&gt; &lt;endpoint address=&quot;&quot; binding=&quot;basicHttpBinding&quot; contract=&quot;SpidertracksScheduledTaskRunner.Services.IWcfScheduler&quot; /&gt; &lt;endpoint address=&quot;mex&quot; binding=&quot;mexHttpBinding&quot; contract=&quot;IMetadataExchange&quot; /&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress=&quot;http://localhost:10000/SpidertracksTaskRunner&quot; /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;/service&gt; &lt;/services&gt; &lt;/system.serviceModel&gt;</pre> <br/>Tue, 24 Nov 2009 19:18:38 Z2009-11-25T01:36:47Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/e04ce683-991e-4696-86a1-ae73c1ff549dhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/e04ce683-991e-4696-86a1-ae73c1ff549dedmorekacherehttp://social.msdn.microsoft.com/Profile/en-US/?user=edmorekachereCombining two systemsHow can link a production inventory system with a purchasins system which in part of SAP.I nid the the users of the SAP purchasing system to be aware of any changes in inventory levels on the production inventory system.i nid to establish a link betweeen these systems<br/>Tue, 24 Nov 2009 10:30:46 Z2009-11-24T18:06:26Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/4587c454-2634-4495-819f-f60e5bb06061http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/4587c454-2634-4495-819f-f60e5bb06061Jitendra Pancholihttp://social.msdn.microsoft.com/Profile/en-US/?user=Jitendra%20PancholiVideo Creator<p>Hi,</p> <p>I want to make an application which can create video using its own intelligence.</p> <p>Explaination:<br/>User will provide number of images,text,audio sound, In short all the multimedia options as well as user will select the size of resulted video along with the type of the resulted video extention(.mov, .avi etc).<br/>Now the aplication will be selecting all the inputed resources and will create video ,which will be of specified size and having extention as per the users requirement.</p> <p>I'm confused that where do i start from and where can i find API which will help me going ahead.</p> <p>I need the API in asp.net-c#.</p> <p>Please help me out ASAP.</p> <p>Thanks in Advance....<br/> </p> Jitendra Pancholi (<a href="mailto:pancholi.jitu@gmail.com">pancholi.jitu@gmail.com</a>) Sat, 21 Nov 2009 19:47:27 Z2009-11-24T17:33:30Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/07cba8db-7adf-46d7-a0cd-06a63a882dcfhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/07cba8db-7adf-46d7-a0cd-06a63a882dcffcbergmannhttp://social.msdn.microsoft.com/Profile/en-US/?user=fcbergmann.Net Framework version problemsHi All, <div><br/></div> <div>I did an application to manage many connection.</div> <div>On my machine, I have the Visual Studio 9 and I'm developping using .Net Framework 3.5. However, in the datacenter where the application is running, it has Visual Studio 8, .Net Framework 2.0 and .Net Framework 3.5.</div> <div>I compliled the application on my machine and I'm starting the application directly by .exe in the datacenter.</div> <div>The problem is that the application is using .Net Framework 2.0 in the datacenter, even I had compiled with .Net 3.5.</div> <div>I tried to remove .Net 2.0, but the Windows informed me that is not possible.</div> <div><br/></div> <div>How can I run the application using .Net 3.5 without install Visual Studio 9?</div> <div><br/></div> <div>Thanks!</div>Tue, 24 Nov 2009 11:16:21 Z2009-11-24T16:16:50Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/52b64bba-86d2-4c9e-99d4-c26e76571cc7http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/52b64bba-86d2-4c9e-99d4-c26e76571cc7Marcio Monegohttp://social.msdn.microsoft.com/Profile/en-US/?user=Marcio%20MonegoCan a Windows Service be notified about the result os WCF Service it hosts?<br/> I was thinking about to host a WCF Service in a Windows Service that would do a hard work with 5 threads and listen on WCF for interruption requests or progress of execution requested by other WCF Services on same Service Arquiteture hosted on other apps like a Web app.<br/> <br/> A need that web app can request the queue of execution. The progress done.<br/> <br/> The logic of execution needs stay on the WCF service assembly and not in a method of Windows Service in this case?<br/> Could you put in the right direction on this?<br/> <br/> Márcio. <hr class=sig><hr class="sig">VS2008/2008/VS6(C#, ASP/ASP .NET[SQL Server/MySql]) Experienced developer.Tue, 24 Nov 2009 15:31:13 Z2009-11-24T15:31:16Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/7bf9f1f5-3cd9-43a4-9613-701314c5c657http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/7bf9f1f5-3cd9-43a4-9613-701314c5c657Gurmit Teotiahttp://social.msdn.microsoft.com/Profile/en-US/?user=Gurmit%20TeotiaPPP question<p>Hello All,</p> <p>I’m not sure if this is right forum for my question, if it is not kindly point me to correct one.</p> <p>I have a software application that needs to communicate with some devices, installed on remote locations. Network on these locations is accessible through PSTN line only.</p> <p>I have a requirement in my software that it should automatically establish the dialup connection with targeted location, if user wishes to communicate with one of the device on targeted location. Again if user wishes to communicate with another device, installed on different location then my software should disconnect the existing dialup connection and should establish the dialup connection with new location, where new device is installed (my software will have location information about devices like- phone number , user name, password etc.).</p> <p>I have some ideas about “ATs” commands but I’m sure these are not enough for successful communication with device on remote location.</p> <p>I was not able to find useful information using google. I’d appreciate if someone can provide the pointer, I should start from.</p> <p>Thank you for your help.</p> <p>Regards,<br/>Gurmit</p>Tue, 24 Nov 2009 14:07:19 Z2009-11-24T14:07:19Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/39049797-f3c8-44ae-b044-1180afd2ea04http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/39049797-f3c8-44ae-b044-1180afd2ea04sahil goyalhttp://social.msdn.microsoft.com/Profile/en-US/?user=sahil%20goyalport.handshake=Handshake.requestTOSend<strong>hiii awl<br/> <br/>                  i m working in c# and developing an application related with serialport transmission.i want to send and recive data from my serial port.simple transmission goes ok.but when i apply &quot;port.handshake=Handshake.requestTOSend&quot; and click to send button(to send data from serial port)then my application goes hang.why is it,and how can i solve it.plz help.<br/>                                                                                           thanx in advance.</strong> <br/> <br/> <br/> my code is:<br/> using System;<br/> using System.Collections.Generic;<br/> using System.ComponentModel;<br/> using System.Data;<br/> using System.Drawing;<br/> using System.Text;<br/> using System.IO.Ports;<br/> using System.Windows.Forms;<br/> using System.Threading;<br/> <br/> namespace portsend<br/> {<br/>     public partial class Form1 : Form<br/>     {<br/>         SerialPort port = new SerialPort(&quot;COM1&quot;, 1200, Parity.None, 8, StopBits.One);<br/> <br/>         public Form1()<br/>         {<br/>             InitializeComponent();<br/>             <br/>       <br/>           <br/>             //port.DsrHolding = true;<br/>             //port.CtsHolding = true;<br/>            // port.CDHolding = true;<br/>         }<br/>         <br/>         private void button1_Click(object sender, EventArgs e)<br/>         {<br/>            <br/>             string s = &quot;&quot;;<br/>             //char[] arr = new char[] { '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n'};<br/>             char[] arr = new char[] { '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n' };<br/>             port.Handshake.Equals(true);<br/>             port.Handshake = Handshake.RequestToSend;<br/>             port.DtrEnable = true;<br/>             port.RtsEnable = true;<br/>             //port.ReadTimeout = 60000;<br/>            // port.WriteTimeout = 5000;<br/>             if (port.IsOpen == false)<br/>             {<br/>                 port.Open();<br/>             }<br/>             <br/>             try<br/>             {<br/> <br/>                 //port.RtsEnable = true;<br/>                 port.DtrEnable = true;<br/>                for (int i = 0; i &lt; arr.Length; i++)<br/>                 {                  <br/>                     //if (port.DtrEnable.Equals(true)&amp;&amp;port.RtsEnable.Equals(true))<br/>                          //if (port.CtsHolding==false)<br/>                   // {<br/>                    <br/>                         s = arr[i].ToString();<br/>                        <br/>                         <br/>                         port.Write(s);<br/>                         <br/>                      Thread.Sleep(300);<br/>                    <br/>                         //port.WriteTimeout = 3000;<br/>                    // }<br/>                    // else<br/>                    // {<br/> <br/>                    //     MessageBox.Show(&quot;terminal not ready&quot;);<br/>                    //}<br/>                 }<br/>                 MessageBox.Show(&quot;sss&quot;);<br/>             }<br/>             catch (Exception ex)<br/>             {<br/>                 MessageBox.Show(ex.Message);<br/>             }<br/>            <br/> <br/>         }<br/>     }<br/> }<br/> <br/>Tue, 24 Nov 2009 12:47:08 Z2009-11-24T12:47:12Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/845ff649-5c95-40a5-a813-1da8761102abhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/845ff649-5c95-40a5-a813-1da8761102abphani kumar ---help me outhttp://social.msdn.microsoft.com/Profile/en-US/?user=phani%20kumar%20---help%20me%20outSending Digitally Signed emails using C# Hi All,<br><br>    I have a requirement of sending a digitally signed email using C#,ASP.net. I tried it several ways and atlast using ASPEmail and ASPEncrypt i was able to access certificate but iam getting the mail address as the name of the certificate holder. Iam unable to find how to read the email address from the certificate. Any support will be appreciated. Thanks in advance.<hr size="1" align="left" width="25%">phani kumar ---help me outTue, 09 Sep 2008 11:51:42 Z2009-11-24T11:37:37Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/a9b82a14-739b-4f10-9f92-2e8c6dfe9a67http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/a9b82a14-739b-4f10-9f92-2e8c6dfe9a67sahil goyalhttp://social.msdn.microsoft.com/Profile/en-US/?user=sahil%20goyalrts,dts,dsr for serialport<strong>i m working on  a c# application,can any one tell me about the usage of dtrEnable,dsrHolding,rtsEnable,ctsHolding.and what is the purpose of &quot;port.Handshake = Handshake.RequestToSend;&quot; statement,actully i already tried these things in my application but i cudn't get my result yet.can any one give me some code or clue for these statements.<br/> <br/> i m using this code:<br/> <br/> <br/> using System;<br/> using System.Collections.Generic;<br/> using System.ComponentModel;<br/> using System.Data;<br/> using System.Drawing;<br/> using System.Text;<br/> using System.IO.Ports;<br/> using System.Windows.Forms;<br/> <br/> namespace portsend<br/> {<br/>     public partial class Form1 : Form<br/>     {<br/>         SerialPort port = new SerialPort(&quot;COM1&quot;, 1200, Parity.None, 8, StopBits.One);<br/> <br/>         public Form1()<br/>         {<br/>             InitializeComponent();<br/>             port.Open();<br/>         }<br/>         <br/>         private void button1_Click(object sender, EventArgs e)<br/>         {<br/>            <br/>             string s = &quot;&quot;;<br/>             //char[] arr = new char[] { '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n', '+', '0', '0', '0', '1', '0', '5', '\r', '\n'};<br/>             char[] arr = new char[] { '+', '0', '0', '0', '1', '0', '5', '\r', '\n'};<br/> <br/> <br/>            <br/>            // {<br/>                // MessageBox.Show(&quot;handshake mode is open&quot;);<br/>            // }<br/>            // else<br/>                // MessageBox.Show(&quot;port is not handshake&quot;);<br/> <br/>                 //if (port.RtsEnable == true)<br/>                 //{<br/>                 //    MessageBox.Show(&quot;handshake mode is open&quot;);<br/>                 //}<br/>                 //else<br/>                 //MessageBox.Show(&quot;port is not handshake&quot;);<br/>             //port.RtsEnable.Equals(true);<br/>             try<br/>             {<br/>                //port.Handshake = Handshake.RequestToSend;<br/>                <br/>                 //port.WriteTimeout = 40000;<br/> <br/>                 for (int i = 0; i &lt; arr.Length; i++)<br/>                 {<br/>                     port.CtsHolding=true;<br/>                    <br/>                     //port.DtrEnable.Equals(true);<br/>                     //if (port.DtrEnable.Equals(false)&amp;&amp;port.DsrHolding.Equals(false))<br/>                     {<br/>                         s = arr[i].ToString();<br/> <br/>                         port.Write(s);<br/>                     }<br/>                     //else<br/>                     //{<br/>                        <br/>                     //    MessageBox.Show(&quot;terminal not ready&quot;);<br/>                     //}<br/>                 }<br/>             }<br/>             catch (Exception ex)<br/>             {<br/>                 MessageBox.Show(ex.Message);<br/>             }<br/>             //textBox1.Text = arr.Length.ToString();<br/> <br/>             //port.Write(&quot;abcdefghijklmnop&quot;);<br/> <br/>             //port.Write(s.ToString());<br/> <br/>            // textBox1.Text = s.Length.ToString();<br/> <br/> <br/>         }<br/>     }<br/> }<br/> </strong>Tue, 24 Nov 2009 09:32:24 Z2009-11-24T09:32:24Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/5ef0ed60-7558-47a4-99bf-ba4965fb5f40http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/5ef0ed60-7558-47a4-99bf-ba4965fb5f40Charlie363http://social.msdn.microsoft.com/Profile/en-US/?user=Charlie363Get Lat Lon boundaries of a google map picture<p>I am acquiring a google earth image in vb.Net using the following:</p> <p>      imgImage.Load(&quot;<a href="http://maps.google.com/staticmap?center">http://maps.google.com/staticmap?center</a>=&quot; _<br/>                      + dblLat.ToString + &quot;,&quot; + dblLong.ToString + _<br/>                      &quot;&amp;zoom=&quot; + intZoom.ToString + _<br/>                      &quot;&amp;size=512x512&amp;maptype=satellite&quot;)</p> <p>where imgImage is a PictureBox .net object.<br/>I need to know what the width and height of the image returned is in NauticalMiles. My understanding is that:<br/>- ZoomFactor=1 means 360deg, which means 360*60NM<br/>- ZoomFactor=2 means 180deg, which means 180*60NM<br/>- etc.....<br/>- ZoomFactor=5 should be equivalent to 1350NM</p> <p>When I actually check this distance on GoogleEarth I get something closer to 1100NM from North to South and from East to West.<br/>How can I get a better accuracy on the boundaries of my image?<br/>By the way, I will be essentially working on large zooms (around 100NM resolution), so it's ok for me to ignore earth curvature.<br/>Thanks for your help,<br/>C</p>Tue, 24 Nov 2009 09:27:32 Z2009-11-24T09:27:33Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/4d3d5b94-3dc4-4f25-8c7b-824236508fabhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/4d3d5b94-3dc4-4f25-8c7b-824236508fabPalash Aichhttp://social.msdn.microsoft.com/Profile/en-US/?user=Palash%20AichInvalid Parameter: Name handle ExceptionI am using VB.Net code to print barcode label in Zebra TLP 2844 printer. And the printer is connected to system by USB port. When i execute the code i get an error &quot;Invalid Parameter : Name handle&quot; in the line <span style="font-size:12pt;color:black;line-height:115%;font-family:'Times New Roman','serif'">outFile = </span><span style="font-size:12pt;color:#0600ff;line-height:115%;font-family:'Times New Roman','serif'">New</span><span style="font-size:12pt;color:black;line-height:115%;font-family:'Times New Roman','serif'"> FileStream(_SafeFileHandle, FileAccess.Write) . Can you please help me to rectify this.<br/><span style="font-size:x-small;font-family:Verdana">As this is a USB port So i shared the printer and used the UNC path. But still i get the error. Below is the complete code<br/><br/> <p class=MsoNormalCxSpFirst><strong><span style="font-size:small"><span style="font-family:Times New Roman">Name Spaces<br/></span></span></strong><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">Imports System.IO <br/></span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">Imports System.Runtime.InteropServices </span></p> <p class=MsoNormalCxSpMiddle><span style="font-size:small;font-family:Times New Roman"> </span><strong><span style="font-size:small"><span style="font-family:Times New Roman">Here is the button click code</span></span></strong></p> <p class=MsoNormalCxSpMiddle style="line-height:normal"><span style="font-size:small;font-family:Times New Roman"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Dim</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> _print </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">as</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">new</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> ZebraPrint <br/></span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">_print.StartWrite(</span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot;//ComputerName/PrinterSharedName&quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">) <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">dim</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> _Text </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">as</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">String</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> = </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot;Print test&quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> <br/></span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">_print.Write(</span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot;A30,120,0,4,2,1,N,&quot;&quot;&quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> &amp; _Text &amp; </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot;&quot;&quot;&quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">) <br/></span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">_print.EndWrite()</span></p> <p class=MsoNormalCxSpMiddle style="line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span></p> <div style="border-right:medium none;padding-right:0in;border-top:windowtext 1pt solid;padding-left:0in;padding-bottom:1pt;border-left:medium none;padding-top:1pt;border-bottom:windowtext 1pt solid;mso-element:para-border-div"> <p class=MsoNormalCxSpMiddle style="border-right:medium none;padding-right:0in;border-top:medium none;padding-left:0in;padding-bottom:0in;border-left:medium none;line-height:normal;padding-top:0in;border-bottom:medium none"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">Class</span></p> </div> <p class=MsoNormalCxSpMiddle style="line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Public</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Class</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> ZebraPrint <br/></span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#Region </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot; Private constants &quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Private</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Const GENERIC_WRITE </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> = &amp;H40000000 <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Private</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Const OPEN_EXISTING </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> = </span><span style="font-size:12pt;color:red;font-family:'Times New Roman','serif'">3</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> <br/></span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#End Region </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#Region </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot; Private members &quot;<br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Private</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> _SafeFileHandle </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Microsoft.Win32.SafeHandles.SafeFileHandle<br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Private</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> _fileWriter </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> StreamWriter <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Private</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> _outFile </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> FileStream </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#End Region </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#Region </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot; private structures &quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> <br/></span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">&lt;StructLayout(LayoutKind.Sequential)&gt; _ <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Public</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Structure SECURITY_ATTRIBUTES <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Private</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> nLength </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Private</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> lpSecurityDescriptor </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Private</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> bInheritHandle </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer<br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">End</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Structure </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#End Region </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#Region </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot; com calls &quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Private</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Declare </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Function</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> CreateFile Lib </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot;kernel32&quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Alias </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot;CreateFileA&quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> (</span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">ByVal</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> lpFileName </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">String</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">ByVal</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> dwDesiredAccess </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">ByVal</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> dwShareMode </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, &lt;MarshalAs(UnmanagedType.Struct)&gt; </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">ByRef</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> lpSecurityAttributes </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> SECURITY_ATTRIBUTES, </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">ByVal</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> dwCreationDisposition </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">ByVal</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> dwFlagsAndAttributes </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">ByVal</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> hTemplateFile </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Integer</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">) </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Microsoft.Win32.SafeHandles.SafeFileHandle </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#End Region <br/></span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#Region </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot; Public methods &quot;<br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Public</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Sub</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> StartWrite(</span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">ByVal</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> printerPath </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">String</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">) <br/></span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Dim</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> SA </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> SECURITY_ATTRIBUTES </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">_SafeFileHandle = CreateFile(printerPath, GENERIC_WRITE, </span><span style="font-size:12pt;color:red;font-family:'Times New Roman','serif'">0</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, SA, OPEN_EXISTING, </span><span style="font-size:12pt;color:red;font-family:'Times New Roman','serif'">0</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, </span><span style="font-size:12pt;color:red;font-family:'Times New Roman','serif'">0</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">) </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">Try </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">                _outFile = </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">New</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> FileStream(_SafeFileHandle, FileAccess.Write) </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">                _fileWriter = </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">New</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> StreamWriter(_outFile) </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">            Catch ex </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Exception </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">                System.Windows.Forms.MessageBox.Show(</span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot;Can not find printer.&quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">&quot;Warning&quot;</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, Windows.Forms.MessageBoxButtons.OK, Windows.Forms.MessageBoxIcon.</span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Error</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">, Windows.Forms.MessageBoxDefaultButton.Button1) </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">            </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">End</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Try </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">        </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">End</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Sub</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">        </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Public</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Sub</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> Write(</span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">ByVal</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> rawLine </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">As</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">String</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">) </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">            If _fileWriter IsNot </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Nothing</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Then</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">                _fileWriter.WriteLine(rawLine) </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">            </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">End</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> If </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">        </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">End</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Sub</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">        </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Public</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Sub</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> EndWrite() </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">            </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">            If _fileWriter IsNot </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Nothing</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Then</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">                _fileWriter.Flush() </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">                _fileWriter.Close() </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">                _outFile.Close() </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">            </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">End</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> If </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">            _SafeFileHandle.Close() </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">            _SafeFileHandle.Dispose() </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">        </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">End</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;font-family:'Times New Roman','serif'">Sub</span><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'"> </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">#End Region </span></p> <p class=MsoNormalCxSpMiddle style="margin:auto auto auto 0.25in;line-height:normal"><span style="font-size:12pt;color:black;font-family:'Times New Roman','serif'">  </span></p> <span style="font-size:12pt;color:black;line-height:115%;font-family:'Times New Roman','serif'">    </span><span style="font-size:12pt;color:#0600ff;line-height:115%;font-family:'Times New Roman','serif'">End</span><span style="font-size:12pt;color:black;line-height:115%;font-family:'Times New Roman','serif'"> </span><span style="font-size:12pt;color:#0600ff;line-height:115%;font-family:'Times New Roman','serif'">Class</span><span style="font-size:12pt;color:black;line-height:115%;font-family:'Times New Roman','serif'"> </span></span></span>Mon, 23 Nov 2009 13:18:51 Z2009-11-24T09:16:11Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/ee6c8986-f321-4d19-b747-a4458a0f8708http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/ee6c8986-f321-4d19-b747-a4458a0f8708sahil goyalhttp://social.msdn.microsoft.com/Profile/en-US/?user=sahil%20goyalretrive data from particular web site<strong>hiii awl<br/> <br/>            i m using c# with .net framework.i want to create an application which can fetch the updateable data from particular web site and send it to serial port at button click event. example:i want to fetch updateable scores from www.cricinfo.com threw my c# application. how is it possible plz give me some clue or some code for it.<br/> <br/>                                                                                                          thanks in advance.<br/>  </strong> <br/>Tue, 24 Nov 2009 05:54:05 Z2009-11-24T05:54:05Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/68b76165-a4d6-4f22-82d2-ccca60da6d26http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/68b76165-a4d6-4f22-82d2-ccca60da6d26Corbyhttp://social.msdn.microsoft.com/Profile/en-US/?user=CorbyActive Directory ChangePassword COM Exception error<p align=left><font face=Arial size=2>Doing an intranet web page for my company that allows to change their password.  I got it to work yesterday for about 3 minutes but then it stopped.  Here's the error:</font></p> <p align=left> </p> <p align=left>System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.Runtime.InteropServices.COMException (0x80070547): Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied. (Exception from HRESULT: 0x80070547)</p> <p><span id=lblErrors style="z-index:108;left:118px;width:416px;position:absolute;top:269px"></span></p> <p align=left> </p> <p align=left>Here's my code.</p> <p align=left> </p><font size=2> <p></font><font color="#0000ff" size=2>string</font><font size=2> currentUserName = (((</font><font color="#0000ff" size=2>string</font><font size=2>)Context.User.Identity.Name).Split(</font><font color="#a31515" size=2>'\\'</font><font size=2>))[1];</p> <p></font><font color="#0000ff" size=2>string</font><font size=2> OldPassword = </font><font color="#0000ff" size=2>this</font><font size=2>.txtOldPassword.Text; </p> <p></font><font color="#0000ff" size=2>string</font><font size=2> NewPassword = </font><font color="#0000ff" size=2>this</font><font size=2>.txtNewPassword.Text;</p> <p>ChangePassword(currentUserName, </font><font color="#a31515" size=2>&quot;MyCompanyDomain&quot;</font><font size=2>, OldPassword, NewPassword);</font></p> <p align=left><font size=2></font> </p> <p align=left><font size=2></font> </p><font size=2><font color="#0000ff" size=2> <p>public</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> ChangePassword(</font><font color="#0000ff" size=2>string</font><font size=2> strLogin, </font><font color="#0000ff" size=2>string</font><font size=2> strRootPath, </font><font color="#0000ff" size=2>string</font><font size=2> strOldPasswd, </font><font color="#0000ff" size=2>string</font><font size=2> strNewPasswd)</p> <p>{</p></font><font size=2> <p></font><font color="#0000ff" size=2>try</p></font><font size=2> <p>{</p> <p>strRootPath = </font><font color="#2b91af" size=2>String</font><font size=2>.Format(</font><font color="#a31515" size=2>@&quot;LDAP://{0}&quot;</font><font size=2>, strRootPath);</font><font color="#008000" size=2></p></font><font size=2> <p></font><font color="#2b91af" size=2>DirectoryEntry</font><font size=2> objRootEntry = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#2b91af" size=2>DirectoryEntry</font><font size=2>(strRootPath, strLogin, strOldPasswd, </font><font color="#2b91af" size=2>AuthenticationTypes</font><font size=2>.Secure);</p> <p></font><font color="#2b91af" size=2>DirectorySearcher</font><font size=2> objADSearcher = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#2b91af" size=2>DirectorySearcher</font><font size=2>(objRootEntry);</p> <p>objADSearcher.Filter = </font><font color="#2b91af" size=2>String</font><font size=2>.Format(</font><font color="#a31515" size=2>@&quot;(&amp;(objectClass=user)(anr={0}))&quot;</font><font size=2>, strLogin);</p> <p></font><font color="#2b91af" size=2>SearchResult</font><font size=2> objResult = objADSearcher.FindOne();</p> <p></font><font color="#2b91af" size=2>DirectoryEntry</font><font size=2> objLoginEntry = (objResult != </font><font color="#0000ff" size=2>null</font><font size=2>) ? objResult.GetDirectoryEntry() : </font><font color="#0000ff" size=2>null</font><font size=2>;</p> <p></font><font color="#0000ff" size=2>if</font><font size=2> (objLoginEntry != </font><font color="#0000ff" size=2>null</font><font size=2>)</p> <p>{</p> <p></font><font color="#0000ff" size=2>object</font><font size=2> obj = objLoginEntry.InvokeSet(</font><font color="#a31515" size=2>&quot;ChangePassword&quot;</font><font size=2>, </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#0000ff" size=2>object</font><font size=2>[] { strOldPasswd, strNewPasswd });</p> <p>objLoginEntry.CommitChanges();</p> <p>obj = </font><font color="#0000ff" size=2>null</font><font size=2>;</p> <p>}</p> <p>objRootEntry = </font><font color="#0000ff" size=2>null</font><font size=2>;</p> <p>objADSearcher = </font><font color="#0000ff" size=2>null</font><font size=2>;</p> <p>objResult = </font><font color="#0000ff" size=2>null</font><font size=2>;</p> <p>objLoginEntry = </font><font color="#0000ff" size=2>null</font><font size=2>;</p> <p>}</p> <p></font><font color="#0000ff" size=2>catch</font><font size=2> (System.</font><font color="#2b91af" size=2>Exception</font><font size=2> abc)</p> <p>{</p> <p></font><font color="#0000ff" size=2>this</font><font size=2>.lblErrors.Text = abc.ToString();</p> <p>}</p></font> <p align=left>}</p> <p align=left>Anyone have any help on the error message?  I've been Googling answers for about 3 hours, but nothing seems to point me in the right direction...</p> <p align=left> </p> <p align=left>Thanks!</p> <p align=left> </p> <p align=left>-Corby-</font></p>Tue, 11 Dec 2007 14:43:28 Z2009-11-24T17:02:57Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/ccb054c3-a72d-4d5d-a8ab-fc03c141e2d6http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/ccb054c3-a72d-4d5d-a8ab-fc03c141e2d6NadiaDChttp://social.msdn.microsoft.com/Profile/en-US/?user=NadiaDCasp.net<span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small"><font size=2 color="#a31515"><font size=2 color="#a31515"> <p>how to modify .aspx page by using content page</p> </font></font></span><font size=2 color="#a31515"> <p> </p> </font></span> <p><span style="color:#a31515;font-size:x-small"></span></p>Sun, 22 Nov 2009 17:20:08 Z2009-11-22T18:33:48Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/b478ed90-acb2-4255-9f14-b1b4e67369aahttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/b478ed90-acb2-4255-9f14-b1b4e67369aaEng.Technohttp://social.msdn.microsoft.com/Profile/en-US/?user=Eng.TechnoProgress Barplease help me if the progress bar reached the maximum value how ican get it empty again and start progress after thatSat, 21 Nov 2009 11:54:57 Z2009-11-22T16:32:40Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/78223fb0-20c8-4443-9cbd-8d52b1d731bdhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/78223fb0-20c8-4443-9cbd-8d52b1d731bdmertkan65http://social.msdn.microsoft.com/Profile/en-US/?user=mertkan65NetworkStream.Length PropertyHi All,<br><br>I want to use this property but in MSDN it says &quot;This property is not currently supported and always throws a NotSupportedException.&quot;. When will it be supported? Can you suggest any other method or property?<br>Thu, 23 Nov 2006 08:20:56 Z2009-11-25T08:27:10Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/55e43ee4-a791-4b86-8a86-81138fb06573http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/55e43ee4-a791-4b86-8a86-81138fb06573Edeltraudhttp://social.msdn.microsoft.com/Profile/en-US/?user=EdeltraudVisual Studio 2008 Express Diagram, Modify <CustomLabel> at runtimeHow to modify CustomLabel at runtime. I could not find any example at the web, documentation or forums. <br/> The example of the behind code see below. How to translate HTML code in c# code?<br/> <br/> using System;<br/> using System.Collections.Generic;<br/> using System.Web;<br/> using System.Web.UI;<br/> using System.Web.UI.WebControls;<br/> using System.Web.UI.DataVisualization.Charting;<br/> <br/> public partial class _Default : System.Web.UI.Page<br/> {<br/>     <br/>     protected void Page_Load(object sender, EventArgs e)<br/>     {<br/>         FillData(0);<br/> <br/>         Chart1.Series[&quot;London&quot;].ChartType = SeriesChartType.Column; // Column für Säule <br/>         Chart1.Series[&quot;Berlin&quot;].ChartType = SeriesChartType.Column; // or Line für Linie<br/>     }<br/> <br/>     private void FillData(int month)<br/>     {<br/>         double plotY = month + 5.0;   <br/>         double plotY2 = month + 10.0; <br/>         if (Chart1.Series[&quot;London&quot;].Points.Count &gt; 0)<br/>         {<br/>         //    plotY = Chart1.Series[&quot;Series1&quot;].Points[Chart1.Series[&quot;Series1&quot;].Points.Count - 1].YValues[0];<br/>         //    plotY2 = Chart1.Series[&quot;Series2&quot;].Points[Chart1.Series[&quot;Series1&quot;].Points.Count - 1].YValues[0];<br/>             plotY = 5.0; <br/>             plotY2 = 7.0;<br/>         }<br/>     <br/>         for (int pointIndex = 0; pointIndex &lt; month; pointIndex++)<br/>         {<br/>             plotY = plotY + 1.0;<br/>             Chart1.Series[&quot;London&quot;].Points.AddY(plotY);<br/>            <br/>             plotY2 = plotY2 + 2.0;<br/>             Chart1.Series[&quot;Berlin&quot;].Points.AddY(plotY2);<br/>         }<br/>     }<br/>     protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)<br/>     {<br/>         int ausgw = System.Int32.Parse(DropDownList2.SelectedItem.Value);<br/>         FillData(ausgw);<br/>     }<br/> <br/>     <br/>     protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)<br/>     {<br/>         int startmonth = System.Int32.Parse(DropDownList1.SelectedItem.Value);<br/>         // startmonth is index to selected month, eg. 1 -&gt; Jan, 2 = Feb.<br/>         // Is e.g. Feb selected, CustomLabel should start with Feb and enumerate to April<br/>         // if three month should be displayed (selected with DropDownList2)<br/>          <br/>         // C# Code for label assignment at runtime <br/> <br/>         .... ???<br/> <br/> <br/>         // this HTML part is copied from .aspx<br/>         //&lt;axisx linecolor=&quot;64, 64, 64, 64&quot; Title=&quot;Reported month&quot; &gt;<br/>         //                  &lt;labelstyle font=&quot;Trebuchet MS, 8.25pt, style=Bold&quot; /&gt;<br/>         //                  &lt;majorgrid linecolor=&quot;64, 64, 64, 64&quot; /&gt;<br/>         //              &lt;CustomLabels&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;0.5&quot; Text=&quot;Jan&quot; ToPosition=&quot;1.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;1.5&quot; Text=&quot;Feb&quot; ToPosition=&quot;2.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;2.5&quot; Text=&quot;Mar&quot; ToPosition=&quot;3.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;3.5&quot; Text=&quot;Apr&quot; ToPosition=&quot;4.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;4.5&quot; Text=&quot;May&quot; ToPosition=&quot;5.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;5.5&quot; Text=&quot;Jun&quot; ToPosition=&quot;6.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;6.5&quot; Text=&quot;Jul&quot; ToPosition=&quot;7.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;7.5&quot; Text=&quot;Aug&quot; ToPosition=&quot;8.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;8.5&quot; Text=&quot;Sep&quot; ToPosition=&quot;9.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;9.5&quot; Text=&quot;Oct&quot; ToPosition=&quot;10.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;10.5&quot; Text=&quot;Nov&quot; ToPosition=&quot;11.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;      <br/>         //                 &lt;asp:CustomLabel FromPosition=&quot;11.5&quot; Text=&quot;Dec&quot; ToPosition=&quot;12.5&quot; ForeColor=&quot;#FF0066&quot; /&gt;<br/>         //               &lt;/CustomLabels&gt;<br/>         //               &lt;MajorTickMark Interval=&quot;1&quot; IntervalOffset=&quot;Auto&quot; IntervalOffsetType=&quot;Auto&quot; IntervalType=&quot;Auto&quot; /&gt;<br/>         //&lt;/axisx&gt;<br/>     }<br/> }Sat, 21 Nov 2009 14:16:40 Z2009-11-21T14:16:40Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/4a7e84e6-a68b-41f1-b35d-b05c4fd911dfhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/4a7e84e6-a68b-41f1-b35d-b05c4fd911dfnevviinhttp://social.msdn.microsoft.com/Profile/en-US/?user=nevviinReceived an unexpected EOF or 0 bytes from the transport stream. from mailserverhi,<br/> <br/> I am reading the mails from mailserver using the POP and IMAP commands. While the reader is reading the response from the server , at certain point of time the it's not getting anything from the response . The applications is getting hanged .Please help me to solve this problem . i am postin this for the third time <br/> <br/>  Function GetMessage(ByVal sCommand As String, ByVal sslstream As SslStream, ByVal reader As StreamReader) As String<br/>         Dim tmpString As String = &quot;&quot;<br/>         Dim msg As String = &quot;&quot;<br/>         Try<br/> <br/>             sendcmd(sCommand, sslstream)<br/>             tmpString = reader.ReadLine()<br/>             If tmpString &lt;&gt; &quot;&quot; Then<br/>                 msg = msg &amp; tmpString &amp; vbCrLf<br/>             End If<br/>             While Not tmpString.StartsWith(sPrefix)<br/>                  tmpString = reader.ReadLine<br/>                 msg = msg &amp; tmpString &amp; vbCrLf<br/>             End While<br/>             If InStr(msg, &quot;BAD Could not parse command&quot;) &gt; 0 Then<br/>                 'appendFile(strErrPath, &quot;BAD command : command : &quot; &amp; sCommand &amp; Space(3) &amp; Date.Now)<br/>                 appendFile(strErrPath, &quot;Error in GetMessage, BAD command : command : &quot; &amp; sCommand &amp; Space(3) * &quot;User: &quot; &amp; UserName &amp; Date.Now)<br/>                 'MsgBox(&quot;BAD GETMESSAGE&quot;)<br/>             End If<br/>         Catch ex As Exception<br/>             appendFile(strErrPath, &quot;Error in GetMessage, BAD command : command : &quot; &amp; sCommand &amp; Space(3) * &quot;User: &quot; &amp; UserName &amp; ex.Message &amp; Date.Now)<br/>         End Try<br/> <br/>         Return msg<br/>     End Function<br/> <br/> <br/> thanks &amp; regards<br/><hr class="sig">Thanks &amp; Regards http://www.keralapavilion.com/Sat, 21 Nov 2009 12:54:21 Z2009-11-21T12:54:21Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/ece6bba8-94b0-4000-80e3-75bc82c9f8b1http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/ece6bba8-94b0-4000-80e3-75bc82c9f8b1Irshad_iphttp://social.msdn.microsoft.com/Profile/en-US/?user=Irshad_ipHow to send the SMS using vb.net<p>Hello Friends</p> <p>        i developing windows desktop application in vb.net  for sending SMS through internet, but i have no idea about that. so plz help me for writing this code.</p> <p> </p> <p>Irshad </p> <p> </p>Mon, 27 Nov 2006 12:42:23 Z2009-11-21T11:23:57Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c5085eb1-21bc-4fe1-a9db-42f7eb7ebbc7http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/c5085eb1-21bc-4fe1-a9db-42f7eb7ebbc7hi dbhttp://social.msdn.microsoft.com/Profile/en-US/?user=hi%20dbRestaring iis server<p>hi all<br/>after creating a merge replication on the sql server 2005 and sqlce in the vstudio8 a get an error on my Emulator (pc pocket 2003) <br/><strong>an error has ocurred on the computer runnig iis, try restarting the iis server</strong></p> <p>so what can i do, and what happened to get that message because the application was runnig befoure...</p> <p>thank you all</p>Sat, 21 Nov 2009 10:01:59 Z2009-11-21T10:01:59Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/49862d0b-297a-4beb-8a22-76257a0c4642http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/49862d0b-297a-4beb-8a22-76257a0c4642MrRogerhttp://social.msdn.microsoft.com/Profile/en-US/?user=MrRogerOUI Extended ethertype packet on RAW socketsWhenever I try and find out about using RAW sockets all I find is information relating to Sec issues, building and sending IP packets, and the restrictions that Windows places on these.<br/> <br/> I need to send and recieve OUI extended ethertype packets for working with networked devices. Is it possible to do this from a user space application using the .Net framework?<br/> <br/> Does windows try to block the use of such protocols?<br/> <br/>Sat, 21 Nov 2009 01:33:52 Z2009-11-21T01:33:53Zhttp://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/0a121b15-78c4-4b4e-aaa9-dfe424a99a92http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/0a121b15-78c4-4b4e-aaa9-dfe424a99a92Accord CM2http://social.msdn.microsoft.com/Profile/en-US/?user=Accord%20CM2Deploy WCF to IIS 7.5 (Win 2008 R2) Hi All,<br><br>Just installed the Win Server 2008 R2. I can't deploy the WCF project to IIS7.5 througth VS2008 (http publish). Does anyone know how to configure IIS 7.5 to support it?<br><br>Eric Wong<br><hr class="sig">CM2Tue, 13 Jan 2009 16:58:07 Z2009-11-21T00:43:37Z