30 Eylül 2009 Çarşamba

CBS bilgisin elde etme

Problem

How to capture the Cell Info, which is displayed on the home screen of most of the GSM phones, if you set the Cell Info Display: ON in your phone settings. Cell info provides some (area)location related text info about the cell tower our device is present at the moment, along with some service providers advertisements. We don't have direct API in Java ME to capture this Cell Info from our application.
Solution

This Cell info is broadcasted as CBS (Cell Broadcast Service) message by the cell towers and received by all the GSM phones connected to this tower on certain predefined Channel (generally 050) by most of the service providers. Thus our Java ME application can listen to this CBS Channel using Push Registry and capture this information
Sample Code
Imports

import javax.wireless.messaging.*;
import javax.microedition.io.PushRegistry;

setupListening

Register your Midlet for Listening to CBS port 50 and setup a Message Listener

public void setupListening()
{
try{
PushRegistry.registerConnection("cbs://:50",this.getClass().getName(),"*");
}catch(Exception e){}
String[] connList;
connList = PushRegistry.listConnections(true);
if((connList == null) || (connList.length == 0))
{
// You can exit the app, if you want
}
else
{
try{
msgconn = (MessageConnection)Connector.open("cbs://:50");
msgconn.setMessageListener(this);
} catch( IOException e){ e.printStackTrace();}
}
}

notifyIncomingMessage

To Retrieve the CBS message payload.

public void notifyIncomingMessage(MessageConnection conn)
{
try{
txtmsg =(TextMessage)msgconn.receive();
}catch(Exception e){System.out.println(e);}
from = txtmsg.getAddress());
Msg = txtmsg.getPayloadText();
// Display from & Msg
}

Note

WMA 120/205 does not support CBS on most of the Nokia S40 devices, it works on Nokia S60 and other devices.

--Submitted by Amitabh Srivastava at 16:10(IST), 27 August 2009.

28 Eylül 2009 Pazartesi

Blackberry Applications

Web servis:

http://craigagreen.com/index.php?/Blog/blackberry-and-net-web-service-tutorial-part-2.html

GPS:

http://www.riccomini.name/Topics/Mobile/BlackBerry/BlackBerryGPS/

Sample Codes:

http://www.blackberry.com/knowledgecenterpublic/livelink.exe?func=ll&objId=800332&objAction=browse&sort=name

23 Eylül 2009 Çarşamba

hacking

http://www.cmswire.com/cms/web-cms/how-they-hack-your-website-overview-of-common-techniques-002339.php


Copy and paste these into Google:

inurl:passlist.txt
inurl:passwd.txt
…and this one is just priceless…
“login: *” “password= *” filetype:xls

//---------------------------------------------------------

bu sihirli kodları googleda bir aratın ve neler varmış bir görün.hackın en basit yolu budur.
intitle: private, protected, secret, secure, winnt
intitle:"DocuShare" inurl:"docushare/dsweb/" -faq -gov -edu
"#mysql dump" filetype:sql
"#mysql dump" filetype:sql faaaaeafc
"allow_call_time_pass_reference" "PATH_INFO"
"Certificate Practice Statement" inurlPDF | DOC)

LeapFTP intitle:"index.of./" sites.ini modified
master.passwd
mysql history files
NickServ registration passwords
passlist
passlist.txt (a better way)
passwd
passwd / etc (reliable)
people.lst
psyBNC config files
pwd.db
signin filetype:url
spwd.db / passwd
trillian.ini
wwwboard WebAdmin inurlasswd.txt wwwboard|webadmin

