<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Πρώτα Βήματα - Γλώσσες προγραμματισμού</title><link>https://www.dotnetzone.gr:443/cs/forums/74/ShowForum.aspx</link><description>Τα πρώτα βήματα στις γλώσσες VB6, VB.NET, και C#</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ: Πρόβλημα με HttpWebResponse. C#.NET</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/40479.aspx</link><pubDate>Tue, 26 Feb 2008 01:01:12 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:40479</guid><dc:creator>Brolly</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/40479.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=40479</wfw:commentRss><description>Done ;) Ευχαριστω.&lt;br&gt;</description></item><item><title>Απ: Πρόβλημα με HttpWebResponse. C#.NET</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/40476.aspx</link><pubDate>Mon, 25 Feb 2008 23:54:28 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:40476</guid><dc:creator>spantos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/40476.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=40476</wfw:commentRss><description>&lt;P&gt;Έχεις δίκιο, θυμόμουν λάθος ότι το WebRequest υλοποιεί το IDisposable.&lt;/P&gt;
&lt;P&gt;Μπορείς παρ' όλ' αυτά να δοκιμάσεις να καθαρίσεις μόνος σου τα αντικείμενα που χρησιμοποείς&lt;/P&gt;
&lt;P&gt;δοκίμασε για παράδειγμα να κάνεις&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:green;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;// Cleanup the streams and the response.&lt;/SPAN&gt;&lt;BR&gt;reader.Close ();&lt;BR&gt;dataStream.Close ();&lt;BR&gt;response.Close ();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;ΗΤΗ.&lt;/SPAN&gt;&lt;/P&gt;</description></item><item><title>Απ: Πρόβλημα με HttpWebResponse. C#.NET</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/40474.aspx</link><pubDate>Mon, 25 Feb 2008 23:34:13 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:40474</guid><dc:creator>Brolly</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/40474.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=40474</wfw:commentRss><description>Καταρχην σε ευχαριστω για την απαντηση.&lt;br&gt;&lt;br&gt;Tο ειχα χρησιμοποιησει και πριν με using αλλα επερνα αυτο&amp;nbsp; -&amp;gt; Error&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 'System.Net.HttpWebRequest': type used in a using statement must be implicitly convertible to 'System.IDisposable'&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Documents and Settings\Admin\My Documents\Visual Studio 2005\Projects\IPViewer\IP Viewer\IP Viewer\Form1.cs&amp;nbsp;&amp;nbsp;&amp;nbsp; 57&amp;nbsp;&amp;nbsp;&amp;nbsp; 17&amp;nbsp;&amp;nbsp;&amp;nbsp; IP Viewer&lt;br&gt;&lt;br&gt;</description></item><item><title>Απ: Πρόβλημα με HttpWebResponse. C#.NET</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/40473.aspx</link><pubDate>Mon, 25 Feb 2008 23:18:56 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:40473</guid><dc:creator>spantos</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/40473.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=40473</wfw:commentRss><description>&lt;P&gt;Θα σου πρότεινα να μη χρησιμοποιείς το request ως global αντικείμενο αλλά local δηλαδή κάπως έτσι:&lt;/P&gt;
&lt;P&gt;
&lt;TABLE style="BORDER-RIGHT:#e5e5e5 1px solid;BORDER-TOP:#e5e5e5 1px solid;BORDER-LEFT:#e5e5e5 1px solid;BORDER-BOTTOM:#e5e5e5 1px solid;BACKGROUND-COLOR:#f2f2f2;" cellSpacing=0 cellPadding=0 width="100%" border=0&gt;

