Friday, 16 May 2014

css contoh layout

 dalam tutorial ini saya akan memberikan source code membuat layout simple dengan Css dan kalian dapat  memodifikasinya :
<html>
<head>
<title> membuat layout web dengan css </title>
<style>
#head-container
{
color: #000;
background: #8EB3DB;
}
#header
{
margin: 0 auto;
width: 860px;
padding: 20px;
background: #DAE6F3;
}
#header h1 { margin: 0; }
#navigation-container
{
float: left;
width: 100%;
color: #000;
background: #369FE0;
}
#navigation
{
margin: 0 auto;
width: 900px;
}
#navigation ul
{
margin: 0;
padding: 0;
}
#navigation ul li
{
list-style-type: none;
display: inline;
}
#navigation li a
{
display: block;
float: left;
padding: 5px 10px;
color: #fff;
text-decoration: none;
border-right: 1px solid #fff;
}
#navigation li a:hover { background: #257BB4; }
#content-container
{
float: left;
width: 100%;
color: #000;
background: #F7F9FC;
}
#content-container2
{
margin: 0 auto;
width: 900px;
}
#content-container3
{
float: left;
width: 900px;
background: #FFF url(two-fixed-background.gif) repeat-y 100% 0;
}
#content
{
clear: left;
float: left;
width: 560px;
padding: 20px 0;
margin: 0 0 0 30px;
display: inline;
}
#content h2 { margin: 0; }
#right
{
float: right;
width: 240px;
padding: 20px 0;
margin: 0 20px 0 0;
display: inline;
}
#right h3 { margin: 0; }
#footer-container
{
clear: left;
color: #fff;
background: #3399ff;
}
#footer
{
margin: 0 auto;
width: 900px;
text-align: right;
padding: 20px;
height: 1%;
}
</style>
</head>
<body>
<div id=”head-container”>
<div id=”header”>
<h1>
</h1>
</div>
</div>
<div id=”navigation-container”>
<div id=”navigation”>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About</a></li>
<li><a href=”#”>Services</a></li>
<li><a href=”#”>Contact us</a></li>
</ul>
</div>
</div>
<div id=”content-container”>
<div id=”content-container2″>
<div id=”content-container3″>
<div id=”content”>
<h2>
This is Page heading
</h2>
<p>
This is paragraph 1
</p>
<p>
This is paragraph 2
</p>
<p>
This is paragraph 3
</p>
</div>
<div id=”right”>
<h3>
Right heading
</h3>
<p>
This is paragraph 1
</p>
</div>
</div>
</div>
<div id=”footer-container”>
<div id=”footer”>
Copyright © nama web kamu, 2010
</div>
</div>
</div>
</body>
</html>





css contoh layout

 dalam tutorial ini saya akan memberikan source code membuat layout simple dengan Css dan kalian dapat  memodifikasinya :
<html>
<head>
<title> membuat layout web dengan css </title>
<style>
#head-container
{
color: #000;
background: #8EB3DB;
}
#header
{
margin: 0 auto;
width: 860px;
padding: 20px;
background: #DAE6F3;
}
#header h1 { margin: 0; }
#navigation-container
{
float: left;
width: 100%;
color: #000;
background: #369FE0;
}
#navigation
{
margin: 0 auto;
width: 900px;
}
#navigation ul
{
margin: 0;
padding: 0;
}
#navigation ul li
{
list-style-type: none;
display: inline;
}
#navigation li a
{
display: block;
float: left;
padding: 5px 10px;
color: #fff;
text-decoration: none;
border-right: 1px solid #fff;
}
#navigation li a:hover { background: #257BB4; }
#content-container
{
float: left;
width: 100%;
color: #000;
background: #F7F9FC;
}
#content-container2
{
margin: 0 auto;
width: 900px;
}
#content-container3
{
float: left;
width: 900px;
background: #FFF url(two-fixed-background.gif) repeat-y 100% 0;
}
#content
{
clear: left;
float: left;
width: 560px;
padding: 20px 0;
margin: 0 0 0 30px;
display: inline;
}
#content h2 { margin: 0; }
#right
{
float: right;
width: 240px;
padding: 20px 0;
margin: 0 20px 0 0;
display: inline;
}
#right h3 { margin: 0; }
#footer-container
{
clear: left;
color: #fff;
background: #3399ff;
}
#footer
{
margin: 0 auto;
width: 900px;
text-align: right;
padding: 20px;
height: 1%;
}
</style>
</head>
<body>
<div id=”head-container”>
<div id=”header”>
<h1>
</h1>
</div>
</div>
<div id=”navigation-container”>
<div id=”navigation”>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About</a></li>
<li><a href=”#”>Services</a></li>
<li><a href=”#”>Contact us</a></li>
</ul>
</div>
</div>
<div id=”content-container”>
<div id=”content-container2″>
<div id=”content-container3″>
<div id=”content”>
<h2>
This is Page heading
</h2>
<p>
This is paragraph 1
</p>
<p>
This is paragraph 2
</p>
<p>
This is paragraph 3
</p>
</div>
<div id=”right”>
<h3>
Right heading
</h3>
<p>
This is paragraph 1
</p>
</div>
</div>
</div>
<div id=”footer-container”>
<div id=”footer”>
Copyright © nama web kamu, 2010
</div>
</div>
</div>
</body>
</html>





