(<> / "" %)
gibi işaretleri blogger içine yazabilmek için bir adres...http://formatmysourcecode.blogspot.com/
(<> / "" %)
gibi işaretleri blogger içine yazabilmek için bir adres...
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string sMetin="Herhangi bir metinde geçen kelimenin kaçıncı karakter olduğunu bulma.";
int i = sMetin.IndexOf("kaçıncı"); //metnin kaçıncı karakter olduğunu sorgular
%>
<%=i %>
</body>
</html>
-----------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string sMetin = "elimde bulunan bir metinin üzerine";
string sMetin2 = ", dışarıdan aldığım yeni metni ekleme.";
sMetin = sMetin.Insert(sMetin.Length, sMetin2); // smetin sayarak ve onun uzunluğundan sonra smetin2 yi ekler
%>
<%=sMetin %>
</body>
</html>
--------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string sMetin = "bir sabah, alıp seni benden gitti bu diyardan";
sMetin += ", hazin bir mektup, bir-yadiğar kalan";
sMetin = sMetin.Remove(45, 37);//metindeki karakterleri istenen karakterden itibaren istenilen kadar silme işlemi yapar.
%>
<%=sMetin %>
</body>
</html>
--------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string sMetin = " bir sabah, alıp seni benden gitti bu diyardan#";
sMetin = sMetin.Trim();
Response.Write("Boşluklar temizlendi : " + sMetin + "<br>");
sMetin = sMetin.Trim('#');
Response.Write("Belirlenen karakterler temizlendi : " + sMetin + "<br>");
%>
</body>
</html>
-----------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
int i;
for(i=1; i<=100; i++)
{
Response.Write("Ray ETKİN" +"<br>");
}
%>
</body>
</html>
------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
string isim = "RAY ETKİN";
for (int i = 0; i < isim.Length+1 ; i++)
{
Response.Write(isim.Substring(0, i) + "<br>");
}
for (int i = 0; i < isim.Length ; i++)
{
Response.Write(isim.Substring(i, 1) + "<br>");
}
// for (int i = isim.Length ; i >0; i--)
//{
// Response.Write(isim.Substring(i, 1) + "<br>");
//}
%>
</body>
</html>
----------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<%
int i = 0;
while (i < 100)
{
Response.Write("ray etkin"+ "<br>");
i++;
}
%>
</body>
</html>
<?
$sayfa = $_GET["sayfa"];
mysql_Connect("localhost","root","") or die(mysql_error);
mysql_select_db("sayfalama") or die(mysql_error);
function sayfalama($liste_sayisi)
{
global $sayfa_sayisi, $sayfa;
if(!is_numeric($sayfa))
{
$sayfa=1;
}
$kayit_sayisi = mysql_num_rows(mysql_query("SELECT * FROM sayfalar"));
$sayfa_sayisi = ceil($kayit_sayisi/$liste_sayisi);
$baslangic = ($sayfa-1)*$liste_sayisi;
$kayit = mysql_query("SELECT * FROM sayfalar LIMIT $baslangic, $liste_sayisi") or die(mysql_error);
$x=0;
$sayfa = Array();
while($kayitlar = mysql_fetch_array($kayit))
{
$sayfa[$x]["as_id"] = $kayitlar["as_id"];
$sayfa[$x]["as_adi"] = $kayitlar["as_adi"];
$sayfa[$x]["as_numarasi"] = $kayitlar["as_numarasi"];
$x++;
}
return $sayfa;
}
?>
<table width="400" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>ID </td>
<td>Ad</td>
<td>No</td>
</tr>
<?
$asi = sayfalama(3);
foreach($asi as $id => $urun)
{?>
<tr>
<td><?=$urun["as_id"]?></td>
<td><?=$urun["as_adi"]?></td>
<td><?=$urun["as_numarasi"]?></td>
</tr>
<? }?>
<tr>
<td colspan="4"> <div align="right">
<? for($x=1;$x<=$sayfa_sayisi;$x++){?>
<a href="index.php?sayfa=<?=$x?>">
<? if($_GET["sayfa"]==$x){?> <span style="text-decoration: none">
<? }?>
<?=$x?><? } ?>
</div></td>
</tr>
</table>
-- phpMyAdmin SQL Dump
-- version 2.11.1
-- http://www.phpmyadmin.net
--
-- Anamakine: localhost
-- Üretim Zamanı: 21 Ocak 2009 saat 00:35:32
-- Sunucu sürümü: 5.0.45
-- PHP Sürümü: 5.2.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Veritabanı: `sayfalama`
--
-- --------------------------------------------------------
--
-- Tablo yapısı: `sayfalar`
--
CREATE TABLE `sayfalar` (
`as_id` int(11) NOT NULL auto_increment,
`as_adi` varchar(50) collate latin1_general_ci NOT NULL,
`as_numarasi` varchar(20) collate latin1_general_ci NOT NULL,
PRIMARY KEY (`as_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=21 ;
--
-- Tablo döküm verisi `sayfalar`
--
INSERT INTO `sayfalar` (`as_id`, `as_adi`, `as_numarasi`) VALUES
(1, 'hamdi aslan', '10001'),
(2, 'Mustafa Ta?k?n', '10002'),
(3, 'Fehmi Aslan', '12654'),
(4, 'Hasan Ak?ls?z', '549113'),
(5, 'Ferdi ?endi', '546253'),
(6, 'Dilaver Dallamaz', '654376'),
(7, 'Laik Kalkan', '675734'),
(8, 'ahsan kal?p', '54267457'),
(9, 'Alkin Dalkin', '4536727'),
(10, 'Markin Farkin', '6543756'),
(11, 'Sayfa Kayfa', '54673657'),
(12, 'Marja Tarja', '5643756'),
(13, 'Laffa Kaffa', '6452567'),
(14, '?amil Amil', '64532645'),
(15, 'Hakan Al?n', '43611'),
(16, 'Kaan Kal?n', '543256'),
(17, 'Volkan A?s?z', '4326546'),
(18, 'Ça?r? Dangal', '54326'),
(19, 'Janan Markin', '4532645');