<?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>Coder</title>
	<atom:link href="http://coder.digitaldunyam.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://coder.digitaldunyam.net</link>
	<description>Kod Dünyam</description>
	<lastBuildDate>Thu, 08 Mar 2012 10:50:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Aspnet QueryString makale gösterme</title>
		<link>http://coder.digitaldunyam.net/aspnet-querystring-makale-gosterme/</link>
		<comments>http://coder.digitaldunyam.net/aspnet-querystring-makale-gosterme/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 10:50:35 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[DataTable]]></category>
		<category><![CDATA[İf]]></category>
		<category><![CDATA[Metod]]></category>
		<category><![CDATA[QueryString]]></category>
		<category><![CDATA[SqlConnection]]></category>
		<category><![CDATA[SqlDataReader]]></category>
		<category><![CDATA[aspnet makale gösterme]]></category>
		<category><![CDATA[blog yazısı gösterme]]></category>
		<category><![CDATA[datalist doldurma]]></category>
		<category><![CDATA[datatable doldurma]]></category>
		<category><![CDATA[id ye göre makale oku]]></category>
		<category><![CDATA[veritabanından makale okuma]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=595</guid>
		<description><![CDATA[Başlık biraz anlamsız oldu anlıyorum sizi&#8230; Basit bir konu ile merhaba. Dinamik web sitelerinde kullanılan veritabanı ile ilişkili içerik yayınlama siteleri, kısaca basit makale okuma sitelerindeki database den makalenin sayfada nasıl gösterileceğini görelim. Basit ve genel konu olduğu için araştırdığım kadarıyla çoğu site değinmemiş olaya. Direk konuya girersek, önceden hazırlarnmış veritabanımız ve tablomuz olsun. İçinde [...]]]></description>
			<content:encoded><![CDATA[<p>Başlık biraz anlamsız oldu anlıyorum sizi&#8230; Basit bir konu ile merhaba. Dinamik web sitelerinde kullanılan veritabanı ile ilişkili içerik yayınlama siteleri, kısaca basit makale okuma sitelerindeki database den makalenin sayfada nasıl gösterileceğini görelim.</p>
<p><img src="http://coder.digitaldunyam.net/wp-content/uploads/2011/12/makale-id-okuma-querystring.png" alt="" title="makale-id-okuma-querystring" width="572" height="284" class="aligncenter size-full wp-image-597" /></p>
<p>Basit ve genel konu olduğu için araştırdığım kadarıyla çoğu site değinmemiş olaya.  Direk konuya girersek, önceden hazırlarnmış veritabanımız ve tablomuz olsun. İçinde  sade bir şekilde (id, baslik, makale) kolonları olsun. Görsel kısımda da bir ana.master sayfamız default ve makaleoku sayfalarımız olsun. </p>
<p>Birkaç ufak css ile ana.master sayfamızı başlıkların bulunduğu menü 300px ve yazının gösterileceği 600px lik alan ile ikiye bölünsün. Ana.master sayfamızın menüsüne güncel konular başlığı altında Datalist ekleyerek attaki gibi kodlayalım;</p>
<div class="codecolorer-container asp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="asp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;asp:DataList ID=&quot;DataList1&quot; runat=&quot;server&quot; DataKeyField=&quot;yid&quot; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Width=&quot;224px&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;ItemTemplate&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:HyperLink ID=&quot;HyperLink1&quot; runat=&quot;server&quot; Text ='<span style="color: #000000; font-weight: bold;">&lt;%</span># Eval<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;baslik&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">%&gt;</span>' NavigateUrl ='<span style="color: #000000; font-weight: bold;">&lt;%</span># <span style="color: #cc0000;">&quot;~/oku.aspx?giden=&quot;</span>+Eval<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;yid&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #000000; font-weight: bold;">%&gt;</span>'&gt;HyperLink&lt;/asp:HyperLink&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/ItemTemplate&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;AlternatingItemStyle BackColor=&quot;Gainsboro&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp;&lt;/asp:DataList&gt;</div></div>
<p>F7 ile kod kısmına gelerek postback ile kontrol edip load kısmına metod yardımı ile veri tabanımızdaki son 5 makaleyi gösterelim;</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>Page<span style="color: #008000;">.</span><span style="color: #0000FF;">IsPostBack</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; doldur<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp;<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> doldur<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SqlConnection sql <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlConnection<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;server=.; database=coder; trusted_connection=true;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SqlCommand cmd <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlCommand<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Select top 5 * from tblyazi &quot;</span>, sql<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataTable dt <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> DataTable<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SqlDataAdapter adp <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlDataAdapter<span style="color: #008000;">&#40;</span>cmd<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sql<span style="color: #008000;">.</span><span style="color: #0000FF;">Open</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adp<span style="color: #008000;">.</span><span style="color: #0000FF;">Fill</span><span style="color: #008000;">&#40;</span>dt<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SqlDataReader oku <span style="color: #008000;">=</span> cmd<span style="color: #008000;">.</span><span style="color: #0000FF;">ExecuteReader</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>oku<span style="color: #008000;">.</span><span style="color: #0000FF;">Read</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataList1<span style="color: #008000;">.</span><span style="color: #0000FF;">DataSource</span> <span style="color: #008000;">=</span> dt<span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataList1<span style="color: #008000;">.</span><span style="color: #0000FF;">DataBind</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sql<span style="color: #008000;">.</span><span style="color: #0000FF;">Close</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
<p>ana.master menümüzdeki son 5 yazıyı gösterdikten sonra makaleyi okuma kısmına geçebiliriz. Basit bir şekilde olması için makaleoku sayfasına başlık için label ve makale için bir label ekleyin. F7 ile kod kısman geçip load kısmına alttaki kodları yerleştirdikten sonra işlemi bitirelim;</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> Page_Load<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SqlConnection sql <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlConnection<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;server=.; database=coder; trusted_connection=true;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">int</span> icerik <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">int</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Parse</span><span style="color: #008000;">&#40;</span>Request<span style="color: #008000;">.</span><span style="color: #0000FF;">QueryString</span><span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;giden&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SqlDataAdapter adp <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlDataAdapter<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;select * from makaletablosu where id=&quot;</span> <span style="color: #008000;">+</span> icerik, sql<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataTable dt <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> DataTable<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adp<span style="color: #008000;">.</span><span style="color: #0000FF;">Fill</span><span style="color: #008000;">&#40;</span>tablo<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Label1<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> dt<span style="color: #008000;">.</span><span style="color: #0000FF;">Rows</span><span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;baslik&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Label2<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> dt<span style="color: #008000;">.</span><span style="color: #0000FF;">Rows</span><span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;yazi&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #008000;">&#125;</span></div></div>
<p>İşlem bu kadar, dikkat edilmesi gereken nokta Querystring dediğimiz yapı üzerinde. Başlıkları gösterdiğimiz ana.master sayfasında görsel kısmında <strong>~/oku.aspx?giden=</strong> giden string i yakalayıp makaleoku sayfasında kod kısmında <strong>int.Parse(Request.QueryString["giden"]);</strong> diyerek urlden gelen stringi yakalayıp makale id&#8217;sine göre veritabanından veriyi çekip göstermektek. </p>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/aspnet-querystring-makale-gosterme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sunucudaki veritabanına Membership kurulumu</title>
		<link>http://coder.digitaldunyam.net/sunucudaki-veritabanina-membership-kurulumu/</link>
		<comments>http://coder.digitaldunyam.net/sunucudaki-veritabanina-membership-kurulumu/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 20:06:53 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Membership]]></category>
		<category><![CDATA[local membership kurulumu]]></category>
		<category><![CDATA[membership bağlantısı]]></category>
		<category><![CDATA[site için connectionstirng]]></category>
		<category><![CDATA[sunucuya membership]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=585</guid>
		<description><![CDATA[Asp.net Membership yeni öğrenenler localdeki veritabanına örnek çalışma ve uygulamalar için birkaç kez Membership yapısını kurmuşuzdur. Fakat sunucudaki veritabanına bildiğimiz şekilde kurulumu yapamayız. Localdekinden farklı kuruluma sahip olan uzak sunucudaki membership kurulumunda yapılması gereken yol, birkaç satır komut hariç neredeyse aynı. Benzer şekilde projemizi oluşturup, sunucudaki veritabanını oluşturduktan sonra Command Prompt &#8216;u açıp alttaki komutları [...]]]></description>
			<content:encoded><![CDATA[<p>Asp.net Membership yeni öğrenenler localdeki veritabanına örnek çalışma ve uygulamalar için birkaç kez Membership yapısını kurmuşuzdur. Fakat sunucudaki veritabanına bildiğimiz şekilde kurulumu yapamayız. Localdekinden farklı kuruluma sahip olan uzak sunucudaki membership kurulumunda yapılması gereken yol, birkaç satır komut hariç neredeyse aynı.</p>
<p>Benzer şekilde projemizi oluşturup, sunucudaki veritabanını oluşturduktan sonra <strong>Command Prompt </strong>&#8216;u açıp alttaki komutları kullanıcı adı, şifre vs. bilgilerinize göre doğru şekilde yazıp çalıştırın.</p>
<div id='stb-box-5372' class='stb-info_box' >aspnet_regsql -S Server Ip adresi -U Kullanıcı Adı -P Şifre -d Database -A all</div>
<p>Bunu yaptıktan sonra localdeki gibi daha sonra çıkan kurulumu kendisi yapıp tabloları ekliyor. Bundan sonra yapmanız gereken web.config gibi ilgili yere database bağlantınızı yazıp, localhost kurulumu gibi Configuration ayarlarını yapıp işlemi bitirmek. </p>
<p>Uzaktaki veritabanı için gerekli connectionstring;</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">&lt;</span>connectionStrings<span style="color: #008000;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&lt;</span>clear <span style="color: #008000;">/&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000;">&lt;</span>add name<span style="color: #008000;">=</span><span style="color: #666666;">&quot;LocalSqlServer&quot;</span> connectionString<span style="color: #008000;">=</span><span style="color: #666666;">&quot;Data Source=sunucu ip;Initial Catalog=database; User Id=kullaniciid;Password=database şifresi;&quot;</span><br />
&nbsp; &nbsp; &nbsp; providerName<span style="color: #008000;">=</span><span style="color: #666666;">&quot;System.Data.SqlClient&quot;</span> <span style="color: #008000;">/&gt;</span><br />
&nbsp; <span style="color: #008000;">&lt;/</span>connectionStrings<span style="color: #008000;">&gt;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/sunucudaki-veritabanina-membership-kurulumu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Registry ile login işlemi</title>
		<link>http://coder.digitaldunyam.net/registry-ile-login-islemi/</link>
		<comments>http://coder.digitaldunyam.net/registry-ile-login-islemi/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 19:37:10 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Foreach]]></category>
		<category><![CDATA[İf]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[anahtar okuma]]></category>
		<category><![CDATA[csharp login programı]]></category>
		<category><![CDATA[foreach döngü örnekleri]]></category>
		<category><![CDATA[regedit şifre kayıt]]></category>
		<category><![CDATA[registry kullanıcı kayıt]]></category>
		<category><![CDATA[şifreli giriş yapma]]></category>
		<category><![CDATA[tüm kontrolleri yönetme]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=577</guid>
		<description><![CDATA[Windows&#8217;un programları çalıştırma veritabanı Registry, login isteyen uygulamalarda da yardımcı oluyor. Ne gereği var ram içinde de tutulabilir diyorsanız haklı olabilirsiniz. Uygulamayı farklı birilerine verdiğinizde kendi şifre ve kullanıcı adını kullanabilir. Bunun için her kullanıcıya ayrı değer tutan değişken tanımlamanız gerekir. Her neyse.. hikayeyi fazla uzatmadan Registry ile login olma olayına geçelim. Bu projede 3 [...]]]></description>
			<content:encoded><![CDATA[<p>Windows&#8217;un programları çalıştırma veritabanı Registry, login isteyen uygulamalarda da yardımcı oluyor. Ne gereği var ram içinde de tutulabilir diyorsanız haklı olabilirsiniz. Uygulamayı farklı birilerine verdiğinizde kendi şifre ve kullanıcı adını kullanabilir. Bunun için her kullanıcıya ayrı değer tutan değişken tanımlamanız gerekir. Her neyse.. hikayeyi fazla uzatmadan Registry ile login olma olayına geçelim.</p>
<p>Bu projede 3 tane form kullandım. Biri ilk girişte yeni kullanıcı oluşturmak form, diğeri kullanıcı adı ve şifre ekranı form, diğeri de doğru login olunduğunda yeni sayfa için. Uygulamamızın çalışma mantığı şöyle ;</p>
<div id='stb-box-5781' class='stb-info_box' >Uygulama yüklü bilgisayarda ilk defa açıldığında yeni kullanıcı için kayıt ekranı gelecek. Kayıt edildikten sonra verilen kullanıcı adı ve şifre ile giriş yapılacak.</div>
<p>Formları ve uygun textbox ları formlara ekleyerek kod kısmına geçebiliriz; İlk olarak Program.cs kısmına anahtarın var olup olmadığını kontrol ediyoruz.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RegistryKey anahtar <span style="color: #008000;">=</span> Registry<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentUser</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Application<span style="color: #008000;">.</span><span style="color: #0000FF;">EnableVisualStyles</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Application<span style="color: #008000;">.</span><span style="color: #0000FF;">SetCompatibleTextRenderingDefault</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">OpenSubKey</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;Software\Coder&quot;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Application<span style="color: #008000;">.</span><span style="color: #0000FF;">Run</span><span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Form3<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Application<span style="color: #008000;">.</span><span style="color: #0000FF;">Run</span><span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Form1<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
<p>Burada yapılan iş CurrentUser&#8217;daki Software anahtarı altında oluşturmak istediğimiz Coder isimli anatarın var olup olmadığını kontrol ettiriyoruz. Eğer anahtar varsa, kullanıcının login olacağı formu açtırıyoruz. Yoksa yeni kullanıcı ekranı oluşturuyoruz. </p>
<p><img src="http://coder.digitaldunyam.net/wp-content/uploads/2011/11/yeni-kullanici-form.jpg" alt="" title="yeni-kullanici-form" width="394" height="376" class="aligncenter size-full wp-image-582" /></p>
<p>Yeni kullanıcı oluşturulması için resimdeki gibi form ekranı oluşturup kod kısmına geçebiliriz;</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-style: italic;">// using Microsoft.Win32; // Eklemeyi unutmayın !!!</span><br />
<br />
&nbsp;<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> button1_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span> &nbsp;<span style="color: #008080; font-style: italic;">//kaydet butonu</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RegistryKey anahtar <span style="color: #008000;">=</span> Registry<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentUser</span><span style="color: #008000;">;</span> <br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> sifre1 <span style="color: #008000;">=</span> txtsifre<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> sifre2 <span style="color: #008000;">=</span> txtsifretekrar<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>sifre1 <span style="color: #008000;">==</span> sifre2<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">try</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anahtar <span style="color: #008000;">=</span> anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateSubKey</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Software<span style="color: #008080; font-weight: bold;">\\</span>Coder&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;kullanici&quot;</span>, txtkul<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span>, RegistryValueKind<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;sifre&quot;</span>, txtsifre<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span>, RegistryValueKind<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>Control ktn <span style="color: #0600FF; font-weight: bold;">in</span> <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Controls</span><span style="color: #008000;">&#41;</span> <span style="color: #008080; font-style: italic;">//tüm label'ları görünür yaptık</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>ktn <a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">is</span></a> Label<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ktn<span style="color: #008000;">.</span><span style="color: #0000FF;">Visible</span><span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label8<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> txtkul<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label9<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span><span style="color: #008000;">=</span>txtsifre<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; demosuresi<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Registry<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentUser</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Flush</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label1<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Hata!!!&quot;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Şifreler uyuşmuyor&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> btngiris_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><span style="color: #008080; font-style: italic;">// login formuna giriş yaptırmak için</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Form1 frm <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Form1<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; frm<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Hide</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
<p><img src="http://coder.digitaldunyam.net/wp-content/uploads/2011/11/giris-ekrani.jpg" alt="" title="giris-ekrani" width="255" height="212" class="aligncenter size-full wp-image-581" /></p>
<p>Ve son olarak login olmamızı sağlayan giriş formunu resimdeki gibi ayarlayıp kod kısmına geçebiliriz.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> button1_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RegistryKey anahtar <span style="color: #008000;">=</span> Registry<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentUser</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anahtar<span style="color: #008000;">=</span>anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">OpenSubKey</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;Software\Coder&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> kuladi<span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#41;</span>anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">GetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;kullanici&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">string</span> sifre<span style="color: #008000;">=</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#41;</span>anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">GetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;sifre&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>txtkul<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">==</span> kuladi <span style="color: #008000;">&amp;</span> txtsifre<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">==</span> sifre<span style="color: #008000;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Form2 frm <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Form2<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; frm<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Hide</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Giriş başarısız&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
<p>Registry&#8217;a kayıt ettiğimiz anahları okuyarak kullanıcı adı ve şifresini kontrol ederek giriş yaptık&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/registry-ile-login-islemi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demo süreli program yapma</title>
		<link>http://coder.digitaldunyam.net/demo-sureli-program-yapma/</link>
		<comments>http://coder.digitaldunyam.net/demo-sureli-program-yapma/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 23:46:29 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[İf]]></category>
		<category><![CDATA[Progressbar]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[Switch-Case]]></category>
		<category><![CDATA[Tarih Fonksiyonları]]></category>
		<category><![CDATA[10 günlük program]]></category>
		<category><![CDATA[bir sonraki tarihi gösterme]]></category>
		<category><![CDATA[csharp süreli program]]></category>
		<category><![CDATA[demo program yapma]]></category>
		<category><![CDATA[iki tarih arası fark]]></category>
		<category><![CDATA[lost şifresi]]></category>
		<category><![CDATA[regedit kayıt]]></category>
		<category><![CDATA[registry deftere kayıt]]></category>
		<category><![CDATA[registry işlemleri]]></category>
		<category><![CDATA[registry tarih işlemleri]]></category>
		<category><![CDATA[registry veri okuma]]></category>
		<category><![CDATA[swich case progress bar]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=549</guid>
		<description><![CDATA[Başlığı ilgi çeksin diye biraz karıştırdım. Özür dileyerek karşılığında size ilgi duyacağınız bilgiler paylaşmak istiyorum. Bir yazılımcı yazdığı programı kullanıcıya tanıtmak için demo veya kısıtlı süreli ücretsiz verir. Örneklerini her yerde görebiliriz(30 günlük antivirüs prog vs.). Kullanıcı memnun kaldığında parasını ödeyerek yazılımın serialini yani aktifleştirme kodunu satın alır. Sınırsızca veya belirli sürede kullanır vs vs.. [...]]]></description>
			<content:encoded><![CDATA[<p>Başlığı ilgi çeksin diye biraz karıştırdım. Özür dileyerek karşılığında size ilgi duyacağınız bilgiler paylaşmak istiyorum. Bir yazılımcı yazdığı programı kullanıcıya tanıtmak için demo veya kısıtlı süreli ücretsiz verir. Örneklerini her yerde görebiliriz(30 günlük antivirüs prog vs.). Kullanıcı memnun kaldığında parasını ödeyerek yazılımın serialini yani aktifleştirme kodunu satın alır. Sınırsızca veya belirli sürede kullanır vs vs.. Senaryoyu kafanızda canlandırmış sınızdır umarım. Fazla uzatmadan konuya dalmak istiyorum.</p>
<p><img src="http://coder.digitaldunyam.net/wp-content/uploads/2011/11/csharp-demo-porgram.jpg" alt="" title="csharp-demo-porgram" width="322" height="308" class="aligncenter size-full wp-image-563" /></p>
<p>Basitçe bir form ekranına biraz afilli gözükmesi için resimdeki gibi 2 Label, 1 Progress Bar, 1 Buton ve son olarak aktifleştirme kodu girmek için 1 adet Textbox(janjanlı gözüksün diye maskedtextbox kullandım) yerleştirerek uygulamamıza başlayabiliriz. Senaryomuz şöyle ki;</p>
<div id='stb-box-4635' class='stb-info_box' >Uygulama ilk çalıştığı an itibariyle 10 günlük olup, doğru aktifleştirme kodu girildiğinde süresiz çalışan yazılım.</div>
<p>Çalışma mantığı, çoğu süreli programın mantığına benzemekte. Hackerlar iyi bilir bu mantığı, nedenin soracak olursanız yapacağımız programda bu klasik yöntem ile gelişmekte. Ama o kadar da kolay kırılabilen programcık olamayacağını söyleyebilirim. Temelinde registry etkileşimi yatmakta. </p>
<p>Program ilk defa açılır açılmaz Registry&#8217;a bir anahtar ve alt anahtar oluşturup diğer günlerde açıldığında ilk atadığımız anahtarı baz alarak kalan süreyi kontrol edip belirtmek. Süre bittiğinde de öngörülen işlemi yapmak. Doğru aktifleştirme kodu girildiğinde ise ilk açıldığında kayıt edilen anahtarı silerek, bundan sonraki açılışlarında kontrol etmeden süresiz çalışmak.</p>
<p>Registry ilgili ilk örneğiniz ise bu(<strong><a href="http://coder.digitaldunyam.net/csharp-ile-registry-ekleme-silme-islemleri/"  target="_blank">Csharp registry işlemleri</a></strong>) yazımı incelemenizde fayda olacak. Anladığınızı umarak direk kodlara dalıyorum;</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Microsoft.Win32</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">//Eklemeyi unutmayalım !!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
RegistryKey anahtar <span style="color: #008000;">=</span> Registry<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentUser</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> Form1_Load_1<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anahtar <span style="color: #008000;">=</span> anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateSubKey</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Software<span style="color: #008080; font-weight: bold;">\\</span>Coder&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span>anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">GetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Aktif&quot;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label1<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Program aktif edilmiş&quot;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; txtserial<span style="color: #008000;">.</span><span style="color: #0000FF;">Enabled</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; txtserial<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;4-8-15-16-23-42&quot;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">GetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Sonkullanma&quot;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label2<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Yazılımı aktif edilmesi için 10 gün kaldı...&quot;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Sonkullanma&quot;</span>, DateTime<span style="color: #008000;">.</span><span style="color: #0000FF;">Now</span><span style="color: #008000;">.</span><span style="color: #0000FF;">AddDays</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">10</span><span style="color: #008000;">&#41;</span>, RegistryValueKind<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">Flush</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DateTime dt1 <span style="color: #008000;">=</span> Convert<span style="color: #008000;">.</span><span style="color: #0000FF;">ToDateTime</span><span style="color: #008000;">&#40;</span>anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">GetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Sonkullanma&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DateTime dt2 <span style="color: #008000;">=</span> Convert<span style="color: #008000;">.</span><span style="color: #0000FF;">ToDateTime</span><span style="color: #008000;">&#40;</span>DateTime<span style="color: #008000;">.</span><span style="color: #0000FF;">Now</span><span style="color: #008000;">.</span><span style="color: #0000FF;">AddDays</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TimeSpan fark <span style="color: #008000;">=</span> dt1 <span style="color: #008000;">-</span> dt2<span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">int</span> sonuc <span style="color: #008000;">=</span> Convert<span style="color: #008000;">.</span><span style="color: #0000FF;">ToInt32</span><span style="color: #008000;">&#40;</span>fark<span style="color: #008000;">.</span><span style="color: #0000FF;">Days</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>sonuc <span style="color: #008000;">&lt;=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Süre Bitti&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">100</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label2<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Aktivasyon için &quot;</span> <span style="color: #008000;">+</span> Convert<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span>sonuc<span style="color: #008000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot; gün kaldı&quot;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">switch</span> <span style="color: #008000;">&#40;</span>sonuc<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">90</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">2</span><span style="color: #008000;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">80</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">3</span><span style="color: #008000;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">70</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">4</span><span style="color: #008000;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">60</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">5</span><span style="color: #008000;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">50</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">6</span><span style="color: #008000;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">40</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">7</span><span style="color: #008000;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">30</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">8</span><span style="color: #008000;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">20</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">case</span> <span style="color: #FF0000;">9</span><span style="color: #008000;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progressBar1<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">10</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> button4_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>txtserial<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;4-8-15-16-23-42&quot;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Aktif&quot;</span>, <span style="color: #FF0000;">3</span>, RegistryValueKind<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">Flush</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Application<span style="color: #008000;">.</span><span style="color: #0000FF;">Restart</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Girilen anahtar yanlış&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
<p><strong>Not :</strong> Kopyala yapıştır yapıldığında Form1_Load_1, button4_Click kısımlara göz ardı etmenizi isterim.  </p>
<div id='stb-box-1211' class='stb-info_box' >İşlemlerimizin çoğu formload kısmında gelişmekte. Sadece aktif etmek için buton kullanıldı. İlk olarak <strong>CurrentUser</strong> içindeki <strong>Software </strong>anahtarı içine Coder adında anahtar oluşturduk. &#8220;Aktif&#8221; isimli anahtarı koşullandırıp devam ettik (aktif anahtarı doğru aktivasyon kodu girdiğimizde oluşmakta tekrar değineceğim konuya). Ardından &#8220;Sonkullanma&#8221; isimli anahtarın var olup olmadığını kontrol edip yoksa 10 gün sonrası tarihe Registry&#8217;a kayıt ettik(programımız 10 günlük olduğu için). Eğer daha önceden eklenmiş ise Registry&#8217;dan değeri okuyarak bugününün tarihini çıkardık. 0 veya  küçük ise gerekli işlemi yaptırdık. </p>
<p>Progressbar ile kalan gün sayısını Registry&#8217;dan okuyarak switch case sayesinde doldurduk. Bu arada doğru kodu girdiğimizde ilk açıklama da belirttiğim &#8220;Aktif&#8221; anahtarını Registry&#8217;daki anahtarımızın içine kayıt ettik. Programı tekrar çalıştırmak, tamamen aktifleştirmek için Application.Restart() metodunu kullandık.<br />
</div>
<p>Şifre Lost hayranları için tanıdık gelebilir. Konumuza geri dönersek, bu uygulama ile Registry&#8217;a veri kayıt edip okuma, iki tarih arası fark alma, istenilen bir sonraki tarihi gösterme, tarihin sadece gün kısmını alma, switch case ile progressbar doldurma gibi birçok örneği de beraberinde kullandık. </p>
<p>Genel olarak demo, kısıtlı bir program yazmak için yapmanız gereken işlemler bu şekilde. Güzel bir makyaj ile uygulamayı daha tatlı hale getirebilirsiniz. Bir sonraki yazıda görüşmek dileği ile&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/demo-sureli-program-yapma/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Csharp ile registry ekleme silme işlemleri</title>
		<link>http://coder.digitaldunyam.net/csharp-ile-registry-ekleme-silme-islemleri/</link>
		<comments>http://coder.digitaldunyam.net/csharp-ile-registry-ekleme-silme-islemleri/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 15:48:01 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[Try-Catch]]></category>
		<category><![CDATA[createsubkey]]></category>
		<category><![CDATA[csharp regedit işlemleri]]></category>
		<category><![CDATA[opensubkey]]></category>
		<category><![CDATA[registry anahtar ekleme]]></category>
		<category><![CDATA[registry silme]]></category>
		<category><![CDATA[yeni dword oluşturma]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=541</guid>
		<description><![CDATA[Registry, Windows&#8217;un çalışması ve çalıştırması gereken veritabanı diyebiliriz. Neredeyse tüm programlar registry ile çalıştığını az çok tahmin edebiliyorsunuzdur. Hikayeyi fazla derinleştirmeden asıl mevzumuza geçersek, kayıt gerektiren bir masaüstü uygulaması geliştirdiğimizde; şifre işlemleri, son giriş tarihi gibi vs. kayıt gerektiren işlemleri daha güvenli bir yerde saklamamız için registry&#8217;i kullanırız. İnternet de bir çok registry işlemleri örnekleri [...]]]></description>
			<content:encoded><![CDATA[<p>Registry, Windows&#8217;un çalışması ve çalıştırması gereken veritabanı diyebiliriz. Neredeyse tüm programlar registry ile çalıştığını az çok tahmin edebiliyorsunuzdur. Hikayeyi fazla derinleştirmeden asıl mevzumuza geçersek, kayıt gerektiren bir masaüstü uygulaması geliştirdiğimizde; şifre işlemleri, son giriş tarihi gibi vs. kayıt gerektiren işlemleri daha güvenli bir yerde saklamamız için registry&#8217;i kullanırız.</p>
<p>İnternet de bir çok registry işlemleri örnekleri görmüşsünüzdür. Alternatif olarak daha basit, mantığını aktarmak için küçük bir uygulama yapmak istedim(Uygulama herhani bir işe yaramıyor). Altta gördüğünüz uygulamanın amacı, HKEL_CURRENT_USER altındaki Software anahtarı altına istediğimiz isimde anahtar oluşturarak, onun içerisine istediğimiz değerlerde anahtar oluşturmak.</p>
<p><img class="aligncenter size-full wp-image-544" title="registry-islemleri" src="http://coder.digitaldunyam.net/wp-content/uploads/2011/11/registry-islemleri.jpg" alt="" width="380" height="237" /></p>
<p>Resimdeki gibi basit form oluşturarak konuyu daha iyi anlayabilirsiniz. 3 tane buton ve ve bir label koyarak yapabilirsiniz. Oluşturduk tan sonra kod kısmına geçebiliriz;</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> button1_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
RegistryKey anahtar <span style="color: #008000;">=</span> Registry<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentUser</span><span style="color: #008000;">;</span><br />
<span style="color: #0600FF; font-weight: bold;">try</span><br />
<span style="color: #008000;">&#123;</span><br />
anahtar <span style="color: #008000;">=</span> anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateSubKey</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Software<span style="color: #008080; font-weight: bold;">\\</span>coder.digitaldunyam.net&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
label1<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Anahtar oluşturuldu&quot;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
<br />
<span style="color: #008000;">&#125;</span><br />
<br />
<span style="color: #008000;">&#125;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> button2_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
RegistryKey anahtar <span style="color: #008000;">=</span> Registry<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentUser</span><span style="color: #008000;">;</span><br />
anahtar <span style="color: #008000;">=</span> anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">OpenSubKey</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;Software\coder.digitaldunyam.net&quot;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #0600FF; font-weight: bold;">try</span><br />
<span style="color: #008000;">&#123;</span><br />
anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Coder&quot;</span>,<span style="color: #FF0000;">3</span>, RegistryValueKind<span style="color: #008000;">.</span><span style="color: #0000FF;">DWord</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;String deger&quot;</span>, RegistryValueKind<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
label1<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Alt Anahtar oluşturuldu&quot;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
<br />
label1<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Hata !&quot;</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #008000;">&#125;</span><br />
<br />
<span style="color: #008000;">&#125;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> button3_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
RegistryKey anahtar <span style="color: #008000;">=</span> Registry<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentUser</span><span style="color: #008000;">;</span><br />
anahtar <span style="color: #008000;">=</span> anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">OpenSubKey</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;Software\coder.digitaldunyam.net&quot;</span>,<span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #0600FF; font-weight: bold;">try</span><br />
<span style="color: #008000;">&#123;</span><br />
anahtar<span style="color: #008000;">.</span><span style="color: #0000FF;">DeleteValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Coder&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
label1<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;İlgili anahtar silindi&quot;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
<br />
label1<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span><span style="color: #666666;">&quot;Anahtar bulunamadı&quot;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
<span style="color: #008000;">&#125;</span></div></div>
<p>Açıklamaları kafa karıştırdığı için kod içinde vermiyorum. Anahtar oluşturma, silme işlemlerini anlamladırmak için Label ve mesajlar ile süsledim. Yapılanları görebilmek için Başlat-Çalıştır &#8220;Regedit&#8221; yazarak görebilirsiniz. </p>
<div id='stb-box-8234' class='stb-alert_box' >Dikkat etmeniz gereklerden bir tanesi <strong>using Microsoft.Win32;</strong> referansı ekleyip anahtar yollarını doğru yazmanız. CreateSubKey(&#8220;Software\\coder.digitaldunyam.net&#8221;) ile OpenSubKey(@&#8221;Software\coder.digitaldunyam.net&#8221;,true) arasındaki farkları göz ardı etmenizde fayda olacaktır. </div>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/csharp-ile-registry-ekleme-silme-islemleri/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax takvim aracı kullanımı</title>
		<link>http://coder.digitaldunyam.net/ajax-takvim-araci-kullanimi/</link>
		<comments>http://coder.digitaldunyam.net/ajax-takvim-araci-kullanimi/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 22:23:41 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[açılan takvim]]></category>
		<category><![CDATA[ajax takvimi]]></category>
		<category><![CDATA[asp ajax takvim]]></category>
		<category><![CDATA[calendarextender]]></category>
		<category><![CDATA[scriptmanager]]></category>
		<category><![CDATA[textbox takvimi]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=530</guid>
		<description><![CDATA[Ajax&#8217;ın getirdiği kolaylıkları saymak bitmez. Ücretli, ücretsiz bir çok ajax aracı ile karşılamışsınız dır. Ücretsiz olarak sık kullanılan eklentilerden bir tanesi de takvim(Calendar) aracı. Sağ da solda bir çok örneğini gördüğünüz aracın yapılışı ajax ile çocuk oyuncağı. Resimdeki gibi mause ile Textbox&#8217;ın üzerine gelindiğinde takvim aracını gösteren uygulamayı yapmak için bir adet textbox, scriptmanager ve [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://coder.digitaldunyam.net/wp-content/uploads/2011/10/ajax-takvim1-e1318198999796.jpg" alt="" title="ajax-takvim" width="150" height="172" class="alignleft size-full wp-image-534" />Ajax&#8217;ın getirdiği kolaylıkları saymak bitmez. Ücretli, ücretsiz bir çok ajax aracı ile karşılamışsınız dır. Ücretsiz olarak sık kullanılan eklentilerden bir tanesi de takvim(Calendar) aracı. Sağ da solda bir çok örneğini gördüğünüz aracın yapılışı ajax ile çocuk oyuncağı.</p>
<p>Resimdeki gibi mause ile Textbox&#8217;ın üzerine gelindiğinde takvim aracını gösteren uygulamayı yapmak için bir adet <strong>textbox</strong>, <strong>scriptmanager</strong> ve bir adet <strong>CalendarExtender</strong> toolkit&#8217;i kullanmanız gerekir.</p>
<div id='stb-box-5566' class='stb-info_box' >Ajax kontrollerin de sorun yaşayanlar için <a href="http://coder.digitaldunyam.net/ajax-kontrolleri-sorunsallari/"  target="_blank">bu bağlantı</a> daki yazıya göz atmakta fayda bulacaktır. </div>
<p>İlk önce form içerisine textbox&#8217;ı fırlatın name özelliğini txttarih olarak değiştirin. Ardından ajax&#8217;ın sayfamızda çalışması için scriptmanager&#8217;ı textbox&#8217;ın üstüne ekleyin. Son olarak  CalendarExtender&#8217;ı scriptmanager ile textbox arasına ekleyin.</p>
<div class="codecolorer-container asp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="asp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #006600; font-weight: bold;">&lt;</span>form id<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;form1&quot;</span> runat<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;server&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-weight: bold;">&lt;</span>asp<span style="color: #006600; font-weight: bold;">:</span>ScriptManager ID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;ScriptManager1&quot;</span> runat<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;server&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-weight: bold;">&lt;/</span>asp<span style="color: #006600; font-weight: bold;">:</span>ScriptManager<span style="color: #006600; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-weight: bold;">&lt;</span>asp<span style="color: #006600; font-weight: bold;">:</span>CalendarExtender ID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;CalendarExtender1&quot;</span> runat<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;server&quot;</span> Enabled<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;True&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; TargetControlID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;txttarih&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-weight: bold;">&lt;/</span>asp<span style="color: #006600; font-weight: bold;">:</span>CalendarExtender<span style="color: #006600; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-weight: bold;">&lt;</span>asp<span style="color: #006600; font-weight: bold;">:</span>TextBox ID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;txttarih&quot;</span> runat<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;server&quot;</span><span style="color: #006600; font-weight: bold;">&gt;&lt;/</span>asp<span style="color: #006600; font-weight: bold;">:</span>TextBox<span style="color: #006600; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-weight: bold;">&lt;/</span>form<span style="color: #006600; font-weight: bold;">&gt;</span></div></div>
<p>Kod olarak benzer bu şekilde yazılımsal görüntü alacaksınız. Calendar&#8217;ı ekledikten sonra son olarak özelliklerinden <strong>TargetControlID</strong> özelliğine txttarih olarak yazın.(Bunu kod kısmında da yapabilirsiniz.) İşlem bu kadar&#8230;</p>
<div id='stb-box-6708' class='stb-info_box' >Yukarıdaki kodları copy-paste yaparsanız muhtemelen çalışmayacaktır. Çünkü ajax kütüphanelerini projenize eklemeniz gerekmektedir. Bunun için öncelikle Ajax Control Toolkit&#8217;i projenize referans verip ardından Toolbox&#8217;dan ilgili araçları sürükleyip bırakarak  yapmalısınız. </div>
<p>Ajax takvimi hakkında daha fazla bilgiye <a target="_blank" rel="nofollow" href="http://coder.digitaldunyam.net/goto/http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/calendar/calendar.aspx"  rel="nofollow" target="_blank">buradan</a> ulaşabilirsiniz.</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/ajax-takvim-araci-kullanimi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash ta görünmez buton ile link vermek</title>
		<link>http://coder.digitaldunyam.net/flash-ta-gorunmez-buton-ile-link-vermek/</link>
		<comments>http://coder.digitaldunyam.net/flash-ta-gorunmez-buton-ile-link-vermek/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 22:29:06 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[Diğer]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[action script bağlantı verme]]></category>
		<category><![CDATA[flash dosyasına link özelliği]]></category>
		<category><![CDATA[flash link vermek]]></category>
		<category><![CDATA[görünmez buton yapmak]]></category>
		<category><![CDATA[swf link ekleme]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=522</guid>
		<description><![CDATA[Flash dünyasının en basit konusu ile merhaba. Her ne kadar flashın son dakikalarını yaşasak da hala kullanılan teknoloji. Bazen can kurtarıcımız olabilmekte. Mesela bir slider yaptığımızda bir kaç yerden .js css gibi dosyalarını da kaynaklanmamız gerekiyor. Ancak flash ile bu sorunu bir swf dosyası ve html sayesinde çöze bilmekteyiz. Lafı fazla uzatmayıp sadede geçeceğim. Action [...]]]></description>
			<content:encoded><![CDATA[<p>Flash dünyasının en basit konusu ile merhaba. Her ne kadar flashın son dakikalarını yaşasak da hala kullanılan teknoloji. Bazen can kurtarıcımız olabilmekte. Mesela bir slider yaptığımızda bir kaç yerden .js css gibi dosyalarını da kaynaklanmamız gerekiyor. Ancak flash ile bu sorunu bir swf dosyası ve html sayesinde çöze bilmekteyiz. Lafı fazla uzatmayıp sadede geçeceğim.</p>
<p><strong>Action Script 2.0</strong> ile .swf uzantılı flash dosyamıza görünmez buton ile bağlantı yani link verebiliriz. Bol resimli anlattığım bu basit işlemi uygulaya bilirsiniz.</p>
<p><img src="http://coder.digitaldunyam.net/wp-content/uploads/2011/10/flash-link-verme.jpg" alt="" title="flash-link-verme" width="439" height="423" class="aligncenter size-full wp-image-524" /></p>
<p>İlk olarak <strong>Ctrl+F8</strong> ile bir buton oluşturun. Gelen sahnede Timeline alanındaki buton laye&#8217;inin <strong>Hit</strong> alanına resimdeki gibi sağ tuş ile <strong>Inster Blank Keyframe </strong> deyip alana kullandığınız flash alanından daha büyük toolbar&#8217;dan seçtiğiniz bir dikdörtgen çizin.(renk önemli değil, tahmini yaptığınız flash alanını kaplaması yeterli)</p>
<p><img src="http://coder.digitaldunyam.net/wp-content/uploads/2011/10/flash-action-script.jpg" alt="" title="flash-action-script" width="594" height="531" class="aligncenter size-full wp-image-523" /></p>
<p>Ardından sahne alanına tekrar geri dönüp, sağdaki properties alanından yaptığınız butonu en üste layer açarak sahneye sürükleyip bırakın. Transparan mavi çizdiğiniz dikdörtgeni flash alanını kaplayacak şekilde üzerine getirin. Bu görünmez şeffaf buton en üst katmanda bulunması gerekir. Çünkü bağlantı kodları bu butona yazılacak. </p>
<p>Ve son olarak en can alıcı noktası yani oluşturduğumuz butona link özelliği kazandırıyoruz. Actions- Button sekmesine tıklayıp kod kısmına ;</p>
<div class="codecolorer-container actionscript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://coder.digitaldunyam.net&quot;</span>, <span style="color: #0066CC;">target</span>=<span style="color: #ff0000;">&quot;blank&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #66cc66;">&#125;</span></div></div>
<p>Burada flash&#8217;a tıklanıldığı zaman ilgili web sitesine ayrı sayfada gitmekte. Virgül ile target blank ifadesini silerek kendi sayfasında açabilirsiniz. </p>
<p>Olay bu kadar publish yapıp web sitenizde denemeniz dileği ile&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/flash-ta-gorunmez-buton-ile-link-vermek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tabloda toplam fiyat hesaplama</title>
		<link>http://coder.digitaldunyam.net/tabloda-toplam-fiyat-hesaplama/</link>
		<comments>http://coder.digitaldunyam.net/tabloda-toplam-fiyat-hesaplama/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 17:18:21 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[Declare]]></category>
		<category><![CDATA[Sql]]></category>
		<category><![CDATA[değişken atama]]></category>
		<category><![CDATA[kolon toplama]]></category>
		<category><![CDATA[sql tablo hesaplama]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=519</guid>
		<description><![CDATA[Basit ama hatırlama amacıyla değinmek istediğim bir konu ile merhaba. Konuyu en basitinden örnekle açıklayıp kısa yoldan bitirmek istiyorum. Adisyon hesabı olan kafenin veritabanın da toplam gelir veya topla gider hesaplamasını isteyebiliriz. Bunu yapabilmek için, işlemin en küçük yapısını oluşturan DB(veritabanı) de kaydedilmiş olan ürün tablosundaki fiyat kolonunun toplam fiyatını hesaplamak için; declare @sonuc money [...]]]></description>
			<content:encoded><![CDATA[<p>Basit ama hatırlama amacıyla değinmek istediğim bir konu ile merhaba. Konuyu en basitinden örnekle açıklayıp kısa yoldan bitirmek istiyorum. Adisyon hesabı olan kafenin veritabanın da toplam gelir veya topla gider hesaplamasını isteyebiliriz. Bunu yapabilmek için, işlemin en küçük yapısını oluşturan DB(veritabanı) de kaydedilmiş olan ürün tablosundaki fiyat kolonunun toplam fiyatını hesaplamak için;</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">declare @sonuc money<br />
<span style="color: #993333; font-weight: bold;">SELECT</span> @sonuc<span style="color: #66cc66;">=</span>SUM<span style="color: #66cc66;">&#40;</span>fiyatkolonadi<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> urunlertablosu <br />
<span style="color: #993333; font-weight: bold;">SELECT</span> @sonuc</div></div>
<p>Bu örnek ile sql de değişken atamayıda tekrar etmiş olduk&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/tabloda-toplam-fiyat-hesaplama/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kısa yoldan toplu textbox temizleme</title>
		<link>http://coder.digitaldunyam.net/kisa-yoldan-toplu-textbox-temizleme/</link>
		<comments>http://coder.digitaldunyam.net/kisa-yoldan-toplu-textbox-temizleme/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 14:51:06 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Foreach]]></category>
		<category><![CDATA[İf]]></category>
		<category><![CDATA[foreach textbox sıfırla]]></category>
		<category><![CDATA[form içindeki tüm kontroller]]></category>
		<category><![CDATA[textbox kontrol]]></category>
		<category><![CDATA[toplu textbox temizleme]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=511</guid>
		<description><![CDATA[Bu konu hakkında birçok yazı yazılmıştır. Daha önce yazılanları unutun demeyeceğim, yedekte kalması babında kaynaklanarak yazdığım en kısa toplu textbox temizleme metodu şimdilik bu olsa gerek; Projelerimizde ki formlarda birden çok textbox kullanmışızdır. Malum işlem yapıldıktan sonra kendiliğinden temizlemediği için iş yazılımcıya düşmekte. Foreach ile yapacağımız bu işlemi resimdeki gibi form tasarlayıp buton yardımı ile [...]]]></description>
			<content:encoded><![CDATA[<p>Bu konu hakkında birçok yazı yazılmıştır. Daha önce yazılanları unutun demeyeceğim, yedekte kalması babında kaynaklanarak yazdığım en kısa toplu textbox temizleme metodu şimdilik bu olsa gerek; </p>
<p><img src="http://coder.digitaldunyam.net/wp-content/uploads/2011/09/textbox-temizleme.jpg" alt="" title="textbox-temizleme" width="230" height="177" class="aligncenter size-full wp-image-512" /></p>
<p>Projelerimizde ki formlarda birden çok textbox kullanmışızdır. Malum işlem yapıldıktan sonra kendiliğinden temizlemediği için iş yazılımcıya düşmekte. Foreach ile yapacağımız bu işlemi resimdeki gibi form tasarlayıp buton yardımı ile gerçekleştirebilirsiniz.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> button1_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>Control ktn <span style="color: #0600FF; font-weight: bold;">in</span> <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Controls</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>ktn <a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">is</span></a> TextBox<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ktn<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span><span style="color: #008000;">=</span><span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
<p>Form içindeki tüm textboxları temizleme ihtiyacı duymaya bilirsiniz. Mesela belirli textboxları temizlemek için form a panel ekleyip toplu temizlemek istediğiniz textboxları panel içine koyabilirsiniz. Bunun için yapmamız gereken this(form içindeki tüm kontrolleri kontrol etmek için kullanırız) yerine panel1 şeklinde kontrol etmek;</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>Control ktn <span style="color: #0600FF; font-weight: bold;">in</span> panel1<span style="color: #008000;">.</span><span style="color: #0000FF;">Controls</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>ktn <a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">is</span></a> TextBox<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ktn<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span><span style="color: #008000;">=</span><span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/kisa-yoldan-toplu-textbox-temizleme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asp.net Membership özellikleri</title>
		<link>http://coder.digitaldunyam.net/asp-net-membership-ozellikleri/</link>
		<comments>http://coder.digitaldunyam.net/asp-net-membership-ozellikleri/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 11:42:10 +0000</pubDate>
		<dc:creator>Murat Mustafaoğlu</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Membership]]></category>
		<category><![CDATA[asp üyelik özellikleri]]></category>
		<category><![CDATA[aynı mail hesabı]]></category>
		<category><![CDATA[connectionstringname]]></category>
		<category><![CDATA[enablepasswordretrieval]]></category>
		<category><![CDATA[machine config]]></category>
		<category><![CDATA[membership özellikleri]]></category>
		<category><![CDATA[membership providers]]></category>
		<category><![CDATA[şifre sıfırlama özelliği]]></category>
		<category><![CDATA[web config]]></category>

		<guid isPermaLink="false">http://coder.digitaldunyam.net/?p=401</guid>
		<description><![CDATA[Machine.config dosyasında bulunan daha çok üyelik için kullanılan Asp.net Membership yapısındaki özellikleri inceleyelim. Uygulamamızda Web.Config içerisinde system.web blogunun içine eklediğimiz Membership providers&#8217;ın da bulunan özellikler ve açıklaması; connectionStringName : Uygulamada kullanılan veritabanını bağlayan connectionstring isminin yeri. enablePasswordRetrieval : Unutulan şifreyi geri alma yapılsın mı. True olursa eski şifre gönderilecek, false olursa kullanıcıya yeni şifre gönderir. [...]]]></description>
			<content:encoded><![CDATA[<p>Machine.config dosyasında bulunan daha çok üyelik için kullanılan Asp.net Membership yapısındaki özellikleri inceleyelim. Uygulamamızda Web.Config içerisinde system.web blogunun içine eklediğimiz Membership providers&#8217;ın da bulunan özellikler ve açıklaması; </p>
<p><img src="http://coder.digitaldunyam.net/wp-content/uploads/2011/09/aspnet_membership.jpg" alt="" title="aspnet_membership" width="409" height="300" class="aligncenter size-full wp-image-417" /></p>
<p><strong>connectionStringName  </strong>: Uygulamada kullanılan veritabanını bağlayan connectionstring isminin yeri. </p>
<p><strong>enablePasswordRetrieval</strong> : Unutulan şifreyi geri alma yapılsın mı. True olursa eski şifre gönderilecek, false olursa kullanıcıya yeni şifre gönderir. Ayrıca<strong> passwordFormat</strong> hasked olursa burası true olamaz.</p>
<p><strong>enablePasswordReset</strong> : Şifreyi sıfırlama için kullanılır. </p>
<p><strong>enablePasswordRetrieval</strong> false ise bunun true olaması gerekir.</p>
<p><strong>requiresQuestionAndAnswer</strong> : Gizli soru; true soru olsun, false gizli soru olmasın.</p>
<p><strong>applicationName</strong> : Kullanılacak uygulamalar buraya yazılır. Şimdilik üyelik uygulamsını kullanacağımız için / işareti ile devam ediyoruz. </p>
<p><strong>requiresUniqueEmail</strong> : Aynı mail hesabı ile birden fazla üye olsun mu. True yaparsanız kullanılan mail adresiyle bir tane hesap açılır.</p>
<p><strong>passwordFormat</strong> : Üye şifrelerinin veritabanında tutacağı format yeri. Burada 3 tane şifreleme tipi bulunmakta. Bunlar Clear, yaptığımızda şifre olduğu gibi veritabanında görülür, encrypt yaptığımızda geri çevirebilir şekilde şifreyi şaklıyo, hashed ile yapılan paralo geri döndürülemez yani yazılan şifre tekrardan eski haline gelemez. </p>
<p><strong>maxInvalidPasswordAttempts </strong>: En fazla kaç kere yanlış parola girilebilir. Bu özellik sonucunda passwordAttemptWindow özelliğini çalıştırarak anlam kazanmakta. Normalde passwordAttemptWindow =10 dakika yani 5 kez yanlış parola giren üye 10 dakika login olması yasaklanacak.</p>
<p><strong>minRequiredPasswordLength</strong> : Şifrenin en az kaç karakterli olacağını belirten özellik.</p>
<p><strong>minRequiredNonalphanumericCharacters</strong> : Şifrede alfa numerik karakter olsun mu yani semboller = ? / gibi olmasını isterseniz 1(kaç tane alfa numerik karakter olmasını istiyorsanız o kadar sayı) yapmanız gerekir, istemiyorsanız değeri 0 yapmanız yeterli olacak</p>
<p><strong>passwordStrengthRegularExpression</strong> : Şifrenin güvenilirliğini buradan ayarlanmakta</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.digitaldunyam.net/asp-net-membership-ozellikleri/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