Thursday, 15 May 2014

mengirim email lewat program C# visual studio

Cara Mengirim Email Melalui C#

19
JAN
Pada Sore kali ini penulis ingin memposting apa yang baru saja penulis pelajari , tujuan utamanya adalah agar tidak lupa selain itu juga agar bisa saling share ilmu pengetahuan,, yuk langsung saja ikutin langkahnya :

berikut adalah source codenya :

using System;

using System.Windows.Forms;

using System.Net.Mail;



namespace WindowsApplication1

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}



private void buttonkirim_Click(object sender, EventArgs e)

{

try

{

MailMessage mail = new MailMessage();

SmtpClient Smtp = new SmtpClient(“smtp.gmail.com”);



mail.From = new MailAddress(“emailkamu@gmail.com”);

mail.To.Add(“to_address”);

mail.Subject = “Test Mail”;

mail.Body = “testing SMTP mail from GMAIL”;



Smtp.Port = 587;

Smtp.Credentials = new System.Net.NetworkCredential(“username”, “password”);

Smtp.EnableSsl = true;



Smtp.Send(mail);

MessageBox.Show(“mail Send”);

}

catch (Exception ex)

{

MessageBox.Show(ex.ToString());

}

}

}

}



Aplikasi Client Server (Chating Sederhana Dengan C#)

02
JAN
Hello sahabat WordPress/bloger pada malam kali ini ane ingin membagikan mengenai judul di atas yang sudah ane remodife dari berbagai sumber dari google yang  sudah ane pelajari sebelum pada akhirnya ane mempunyai keinginan untuk mengshare lagi  apa yang sudah ane pelajari….ok langsung saja silakan cek codingnya..:

1) Coding untuk server  :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.IO;

namespace serverconsole
{
class Program
{
static void Main(string[] args)
{
StreamReader read;
StreamWriter write;
NetworkStream net;
TcpListener baca = new TcpListener(5);
baca.Start();
Console.WriteLine(“server start “);
Socket serversocket = baca.AcceptSocket();

try
{
if (serversocket.Connected)
{
while (true)
{
net = new NetworkStream(serversocket);
read = new StreamReader(net);
write = new StreamWriter(net);
Console.WriteLine(read.ReadLine());
write.WriteLine(“message from server”);
write.Flush();
}
}
if (serversocket.Connected)
{
serversocket.Close();
Console.Read();
}

}
catch(SocketException ex)
{
Console.WriteLine(ex);
}
}
}
}

2) Coding Client (Jangan Lupa Bikin Projek Baru YAhhh)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.IO;

namespace clientconsole
{
class Program
{
static void Main(string[] args)
{
NetworkStream net;
StreamReader read;
StreamWriter write;
TcpClient client;
try
{
client = new TcpClient(“localhost”, 5);
net = client.GetStream();
read = new StreamReader(net);
write = new StreamWriter(net);
write.WriteLine(“Message from the Client…”);
write.Flush();
Console.WriteLine(read.ReadLine());

}
catch(SocketException ex)
{
Console.WriteLine(ex);
}
Console.Read();
}
}
}

c++ program kasir

#include "stdio.h"
#include "stdlib.h"
#include "conio.h"

main()
{
int jml_uang, a, b, c, d, e, f, g, h, s_a, s_b, s_c, s_d, s_e, s_f, s_g;
printf (" Jumlah Uang : Rp."); scanf ("%d", &jml_uang);
printf ("\n ---------Hasil--------- ");
a = jml_uang / 50000;
s_a = jml_uang % 50000;
b = s_a / 20000;
s_b = s_a % 20000;
c = s_b/10000;
s_c = s_b%10000;
d=s_c/5000;
s_d=s_c%5000;
e=s_d/2000;
s_e=s_d%2000;
f=s_e/1000;
s_f=s_e%1000;
g=s_f/500;
s_g=s_f%500;
h=s_g/100;
printf (" \n Rp. 50.000 = %d Lembar ", a);
printf (" \n Rp. 20.000 = %d Lembar ", b);
printf (" \n Rp. 10.000 = %d Lembar ", c);
printf (" \n Rp. 5.000  = %d Lembar ", d);
printf (" \n Rp. 2.000  = %d Lembar ", e);
printf (" \n Rp. 1.000  = %d Lembar ", f);
printf (" \n Rp. 500    = %d Koin ", g);
printf (" \n Rp. 100    = %d Koin ", h);
getch ();
return 0;
}