"# -FrontPage-" extwd inurlservice | authors | administrators | users) "# -FrontPage-"
inurl:service.pwd
"AutoCreate=TRUE password=*"
"http://*:*@www" domainname
"index of/" "ws_ftp.ini" "parent directory"
"liveice configuration file" ext:cfg -site:sourceforge.net
"powered by ducalendar" -site:duware.com
"Powered by Duclassified" -site:duware.com
"Powered by Duclassified" -site:duware.com "DUware All Rights reserved"
"powered by duclassmate" -site:duware.com
"Powered by Dudirectory" -site:duware.com
"powered by dudownload" -site:duware.com
"Powered By Elite Forum Version *.*"
"Powered by Link Department"
"sets mode: +k"
"Powered by DUpaypal" -site:duware.com
allinurl: admin mdb
auth_user_file.txt
config.php
eggdrop filetype:user user
etc (index.of)
ext:ini eudora.ini
ext:ini Version=... password
ext:txt inurl:unattend.txt
filetype:bak inurl:"htaccess|passwd|shadow|htusers"
filetype:cfg mrtg "target " -sample -cvs -example
filetype:cfm "cfapplication name" password
filetypef oekakibbs
filetypef sc_serv.conf
filetypef slapd.conf
filetypefig config intext:appSettings "User ID"
filetype:dat "password.dat"
filetype:dat wand.dat
filetype:inc dbconn
filetype:inc intext:mysql_connect
filetype:inc mysql_connect OR mysql_pconnect
filetype:inf sysprep
filetype:ini inurl:"serv-u.ini"
filetype:ini inurl:flashFXP.ini
filetype:ini ServUDaemon
filetype:ini wcx_ftp
filetype:ini ws_ftp pwd
filetype:ldb admin
filetype:log "See `ipsec copyright"
filetype:log inurl:"password.log"
filetype:mdb inurl:users.mdb
filetype:mdb wwforum
filetype:netrc password
filetypeass pass intext:userid
filetypeem intextrivate
filetyperoperties inurl:db intextassword
filetypewd service
filetypewl pwl
filetype:reg reg +intext:"defaultusername" +intext:"defaultpassword"
filetype:reg reg HKEY_CURRENT_USER SSHHOSTKEYS
filetype:sql ("values * MD" | "values * password" | "values * encrypt")
filetype:sql ("passwd values" | "password values" | "pass values" )
filetype:sql +"IDENTIFIED BY" -cvs
filetype:sql password
filetype:url +inurl:"ftp://" +inurl:";@"
filetype:xls username password email
htpasswd
htpasswd / htgroup
htpasswd / htpasswd.bak
intext:"enable secret $"
intext:"powered by Web Wiz Journal"
intitle:"index of" intextnect.inc
intitle:"index of" intext:globals.inc
intitle:"Index of" passwords modified
intitle:dupics inurladd.asp | default.asp | view.asp | voting.asp) -site:duware.com
intitle:index.of administrators.pwd
intitle:Index.of etc shadow
intitle:index.of intext:"secring.skr"|"secring.pgp"|"secring.bak"
inurl:"GRC.DAT" intext:"password"
inurl:"slapd.conf" intext:"credentials" -manpage -"Manual Page" -man: -sample
inurl:"slapd.conf" intext:"rootpw" -manpage -"Manual Page" -man: -sample
inurl:"wvdial.conf" intext:"password"
inurl:/db/main.mdb
inurl:/wwwboard
inurl:ccbill filetype:log
inurl:chap-secrets -cvs
inurlfig.php dbuname dbpass
inurl:filezilla.xml -cvs
inurl:lilo.conf filetypef password -tatercounter -bootpwd -man
inurl:nuke filetype:sql
inurl:ospfd.conf intextassword -sample -test -tutorial -download
inurlap-secrets -cvs
inurlerform filetype:ini
inurl:secring ext:skr | extgp | ext:bak
inurl:vtund.conf intextass -cvs
inurl:zebra.conf intextassword -sample -test -tutorial -download

