<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IDE.as-to.eu</title>
	<atom:link href="http://ide.as-to.eu/feed/" rel="self" type="application/rss+xml" />
	<link>http://ide.as-to.eu</link>
	<description>TurboC++, Visual Studio, IDE tutorials.</description>
	<lastBuildDate>Fri, 27 Apr 2012 07:58:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Simple TCP Client &#8211; Server example</title>
		<link>http://ide.as-to.eu/2012/04/27/simple-tcp-client-server-example/</link>
		<comments>http://ide.as-to.eu/2012/04/27/simple-tcp-client-server-example/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 07:06:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ostatné/Other VC#]]></category>
		<category><![CDATA[Visual C#]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=598</guid>
		<description><![CDATA[Server Client]]></description>
			<content:encoded><![CDATA[<p><strong>Server</strong></p>
<pre class="brush: csharp; title: ; notranslate">using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Net;
using System.Net.Sockets;

namespace TCP_server_client_test
{
    public partial class Form1 : Form
    {
        private Thread serverThread;
        private TcpListener serverListener;

        public Form1()
        {
            InitializeComponent();
            serverThread = new Thread(new ThreadStart(startListen));
            serverThread.Start();
        }

        public void startListen()
        {
            try
            {
                serverListener = new TcpListener(IPAddress.Parse(&quot;127.0.0.1&quot;), 1234);
                serverListener.Start();
                do
                {
                     TcpClient client = serverListener.AcceptTcpClient();
                     Thread clientThread = new Thread(new ParameterizedThreadStart(ClientThread));
                     clientThread.Start(client);
                }
                while (true);
            }
            catch
            {
                serverListener.Stop();
            }
        }

        private void ClientThread(object client)
        {
            TcpClient tcpClient = (TcpClient)client;
            NetworkStream clientStream = tcpClient.GetStream();

            byte[] message = new byte[4096];
            int bytesRead;

            while (true)
            {
                bytesRead = 0;

                try
                {
                    bytesRead = clientStream.Read(message, 0, 4096);
                }
                catch
                {
                    break;
                }

                if (bytesRead == 0)
                {
                    break;
                }

                UTF8Encoding encoder = new UTF8Encoding();
                AddLog(encoder.GetString(message, 0, bytesRead));
            }
            tcpClient.Close();
        }

        public void AddLog(string msg)
        {
            MethodInvoker method = delegate
            {
                listBox1.Items.Add(msg);
            };

            if (InvokeRequired)
                BeginInvoke(method);
            else
                method.Invoke();
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            serverListener.Stop();
        }
    }
}
</pre>
<p><strong>Client</strong></p>
<pre class="brush: csharp; title: ; notranslate">using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;

namespace Client
{
    public partial class Form1 : Form
    {
        TcpClient client;
        public Form1()
        {
            InitializeComponent();
            connect();
        }

        private void connect()
        {
            client = new TcpClient();
            IPEndPoint serverEndPoint = new IPEndPoint(IPAddress.Parse(&quot;127.0.0.1&quot;), 1234);
            client.Connect(serverEndPoint);
            send(&quot;Client connected...&quot;);
        }

        private void send(String msg)
        {
            NetworkStream clientStream = client.GetStream();
            UTF8Encoding encoder = new UTF8Encoding();
            byte[] buffer = encoder.GetBytes(msg);
            clientStream.Write(buffer, 0, buffer.Length);
            clientStream.Flush();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            send(textBox1.Text);
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2012/04/27/simple-tcp-client-server-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextBox &#8211; enable only number and backspace/delete</title>
		<link>http://ide.as-to.eu/2012/02/15/textbox-enable-only-number/</link>
		<comments>http://ide.as-to.eu/2012/02/15/textbox-enable-only-number/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 09:35:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ostatné/Other VC#]]></category>
		<category><![CDATA[Visual C#]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=594</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: csharp; title: ; notranslate">private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
    int num;
    if ((!Int32.TryParse(e.KeyChar.ToString(), out num)) &amp;&amp; !(e.KeyChar == (char)8)) e.Handled = true;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2012/02/15/textbox-enable-only-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add all subdirectory name to ComboBox</title>
		<link>http://ide.as-to.eu/2012/02/15/add-all-subdirectory-name-to-combobox/</link>
		<comments>http://ide.as-to.eu/2012/02/15/add-all-subdirectory-name-to-combobox/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 08:56:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ostatné/Other VC#]]></category>
		<category><![CDATA[Visual C#]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=589</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: csharp; title: ; notranslate">private void comboBox1_DropDown(object sender, EventArgs e)
{
 comboBox1.Items.Clear();
 string baseDir = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
 string[] dirPaths = Directory.GetDirectories(baseDir);
 foreach(string dir in dirPaths)
  {
   comboBox1.Items.Add(new DirectoryInfo(dir).Name);
  }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2012/02/15/add-all-subdirectory-name-to-combobox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenXML .XLSX get cell value</title>
		<link>http://ide.as-to.eu/2011/11/11/openxml-xlsx-get-cell-value/</link>
		<comments>http://ide.as-to.eu/2011/11/11/openxml-xlsx-get-cell-value/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 09:28:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ostatné/Other VC#]]></category>
		<category><![CDATA[Visual C#]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=573</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: csharp; title: ; notranslate">
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
...
        public string GetCellValue(string filename, int row, int column, int sheet_number)
        {
                SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Open(filename, false);
                WorkbookPart workbookPart = spreadsheetDocument.WorkbookPart;
                Worksheet sheet = workbookPart.WorksheetParts.ElementAtOrDefault(sheet_number).Worksheet;
                SharedStringTablePart stringTablePart = workbookPart.SharedStringTablePart;
                Cell cell = sheet.Descendants&lt;Row&gt;().ElementAt(row).Descendants&lt;Cell&gt;().ElementAt(column);

                string value = cell.CellValue != null ? cell.CellValue.InnerXml : String.Empty;

                if (cell.DataType != null &amp;&amp; cell.DataType.Value == CellValues.SharedString)
                 return stringTablePart.SharedStringTable.ChildElements[Int32.Parse(value)].InnerText;
                else
                 return value;
        }</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2011/11/11/openxml-xlsx-get-cell-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenXML .XLSX get sheet count</title>
		<link>http://ide.as-to.eu/2011/11/11/openxml-xlsx-get-sheet-count/</link>
		<comments>http://ide.as-to.eu/2011/11/11/openxml-xlsx-get-sheet-count/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 09:26:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ostatné/Other VC#]]></category>
		<category><![CDATA[Visual C#]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=571</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: csharp; title: ; notranslate">
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
...
public string GetSheetCount(string filename)
{
    return SpreadsheetDocument.Open(filename, false).WorkbookPart.WorksheetParts.Count().ToString();
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2011/11/11/openxml-xlsx-get-sheet-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Access .MDB AutoIncrement Column value reset</title>
		<link>http://ide.as-to.eu/2011/10/25/access-mdb-autoincrement-column-value-reset/</link>
		<comments>http://ide.as-to.eu/2011/10/25/access-mdb-autoincrement-column-value-reset/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 12:06:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Databáza/Database]]></category>
		<category><![CDATA[TurboC++]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=569</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: cpp; title: ; notranslate">
ADOQuery1-&gt;SQL-&gt;Clear();
ADOQuery1-&gt;SQL-&gt;Add(&quot;ALTER TABLE TableName ALTER COLUMN ColumnName AUTOINCREMENT(1,1);&quot;); //(1,1)-&gt;The starting value will be 1, and it will increment by 1.
ADOQuery1-&gt;ExecSQL();</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2011/10/25/access-mdb-autoincrement-column-value-reset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDFSharp &#8211; Add to exist PDF</title>
		<link>http://ide.as-to.eu/2011/10/25/pdfsharp-add-to-exist-pdf/</link>
		<comments>http://ide.as-to.eu/2011/10/25/pdfsharp-add-to-exist-pdf/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 09:25:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ostatné/Other VC#]]></category>
		<category><![CDATA[Visual C#]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=566</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: csharp; title: ; notranslate">
using PdfSharp.Pdf;
using PdfSharp.Pdf.IO;
using PdfSharp.Drawing;
using System.Diagnostics;
using System.IO;
...
            string file = &quot;test.pdf&quot;;
            PdfDocument outputDocument = new PdfDocument();
            PdfDocument doc = PdfSharp.Pdf.IO.PdfReader.Open(file, PdfDocumentOpenMode.Import);
            PdfPage page = doc.Pages[0];

            outputDocument.AddPage(page);
            PdfPage page2 = outputDocument.Pages[0];
            XGraphics gfx = XGraphics.FromPdfPage(page2);
            XImage image = XImage.FromFile(&quot;image.jpg&quot;);
            gfx.DrawImage(image, 5, 100);

            XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);
            XFont font = new XFont(&quot;ArialCE&quot;, 13, XFontStyle.Regular, options);
            gfx.DrawString(&quot;Test text: ľščťžňýáíéúäô - &quot; + DateTime.Now, font, XBrushes.Black, 5, 100);

            if(File.Exists(&quot;out.pdf&quot;)){File.Delete(&quot;out.pdf&quot;);}
            outputDocument.Save(&quot;out.pdf&quot;);

            Process.Start(&quot;out.pdf&quot;);</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2011/10/25/pdfsharp-add-to-exist-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Synapse THTTPSend-&gt;Document) TMemoryStream to AnsiString</title>
		<link>http://ide.as-to.eu/2011/09/28/synapse-thttpsend-document-tmemorystream-to-ansistring/</link>
		<comments>http://ide.as-to.eu/2011/09/28/synapse-thttpsend-document-tmemorystream-to-ansistring/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 10:36:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ostatné/Other]]></category>
		<category><![CDATA[TurboC++]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=559</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: cpp; title: ; notranslate">THTTPSend *http=new(THTTPSend);
AnsiString s;
http-&gt;HTTPMethod(&quot;GET&quot;, &quot;http://ide.as-to.eu/&quot;);
s.SetLength(http-&gt;Document-&gt;Size);
http-&gt;Document-&gt;Position = 0;
http-&gt;Document-&gt;Read(s.c_str(), s.Length());
Caption=s;</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2011/09/28/synapse-thttpsend-document-tmemorystream-to-ansistring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integer to time</title>
		<link>http://ide.as-to.eu/2011/09/28/integer-to-time/</link>
		<comments>http://ide.as-to.eu/2011/09/28/integer-to-time/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 08:05:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ostatné/Other]]></category>
		<category><![CDATA[TurboC++]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=554</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: cpp; title: ; notranslate">int sec=72;
ShowMessage(TimeToStr(TimeStampToDateTime(MSecsToTimeStamp(sec*1000+24*3600*1000)))); //show 0:01:12</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2011/09/28/integer-to-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search on file</title>
		<link>http://ide.as-to.eu/2011/08/31/search-on-file/</link>
		<comments>http://ide.as-to.eu/2011/08/31/search-on-file/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 08:08:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ostatné/Other VC#]]></category>
		<category><![CDATA[Visual C#]]></category>

		<guid isPermaLink="false">http://ide.as-to.eu/?p=549</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: csharp; title: ; notranslate">using System.IO;
...
StreamReader testTxt = new StreamReader(&quot;test.txt&quot;);
string line = &quot;&quot;;
while ((line = testTxt.ReadLine()) != null)
{
if (line.Substring(2, 32) == &quot;0D5F86A97FDF0366A3A52BA639F991F3&quot;) {MessageBox.Show(line.Substring(38, 9));}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://ide.as-to.eu/2011/08/31/search-on-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

