main() { int a,b,toplam; float ort; clrscr(); printf(“1.sayıyı gir…:”); scanf(“%d”,&a); printf(“2.sayıyı gir…:”); scanf(“%d”,&b); toplam=a+b; ort=toplam/2; printf(“Ortalama= %f olarak hesaplandı.”,ort); getch(); }
System.Diagnostics.Process.Start(“buraya açılacak dosyayı yazıyoruz”);
using System.Net; using System.Net.Sockets; using System.IO; using System.Threading; /*#####################################################################*/ class IrcBot { public static string SERVER = “irc.e-kolay.net”; private static int PORT = 6667; private static string USER = “USER cSharp 8 * : bOt”; private static string NICK = “cXc”; private static string ALTNICK = “cYc”; private static string PING = “PING :”; private static string CHANNEL = “#tr-kanki”; public static StreamWriter writer; static void Main (string[] args) { NetworkStream stream; TcpClient irc; string inputLine; StreamReader reader; string nickname; try { irc = new TcpClient (SERVER, PORT); stream = irc.GetStream (); reader = new StreamReader (stream); writer = new StreamWriter (stream); PingSender ping = new PingSender (); ping.Start (); writer.WriteLine (USER); writer.Flush (); writer.WriteLine (“NICK ” + NICK); writer.Flush (); writer.WriteLine (“JOIN ” + CHANNEL); writer.Flush (); while (true) { while ( (inputLine = reader.ReadLine () ) != null ) { string str = inputLine; char[] seps = {‘ ‘}; string[] parts = str.Split(seps); string Number = parts[1]; if (inputLine.EndsWith(“Bu nick Zaten Kullanılıyor”)) { NICK = ALTNICK; writer.WriteLine(“NICK ” + NICK); } if (Number == “422″) { writer.WriteLine(“JOIN :” + CHANNEL); writer.Flush(); } if (Number == “MODE”) { if (inputLine.EndsWith(parts[2] + ” +o ” + NICK)) { nickname = inputLine.Substring(1, inputLine.IndexOf (“!”) – 1); writer.WriteLine(“PRIVMSG ” + parts[2] + ” :” + nickname + ” Op icin tesekkurler ?”); } } if (Number == “KICK”) { if (parts[3] == NICK) { nickname = inputLine.Substring(1, inputLine.IndexOf (“!”) – 1); writer.WriteLine (“JOIN ” + parts[2]); } } if (inputLine.EndsWith (“JOIN :” + CHANNEL) ) { nickname = inputLine.Substring(1, inputLine.IndexOf (“!”) – 1); writer.WriteLine (“NOTICE ” + nickname + ” :seLam ” + nickname + ” Kanalımıza Hoşgeldin “); Thread.Sleep (100); } if (parts[0] == “PING”) { writer.WriteLine (PING + IrcBot.SERVER); } } writer.Close (); reader.Close (); irc.Close (); } } catch (Exception e) { Console.WriteLine (e.ToString () ); Thread.Sleep (500); string[] argv = { }; Main (argv); } } } class PingSender { static string PING = “PING :”; private Thread pingSender; public PingSender () { pingSender = new Thread (new ThreadStart (this.Run) ); } public void Start () { pingSender.Start (); } public void Run () { while (true) { IrcBot.writer.WriteLine (PING + IrcBot.SERVER); IrcBot.writer.Flush (); Thread.Sleep (5000); } } }
strConn=”Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Program Files\\BilgiEdinme\\data\\Kayit.mdb”; OleDbConnection myConn = new OleDbConnection(strConn); myConn.Open(); bool ycev = false, mcev = false, gizli = false, kabul = false; if(rb1a.Checked) ycev = true; if(rb2a.Checked) mcev = true; if(rb3a.Checked) gizli = true; if(rb4a.Checked) kabul = true; OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(); strSql = “select * from basvuru”; OleDbCommand cmd=new OleDbCommand(strSql, myConn); myDataAdapter.SelectCommand = cmd; DataTable tbl = new DataTable(); myDataAdapter.Fill(tbl); DataRow row; row = tbl.NewRow(); row["b_sekli"] = cb1.Text; row["b_soy_unvan"] = tb1.Text; row["b_adi"] = tb2.Text; row["b_tcno"] = tb3.Text; row["hav_birim"] = cb2.Text; row["hav_tarih"] = dtp1.Value; row["ycev_tarih"] = dtp2.Value; row["ycev_durum"] = ycev; row["mcev_tarih"] = dtp3.Value; row["mcev_durum"] = mcev; row["bvr_gizli"] = gizli; row["bvr_kabul"] = kabul; row["aciklama"] = rtb1.Text; tbl.Rows.Add(row); OleDbCommandBuilder cb = new OleDbCommandBuilder(); cb.DataAdapter = myDataAdapter; myDataAdapter.Update(tbl);
using System; using System.Web.Mail; void _SendEMail() { try { MailMessage e_Mail = new MailMessage(); e_Mail.From = “xxx@xxx.xx”; e_Mail.To = “xxx@xxx.xx”; e_Mail.Subject = “C# SMTP Mail”; //mail server veya kendi local makinanizdaki domain. SmtpMail.SmtpServer = “mail.server”; e_Mail.Body = “C# .NET de SMTP Mail gonderme”; SmtpMail.Send(e_Mail); MessageBox.Show(“Your Message Successful Sent. “,MessageBoxButtons.OK, MessageBoxIcon.Information); } catch(Exception ex) { MessageBox.Show(“Error: ” + ex.Message.ToString(),”eMail”,MessageBoxButtons.OK,MessageBoxIcon.Error); } }
#include <stdio.h> int main() { int sayi1, sayi2, i; printf (” Write two numbers : “); scanf (“%d%d”, &sayi1, &sayi2); // iki sayının OKEK değeri en fazla iki sayının çarpımı olabilir. // (iki sayı aralarında asalsa bu durum gerçekleşir.) Bu yüzden // döngünün (sayi1 * sayi2)’ye kadar dönmesi yeterlidir. for (i = 1; i <= sayi1 * sayi2; i ++) { if (i % sayi1 == 0 && i % sayi2 == 0) { // OKEK değeri her iki sayıya da tam olarak bölünür. // Bu durumun görüldüğü andaki i değeri iki sayının // ortak katlarının alabildiği en küçük değerdir. printf (” OKEK : %d\n”, i); break; } } // OBEB değeri, en fazla sayılardan büyük olanın değeri kadar // olabilir. (diğer sayının değeri bir ise.) Bu nedenle // döngünün başlangıç değeri olarak sayılardan büyük olanını // almak yeterli olacaktır. (sayi1 > sayi2) ? i = sayi1 : i = sayi2; for (; i > 0; i –) { if (sayi1 % i == 0 && sayi2 % i == 0) { // OBEB değeri her iki sayıya da tam olarak bölünebilir. // Bu durumun görüldüğü andaki i değeri iki sayıyı tam // olarak bölebilecek en büyük tam sayıdır. printf (” OBEB : %d\n”, i); break; } } return 0; } /************************************************************************ OUTPUT: —— Write two numbers: 42 28 OKEK : 84 OBEB : 14 ************************************************************************/
string bag=@”Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data.mdb”;//data.mdb exe nin yanında ise bu yol geçerlidir farklı yerde ise tam yolunun girilmesi gerekir private void button1_Click(object sender, System.EventArgs e) { string sql1=”Insert into TabloAd (ilkAlan,ikinciAlan) values(‘”+ textBox1.Text+ “‘,’”+textBox2.Text+”‘)”; OleDbDataAdapter adapter=new OleDbDataAdapter(sql1,bag); dt=new DataTable(“kisi”); adapter.Fill(dt); dataGrid1.DataSource=dt; textBox1.Text=”"; textBox2.Text=”"; } /* azer_kanturali1972@yahoo.com */
#include <stdio.h> #include <string.h> main() { char isim[50]; int i; int k; char kr; printf(“Kaydrmak istedi§iniz yazy giriniz: “); scanf(“%s”,isim); k = strlen(isim); do { for (i=1;i<80-k;i++) { delay(10000); clrscr(); gotoxy(i,1); printf(“%s”,&isim); } for (i=1;i<80-k;i++) { delay(10000); clrscr(); gotoxy(80-i-k,1); printf(“%s”,&isim); } } while (!kbhit()); getch(); }
using System; using System.Windows.Forms; using System.Drawing; class MyForm : Form { MyForm () { Text = “Clock”; SetStyle (ControlStyles.ResizeRedraw, true); } protected override void OnPaint (PaintEventArgs e) { SolidBrush red = new SolidBrush (Color.Red); SolidBrush white = new SolidBrush (Color.White); SolidBrush blue = new SolidBrush (Color.Blue); // Initialize the transformation matrix InitializeTransform (e.Graphics); // Draw squares denoting hours on the clock face for (int i=0; i<12; i++) { e.Graphics.RotateTransform (30.0f); e.Graphics.FillRectangle (white, 85, -5, 10, 10); } // Get the current time DateTime now = DateTime.Now; int minute = now.Minute; int hour = now.Hour % 12; // Reinitialize the transformation matrix InitializeTransform (e.Graphics); // Draw the hour hand e.Graphics.RotateTransform ((hour * 30) + (minute / 2)); DrawHand (e.Graphics, blue, 40); // Reinitialize the transformation matrix InitializeTransform (e.Graphics); // Draw the minute hand e.Graphics.RotateTransform (minute * 6); DrawHand (e.Graphics, red, 80); // Dispose of the brushes red.Dispose (); white.Dispose (); blue.Dispose (); } void DrawHand (Graphics g, Brush brush, int length) { // Draw a hand that points straight up, and let // RotateTransform put it in the proper orientation Point[] points = new Point[4]; points[0].X = 0; points[0].Y = -length; points[1].X = -12; points[1].Y = 0; points[2].X = 0; points[2].Y = 12; points[3].X = 12; points[3].Y = 0; g.FillPolygon (brush, points); } void InitializeTransform (Graphics g) { // Apply transforms that move the origin to the center // of the form and scale all output to fit the form’s width // or height g.ResetTransform (); g.TranslateTransform (ClientSize.Width / 2, ClientSize.Height / 2); float scale = System.Math.Min (ClientSize.Width, ClientSize.Height) / 200.0f; g.ScaleTransform (scale, scale); } static void Main () { Application.Run (new MyForm ()); } }
//Kodların tamamı şu şekilde.. //Coded by -cod3mast3r- using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using WMPLauncher; using WMPLib; namespace WindowsApplication1 { /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Button button1; private System.Windows.Forms.MainMenu mainMenu1; private System.Windows.Forms.MenuItem menuItem1; private System.Windows.Forms.MenuItem menuItem2; private System.Windows.Forms.MenuItem menuItem3; private System.Windows.Forms.MenuItem menuItem4; private System.Windows.Forms.MenuItem menuItem5; private System.Windows.Forms.MenuItem menuItem6; private System.Windows.Forms.MenuItem menuItem7; /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support – do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); this.button1 = new System.Windows.Forms.Button(); this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.menuItem4 = new System.Windows.Forms.MenuItem(); this.menuItem5 = new System.Windows.Forms.MenuItem(); this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuItem7 = new System.Windows.Forms.MenuItem(); this.SuspendLayout(); // // button1 // this.button1.Font = new System.Drawing.Font(“Microsoft Sans Serif”, 13F, ((System.Drawing.FontStyle)((System.Drawing.FontSt yle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(162))); this.button1.ForeColor = System.Drawing.Color.Brown; this.button1.Image = ((System.Drawing.Image)(resources.GetObject(“button1.Image”))); this.button1.Location = new System.Drawing.Point(72, 40); this.button1.Name = “button1″; this.button1.Size = new System.Drawing.Size(160, 160); this.button1.TabIndex = 0; this.button1.Text = “Ayyüzlüm.mp3″; this.button1.Click += new System.EventHandler(this.button1_Click); // // mainMenu1 // this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem1, this.menuItem6, this.menuItem7}); // // menuItem1 // this.menuItem1.Index = 0; this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem2, this.menuItem3, this.menuItem4, this.menuItem5}); this.menuItem1.Text = “Muzikler”; // // menuItem2 // this.menuItem2.Index = 0; this.menuItem2.Text = “ayyüzlüm”; // // menuItem3 // this.menuItem3.Index = 1; this.menuItem3.Text = “bla bla”; // // menuItem4 // this.menuItem4.Index = 2; this.menuItem4.Text = “ceza”; // // menuItem5 // this.menuItem5.Index = 3; this.menuItem5.Text = “manga”; // // menuItem6 // this.menuItem6.Index = 1; this.menuItem6.Text = “ÇIK”; // // menuItem7 // this.menuItem7.Index = 2; this.menuItem7.Text = “Yardım”; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(292, 266); this.Controls.Add(this.button1); this.Menu = this.mainMenu1; this.Name = “Form1″; this.Text = “MP3″; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private void button1_Click(object sender, System.EventArgs e) { System.Diagnostics.Process Proc = new System.Diagnostics.Process(); Proc.StartInfo.FileName = “wmplayer.exe”; Proc.StartInfo.CreateNoWindow = true; Proc.StartInfo.Arguments = “/hide d:\\muzik\\01-ayyüzlüm.mp3″; //siz bunu kendi diskinizdeki mp3 yerel adresiyle değiştireceksiniz. Proc.Start(); } private void Form1_Load(object sender, System.EventArgs e) { } } }