"Generated by phpSystem"
"generated by wwwstat"
"Host Vulnerability Summary Report"
"HTTP_FROM=googlebot" googlebot.com "Server_Software="
"Index of" / "chat/logs"
"Installed Objects Scanner" inurl:default.asp
"Mecury Version" "Infastructure Group"
"Microsoft ® Windows * ™ Version * DrWtsn Copyright ©" ext:log
"Most Submitted Forms and Scripts" "this section"
"Network Vulnerability Assessment Report"
"not for distribution" confidential
"phone * * *" "address *" "e-mail" intitle:"curriculum vitae"
"phpMyAdmin" "running on" inurl:"main.php"
"produced by getstats"
"Request Details" "Control Tree" "Server Variables"
"robots.txt" "Disallow:" filetype:txt
"Running in Child mode"
"sets mode: +p"
"sets mode: +s"
"Thank you for your order" +receipt
"This is a Shareaza Node"
"This report was generated by WebLog"
( filetype:mail | filetype:eml | filetype:mbox | filetype:mbx ) intextassword|subject
(inurl:"robot.txt" | inurl:"robots.txt" ) intext:disallow filetype:txt
+":" +":" +":" filetype:txt
+"HSTSNR" -"netop.com"
-sitehp.net -"The PHP Group" inurl:source inurl:url extHp
FBR "ADOBE PHOTOSHOP"
AIM buddy lists
allinurl:/examples/jsp/snp/snoop.jsp
allinurl:servlet/SnoopServlet
cgiirc.conf
cgiirc.conf
data filetype:mdb -site:gov -site:mil
exported email addresses
ext:asp inurlathto.asp
ext:cgi inurl:editcgi.cgi inurl:file=
extf inurl:rsyncd.conf -cvs -man
extf NoCatAuth -cvs
ext:dat bpk.dat
ext:gho gho
ext:ini intext:env.ini
ext:ldif ldif
ext:log "Software: Microsoft Internet Information Services *.*"
ext:mdb inurl:*.mdb inurl:fpdb shop.mdb
ext:nsf nsf -gov -mil
extqi pqi -database
ext:reg "username=*" putty
ext:txt "Final encryption key"
ext:txt inurl:dxdiag
ext:vmdk vmdk
ext:vmx vmx
filetype:asp DBQ=" * Server.MapPath("*.mdb")
filetype:bkf bkf
filetype:blt "buddylist"
filetype:blt blt +intext:screenname
filetype:cfg auto_inst.cfg
filetype:cnf inurl:_vti_pvt access.cnf
filetypef inurl:firewall -intitle:cvs
filetypefig web.config -CVS
filetype:ctt Contact
filetype:ctt ctt messenger
filetype:eml eml +intext:"Subject" +intext:"From" +intext:"To"
filetype:fp fp
filetype:fp fp -site:gov -site:mil -"cvs log"
filetype:fp fp
filetype:inf inurl:capolicy.inf
filetype:lic lic intext:key
filetype:log access.log -CVS
filetype:mbx mbx intext:Subject
filetype:myd myd -CVS
filetype:ns ns
filetype:ora ora
filetype:ora tnsnames
filetypedb pdb backup (Pilot | Pluckerdb)
filetypehp inurl:index inurlhpicalendar -site:sourceforge.net
filetypeot inurl:john.pot
filetypest inurl:"outlook.pst"
filetypest pst -from -to -date
filetype:qbb qbb
filetype:rdp rdp
filetype:reg "Terminal Server Client"
filetype:vcs vcs
filetype:wab wab
filetype:xls -site:gov inurltact
filetype:xls inurl:"email.xls"
Financial spreadsheets: finance.xls
Financial spreadsheets: finances.xls
Ganglia Cluster Reports
haccess.ctl (one way)
haccess.ctl (VERY reliable)
ICQ chat logs, please...
iletype:log cron.log
intext:"Session Start * * * *:*:* *" filetype:log
intext:"Tobias Oetiker" "traffic analysis"
intextpassword | passcode) intextusername | userid | user) filetype:csv
intext:gmail invite intext:http://gmail.google.com/gmail/a
intext:SQLiteManager inurl:main.php
intitle:"Apache::Status" (inurl:server-status | inurl:status.html | inurl:apache.html)
intitle:"AppServ Open Project" -site:www.appservnetwork.com
intitle:"ASP Stats Generator *.*" "ASP Stats Generator" "- weppos"
intitle:"Big Sister" +"OK Attention Trouble"
intitle:"edna:streaming mp server" -forums
intitle:"FTP root at"
intitle:"index of" +myd size
intitle:"Index Of" -inurl:maillog maillog size
intitle:"Index Of" cookies.txt size
intitle:"index of" mysql.conf OR mysql_config
intitle:"Index of" upload size parent directory
intitle:"index.of *" admin news.asp configview.asp
intitle:"index.of" .diz .nfo last modified
intitle:"Multimon UPS status page"
intitle:"PHP Advanced Transfer" (inurl:index.php | inurl:showrecent.php )
intitle:"PhpMyExplorer" inurl:"index.php" -cvs
intitle:"statistics of" "advanced web statistics"
intitle:"System Statistics" +"System and Network Information Center"
intitle:"Usage Statistics for" "Generated by Webalizer"
intitle:"wbem" compaq login "Compaq Information Technologies Group"
intitle:"Web Server Statistics for ****"
intitle:"web server status" SSH Telnet
intitle:"welcome.to.squeezebox"
intitle:admin intitle:login
intitle:index.of "Apache" "server at"
intitle:index.of cleanup.log
intitle:index.of dead.letter
intitle:index.of inbox
intitle:index.of inbox dbx
intitle:index.of ws_ftp.ini
intitle:intranet inurl:intranet +intext:"phone"
inurl:"/axs/ax-admin.pl" -script
inurl:"/cricket/grapher.cgi"
inurl:"bookmark.htm"
inurl:"cacti" +inurl:"graph_view.php" +"Settings Tree View" -cvs -RPM
inurl:"newsletter/admin/"
inurl:"newsletter/admin/" intitle:"newsletter admin"
inurl:"putty.reg"
inurl:"smb.conf" intext:"workgroup" filetypef conf
inurl:*db filetype:mdb
inurl:/_layouts/settings
inurl:admin filetype:xls
inurl:admin intitle:login
inurl:backup filetype:mdb
inurl:cgi-bin/printenv
inurl:cgi-bin/testcgi.exe "Please distribute TestCGI"
inurl:changepassword.asp
inurl:ds.py
inurl:email filetype:mdb
inurl:fcgi-bin/echo
inurl:forum filetype:mdb
inurl:forward filetype:forward -cvs
inurl:getmsg.html intitle:hotmail
inurl:log.nsf -gov
inurl:main.php phpMyAdmin
inurl:main.php Welcome to phpMyAdmin
inurl:netscape.hst
inurl:netscape.hst
inurl:netscape.ini
inurl:odbc.ini ext:ini -cvs
inurlerl/printenv
inurlhp.ini filetype:ini
inurlreferences.ini "[emule]"
inurlrofiles filetype:mdb
inurl:report "EVEREST Home Edition "
inurl:server-info "Apache Server Information"
inurl:server-status "apache"
inurl:snitz_forums_.mdb
inurl:ssl.conf filetypef
inurl:tdbin
inurl:vbstats.php "page generated"
ipsec.conf
ipsec.secrets
ipsec.secrets
Lotus Domino address books
mail filetype:csv -site:gov intext:name
Microsoft Money Data Files
mt-db-pass.cgi files
MySQL tabledata dumps
mystuff.xml - Trillian data files
OWA Public Folders (direct view)
Peoples MSN contact lists
php-addressbook "This is the addressbook for *" -warning
phpinfo()
phpMyAdmin dumps
phpMyAdmin dumps
private key files (.csr)
private key files (.key)
Quicken data files
robots.txt
site:edu admin grades
SQL data dumps
Squid cache server reports
Unreal IRCd
WebLog Referrers
Welcome to ntop!