&lt;TR style="VERTICAL-ALIGN:top;LINE-HEIGHT:normal;"&gt;
&lt;TD style="WIDTH:40px;TEXT-ALIGN:right;"&gt;&lt;PRE style="BORDER-RIGHT:#e7e7e7 1px solid;PADDING-RIGHT:2px;PADDING-LEFT:2px;FONT-SIZE:11px;PADDING-BOTTOM:2px;MARGIN:0px;COLOR:gray;PADDING-TOP:2px;FONT-FAMILY:courier new;"&gt;1&lt;BR&gt;2&lt;BR&gt;3&lt;BR&gt;4&lt;BR&gt;5&lt;BR&gt;6&lt;BR&gt;7&lt;BR&gt;8&lt;BR&gt;9&lt;BR&gt;10&lt;BR&gt;11&lt;BR&gt;12&lt;BR&gt;13&lt;BR&gt;14&lt;BR&gt;15&lt;BR&gt;16&lt;BR&gt;17&lt;BR&gt;18&lt;BR&gt;19&lt;BR&gt;20&lt;BR&gt;21&lt;BR&gt;22&lt;BR&gt;23&lt;BR&gt;24&lt;BR&gt;25&lt;BR&gt; &lt;/PRE&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;PRE style="PADDING-RIGHT:2px;PADDING-LEFT:8px;PADDING-BOTTOM:2px;MARGIN:0px;PADDING-TOP:2px;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:black;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;string&lt;/SPAN&gt; strToFind &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:#666666;FONT-FAMILY:Courier New;BACKGROUND-COLOR:#e4e4e4;"&gt;"\"ipaddress\"&amp;gt;"&lt;/SPAN&gt;;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;string&lt;/SPAN&gt; requestLine &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:#666666;FONT-FAMILY:Courier New;BACKGROUND-COLOR:#e4e4e4;"&gt;""&lt;/SPAN&gt;;&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;try&lt;/SPAN&gt;&lt;BR&gt;{&lt;BR&gt;    &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;using&lt;/SPAN&gt;(HttpWebRequest request &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (HttpWebRequest)WebRequest.Create(myWanIp))&lt;BR&gt;    {&lt;BR&gt;        request.Method &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:#666666;FONT-FAMILY:Courier New;BACKGROUND-COLOR:#e4e4e4;"&gt;"GET"&lt;/SPAN&gt;;&lt;BR&gt;        response &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; (HttpWebResponse)request.GetResponse();&lt;BR&gt;&lt;BR&gt;        StreamReader reader &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;new&lt;/SPAN&gt; StreamReader(response.GetResponseStream());&lt;BR&gt;&lt;BR&gt;        &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;while&lt;/SPAN&gt; (!reader.EndOfStream)&lt;BR&gt;        {&lt;BR&gt;            requestLine &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; reader.ReadLine();&lt;BR&gt;            &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;if&lt;/SPAN&gt; (requestLine.Contains(strToFind))&lt;BR&gt;            {&lt;BR&gt;                requestLine &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; requestLine.Replace(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:#666666;FONT-FAMILY:Courier New;BACKGROUND-COLOR:#e4e4e4;"&gt;"&amp;lt;p class=\"ipaddress\"&amp;gt;"&lt;/SPAN&gt;, &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:#666666;FONT-FAMILY:Courier New;BACKGROUND-COLOR:#e4e4e4;"&gt;""&lt;/SPAN&gt;);&lt;BR&gt;                requestLine &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; requestLine.Replace(&lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:#666666;FONT-FAMILY:Courier New;BACKGROUND-COLOR:#e4e4e4;"&gt;"&amp;lt;/p&amp;gt;"&lt;/SPAN&gt;, &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:#666666;FONT-FAMILY:Courier New;BACKGROUND-COLOR:#e4e4e4;"&gt;""&lt;/SPAN&gt;);&lt;BR&gt;                ExtIPTextBox.Text &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:red;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;=&lt;/SPAN&gt; requestLine;&lt;BR&gt;                &lt;SPAN style="FONT-WEIGHT:normal;FONT-SIZE:11px;COLOR:blue;FONT-FAMILY:Courier New;BACKGROUND-COLOR:transparent;"&gt;break&lt;/SPAN&gt;;&lt;BR&gt;            }&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;P&gt;Mόλις φτάσεις στο τέλος του using block θα γίνουν release όλα τα resources που τυχόν&amp;nbsp;κρατάει και έτσι (φαντάζομαι) ότι&amp;nbsp;δε θα σου δημιουργεί προβήματα όταν ξαναδημιουργείς.&lt;/P&gt;
&lt;P&gt;HTH.&lt;/P&gt;</description></item><item><title>Πρόβλημα με HttpWebResponse. C#.NET</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/40471.aspx</link><pubDate>Mon, 25 Feb 2008 22:53:33 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:40471</guid><dc:creator>Brolly</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/40471.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=74&amp;PostID=40471</wfw:commentRss><description>&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;string&lt;/span&gt; strToFind &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; &lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"\"ipaddress\"&amp;gt;"&lt;/span&gt;;&lt;br&gt;            &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;string&lt;/span&gt; requestLine &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; &lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;""&lt;/span&gt;;&lt;br&gt;            &lt;br&gt;            &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;try&lt;/span&gt;&lt;br&gt;            {&lt;br&gt;                &amp;nbsp;&amp;nbsp;&amp;nbsp; request &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; (HttpWebRequest)WebRequest.Create(myWanIp);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; request.Method &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; &lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"GET"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; response &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; (HttpWebResponse)request.GetResponse();&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StreamReader reader &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;new&lt;/span&gt; StreamReader(response.GetResponseStream());&lt;br&gt;&lt;br&gt;                &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while&lt;/span&gt; (!reader.EndOfStream)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; requestLine &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; reader.ReadLine();&lt;br&gt;                    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt; (requestLine.Contains(strToFind))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; requestLine &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; requestLine.Replace(&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"&amp;lt;p class=\"ipaddress\"&amp;gt;"&lt;/span&gt;, &lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;""&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; requestLine &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; requestLine.Replace(&lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"&amp;lt;/p&amp;gt;"&lt;/span&gt;, &lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;""&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ExtIPTextBox.Text &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; requestLine;&lt;br&gt;                        &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; break&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;            }&lt;/span&gt;&lt;br&gt;&lt;br&gt;Εχω τον παραπανω κωδικα σε ενα app που περνει Εσωτερικο και Εξωτερικο IP/Hostname.Όλα ειναι μια χαρα. Το εχω κανει να τα παιρνει στο Load της φορμας.&lt;br&gt;Εχω και ενα Refresh button με το οποιο ξανα εκτελω τις συναρτησεις που περνουν IP/Hostname.Οταν λοιπον πατησω μια φορα το Refresh τα ξαναπαιρνει ολα μια χαρα.Οταν ομως το πατησω και δευτερη φορα τοτε κολαει το app στην συναρτηση που παιρνω το εξωτερικο IP δηλαδη σ'αυτην που σας δειχνω παραπανω.Εβαλα ενα breakpoint και ειδα οτι κολαει την 2η φορα που πατιετε το refresh εδω : &lt;/span&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;                response &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; (HttpWebResponse)request.GetResponse(); ...&lt;br&gt;&lt;br&gt;Thanks in advance.&lt;br&gt;&lt;/span&gt;</description></item></channel></rss>