"adding new user" inurl:addnewuser -"there are no domains"
(inurl:/cgi-bin/.cobalt/) | (intext:"Welcome to the Cobalt RaQ")
+htpasswd +WS_FTP.LOG filetype:log
filetypehp HAXPLORER "Server Files Browser"
intitle:"Web Data Administrator - Login"
intitle:admin intitle:login
inurl:"phpOracleAdmin/php" -download -cvs
inurl:ConnectComputer/precheck.htm | inurl:Remote/logon.aspx
PHP Shell (unprotected)
PHPKonsole PHPShell filetypehp -echo
Public PHP FileManagers

"Index Of /network" "last modified"
"index of cgi-bin"
"index of" / picasa.ini
"index of" inurl:recycler
"Index of" rar r nfo Modified
"intitle:Index.Of /" stats merchant cgi-* etc
"Powered by Invision Power File Manager" (inurl:login.php) | (intitle:"Browsing directory /" )
"Web File Browser" "Use regular expression"
"Welcome to phpMyAdmin" " Create new database"
allinurl:"/*/_vti_pvt/" | allinurl:"/*/_vti_cnf/"
filetype:cfg ks intext:rootpw -sample -test -howto
filetype:ini Desktop.ini intext:mydocs.dll
filetype:torrent torrent
Index of phpMyAdmin
index.of.dcim
index.of.password
index.of.password
intext:"d.aspx?id" || inurl:"d.aspx?id"
intext:"Powered By: TotalIndex" intitle:"TotalIndex"
intitle:"album permissions" "Users who can modify photos" "EVERYBODY"
intitle:"Directory Listing For" intext:Tomcat -intitle:Tomcat
intitle:"HFS /" +"HttpFileServer"
intitle:"Index of *" inurl:"my shared folder" size modified
intitle:"Index of /CFIDE/" administrator
intitle:"Index of c:\Windows"
intitle:"index of" "parent directory" "desktop.ini" site:dyndns.org
intitle:"index of" -inurl:htm -inurl:html mp
intitle:"Index of" cfide
intitle:"index of" intext:"content.ie"
intitle:"index of" inurl:ftp (pub | incoming)
intitle:"index.of.personal"
intitle:"webadmin - /*" filetypehp directory filename permission
intitle:index.of (inurl:fileadmin | intitle:fileadmin)
intitle:index.of /AlbumArt_
intitle:index.of /maildir/new/
intitle:index.of abyss.conf
intitle:intranet inurl:intranet +intext:"human resources"
intitle:upload inurl:upload intext:upload -forum -shop -support -wc
inurl:/pls/sample/admin_/help/
inurl:/tmp
inurl:backup intitle:index.of inurl:admin
inurl:explorer.cfm inurldirpath|This_Directory)
inurl:jee/examples/jsp
inurl:ojspdemos
private
protected
secret
secure
winnt

filetypel -intext:"/usr/bin/perl" inurl:webcal (inurl:webcal | inurl:add | inurl:delete | inurlfig)
"File Upload Manager v." "rename to"
"Powered by Land Down Under "
"powered by YellDL"
ext:asp "powered by DUForum" inurlmessages|details|login|default|register) -site:duware.com
ext:asp inurlUgallery intitle:"." -site:dugallery.com -site:duware.com
ext:cgi inurl:ubb_test
ezBOO "Administrator Panel" -cvs
filetype:cgi inurl:cachemgr.cgi
filetype:cnf my.cnf -cvs -example
filetype:inc inc intext:setcookie
filetype:lit lit (books|ebooks)
filetype:mdb inurl:"news/news"
filetypehp inurl:"viewfile" -"index.php" -"idfil
filetype:wsdl wsdl
Gallery configuration setup files
intitle:"ASP FileMan" Resend -site:iisworks.com
intitle:"Directory Listing" "tree view"
intitle:"Index of /" modified php.exe
intitle:"PHP Explorer" exthp (inurlhpexplorer.php | inurl:list.php | inurl:browse.php)
intitle:"phpremoteview" filetypehp "Name, Size, Type, Modify"
intitle:mywebftp "Please enter your password"
inurl:" WWWADMIN.PL" intitle:"wwwadmin"
inurl:"nph-proxy.cgi" "Start browsing through this CGI-based proxy"
inurl:"plog/register.php"
inurl:cgi.asx?StoreID
inurl:changepassword.cgi -cvs
inurl:click.php intextToungueHPClickLog
inurlhp.exe filetype:exe -example.com
inurl:robpoll.cgi filetype:cgi
link:http://www.toastforums.com/
PHP-Nuke - create super user right now !
The Master List

"More Info about MetaCart Free"
Comersus.mdb database
inurl:midicart.mdb
inurl:shopdbtest.asp
POWERED BY HIT JAMMER .!
site:ups.com intitle:"Ups Package tracking" intext:"Z ### ### ## #### ### #"
VP-ASP Shop Administrators only

12 Eylül 2009 Cumartesi

Windows Mobile'da SMS ve Email gönderme

Tüm bu işlemleri yapmak için uygulamaıza Microsoft.WindowsMobile.PocketOutlook referansını eklememiz gerekmektedir. Bu referansı ekleyerek uygulamamıza başlayabiliriz.



Makalemize öncelikle uygulamamızdan nasıl sms atacağımızı inceleyerek başlayalım. Sms göndermek için SmsMessage nesnesini kullanacağız. Sms alıcılarını tanımlamak için ise Recipient nesnesini kullanacağız. SmsMessage nesnesi sadece sms mesajları için kullanılırken Recipient nesnesi tüm mesaj tipleri (Email, sms) için kullanılan ortak bir nesnedir. Öncelikle bu nesnelerin özelliklerini ve metodlarını inceleyelim.

SmsMessage nesnesi özellikleri :
Body(String) Bu özellik sms mesajının içeriğini taşımaktadır.
From(Recipient) Bu özellik sms'in kimden geldiği bilgisini taşımaktadır ve readonly bir özelliktir. Sms gönderilirken değil gelen sms'lerin incelenmesinde kullanılan bir özelliktir.
ItemId(ItemId) Bu özellik sms'e ait unique bir değer taşımaktadır. Bu özellik read only'dir.
LastModified(DateTime) Mesajın gönderildiği tarih bilgisini taşıyan özelliktir. Bu özellik read only'dir.
Read(bool) Sms'in okunup okunmadığı bilgisini taşıyan özelliktir. Read only'dir.
Received(DateTime) Sms'in alındığı tarih bilgisini taşıyan özelliktir. Read only'dir.
RequestDeliveryReport(bool) Gönderilen sms için delivery report istenip istenmediğinin tutulduğu özelliktir.
To(RecipientCollection) Sms'in alıcılarının bilgilerinin tutulduğu özelliktir. Her bir alıcı bir Recipient nesnesi ile temsil edilmektedir.

SmsMessage nesnesi metodları :
Send Sms'i göndermek için kullanacağımız metoddur. Sms'in aktif gsm şebekesi üzerinden gönderilmesini sağlar.

Recipient nesnesi özellikleri :
Address(string) Mesaj gönderilecek nokta bilgisini barındıran özelliktir. Sms mesajları için telefon numarası, Email mesajları için ise email adresidir.
Name(string) Mesaj gönderilecek kişiyi barındıran özelliktir.

Recipient nesnesi için bu değerlerin instance alırken tanımlanabileceği yapıcı metodlar mevcuttur. Bu nesnenin boş yapıcı metodu yoktur.

Şimdi isterseniz Sms göndermek için kullanabileceğimiz bir helper class'ını birlikte yazalım.

public static void SendSms(string parBody, string parRecipient)
{
SmsMessage insSmsMessage = new SmsMessage();
insSmsMessage.Body = parBody;
AddRecipient(insSmsMessage, parRecipient);
insSmsMessage.Send();
}
private static void AddRecipient(SmsMessage parSmsMessage, string parRecipient)
{
AddRecipient(parSmsMessage, new Recipient(parRecipient));
}


Gördüğünüz gibi birkaç satırlık kod yazarak sms göndermek mümkün. Bu metodların farklı parametreler alan overload'larını yazdığım bir class'ı Download kısmından indirebilirsiniz.

Şimdi isterseniz sms göndermeye çok benzer bir şekilde çalışan Email gönderme işlemini inceleyelim. Bunun için kullanacağımız nesne EmailMessage nesnesidir.

EmailMessage nesnesi özellikleri :
Attachments(AttachmentCollection) Mail mesajının eklerini barındıran özelliktir.
Bcc(RecipientCollection) Email'in bcc alıcılarının bilgilerinin tutulduğu özelliktir. Her bir alıcı bir Recipient nesnesi ile temsil edilmektedir.
BodyText(string) Email'in içeriğinin tutulduğu özelliktir.
Cc(RecipientCollection) Email'in cc alıcılarının bilgilerinin tutulduğu özelliktir. Her bir alıcı bir Recipient nesnesi ile temsil edilmektedir.
From(Recipient) Mesaj alıcısında gösterilecek mesajı gönderen adres ve kişi bilgisinin tutulduğu özelliktir.
Importance(Importance) Email'in önem derecesinin tutulduğu özelliktir. Aynı isimdeki Importance enum'undan değerler alır.
ItemId(ItemId) Bu özellik email'e ait unique bir değer taşımaktadır. Bu özellik read only'dir.
LastModified(DateTime) Mesajın gönderildiği tarih bilgisini taşıyan özelliktir. Bu özellik read only'dir.
Read(bool) Email'in okunup okunmadığı bilgisini taşıyan özelliktir. Read only'dir.
Received(DateTime) Email'in alındığı tarih bilgisini taşıyan özelliktir. Read only'dir.
Sensitivity(Sensitivity) Email'in kişisel mi confidential'mı olduğu gibi hassasiyet bilgilerinin tutulduğu özelliktir. Aynı isimdeki enum değerlerini taşır.
Subject(string) Email mesajının konusu'nun tutulduğu özelliktir.
To(RecipientCollection) Email'in alıcılarının bilgilerinin tutulduğu özelliktir. Her bir alıcı bir Recipient nesnesi ile temsil edilmektedir.

EmailMessage nesnesi metodları :
Send Email'i göndermek için kullanacağımız metoddur. Accountname veya EmailAccount nesnesini parametre alır ve parametre aldığı mail hesabı üzerinden gönderim yapar.

Şimdi isterseniz Email göndermek için kullanabileceğimiz bir helper class'ını birlikte yazalım.

public static void SendEmail(string parBody, string parRecipient)
{
EmailMessage insEmailMessage = new EmailMessage();
insEmailMessage.BodyText = parBody;
AddRecipient(insEmailMessage, parRecipient);
insEmailMessage.Send(GetAccountName());
}
private static string GetAccountName()
{
OutlookSession insOutlookSession = new OutlookSession();
return insOutlookSession.EmailAccounts[0].Name;
}
private static void AddRecipient(EmailMessage parEmailMessage, Recipient parRecipient)
{
parEmailMessage.To.Add(parRecipient);
}

Gördüğünüz gibi mail gönderme işlemi Sms göndermeye çok benzemektedir. Tek farklı nokta send metodunda mail hesabının veya hesap adının verilmesi gerekmesidir. Gördüğünüz gibi bunun içinde Outlook Session nesnesinden tanımlı mail hesaplarını okuyabilmekteyiz.

Şimdi isterseniz mobil cihazımıza yeni bir mesaj geldiğinden nasıl haberdar olabileceğimizi inceleyelim. Bunun için MessageInterceptor nesnesini kullanacağız. Bu nesne overloadında sadece Notify mı edileceği veya Notify edildikten sonra mesajın silinip silinmeyeceğine dair bir aksiyon parametresi ve bu işlem için mevcut thread'in kullanılıp kullanılmayacağını belirleyen boolean tipinde bir parametre almaktadır. Sonrasında ise bu nesnenin MessageReceived event'ını handle ederek mesaj geldiğinden haberdar olabiliriz. Bu nesnenin kullanımına ait bir örnek aşağıda verilmiştir.

MessageInterceptor msgInterceptor = new MessageInterceptor(InterceptionAction.Notify, true);

public SmsAgent()
{
msgInterceptor.MessageReceived += new MessageInterceptorEventHandler(msgInterceptor_MessageReceived);
}
void msgInterceptor_MessageReceived(object sender, MessageInterceptorEventArgs e)
{
}
Gördüğünüz gibi mesaj geldiğinde MessageInterceptor nesnesinden fırlayan event sayesinde bir çok işlem yapabiliriz. Event'ta bulunan MessageInterceptorEventArgs parametresinin Message özelliği ile gelen mesaja ait özellikleri alabiliriz.

Burda önemli bir soru belirli özelliklere sahip mesajları nasıl yakalayacağımızdır. Örneğin bir kullanıcıdan gelen mesajları yakalamak istiyorsak ne yapmamız gerektiğidir. Birçoğunuzun aklına bu durumu MessageRecieved event'ı içinde kontrol etmek gelmiştir. Ancak bunun için MessageCondition nesnesi vardır. Tek yapmanız gereken bu nesnenin ilgili property'lerini doldurmak ve MessageInterceptor nesnesinin MessageCondition özelliğine bu nesneyi atamaktır. Aşağıda bununla ilgili bir örnek kod parçası veriyorum.

MessageInterceptor msgInterceptor = new MessageInterceptor(InterceptionAction.Notify, true);
public SmsAgent()
{
msgInterceptor.MessageCondition = new MessageCondition(MessageProperty.Body, MessagePropertyComparisonType.StartsWith, "Hello");
msgInterceptor.MessageReceived += new MessageInterceptorEventHandler(msgInterceptor_MessageReceived);
}
void msgInterceptor_MessageReceived(object sender, MessageInterceptorEventArgs e)
{}

Umarım faydalı bir makale olmuştur.

Tamer Öz
http://www.yazgelistir.com/Makaleler/1000002315.ygpx

7 Eylül 2009 Pazartesi

how to get imei number

Siemens: System.getProperty("com.siemens.IMEI");

Samsung: System.getProperty("com.samsung.imei");

SonyEricsson: System.getProperty("com.sonyericsson.imei");

Motorola: System.getProperty("IMEI");

System.getProperty("com.motorola.IMEI");

Nokia: System.getProperty("com.nokia.mid.imei");