Forum DhammaCitta. Forum Diskusi Buddhis Indonesia
Komunitas => Ilmu Pengetahuan dan Teknologi => Teknologi Informasi => Topic started by: whatthe on 27 November 2008, 09:58:49 PM
-
Bagi yang mo nyari software inventory gratisan. ni g bagi2 program2 buatan saya. Ini uda kelamaan sih and belom update2 (dulu lebih sering develope gunain VB), sekarang uda stuck di bahasa yang ga jelas. 8)
http://www.geocities.com/niqmk
Bagi yang menemukan bug ataupun ide yang bisa disharing, g dengan senang hati menerimany. Kritik? OK. tapi dengan bahasa yang halus ye.
G ga mencari keuntungan berupa material dari software ini. G cuma pengen menambah ilmu dari saran-saran n moga2 bisa dikembangin ama anda-anda sekalian. Tapi kasih tau ya, buat sharing-sharing gitu. hehehe...
-
hehehe.. siip bozzz
hatRed siap membantu
-
hehehe.. siip bozzz
hatRed siap membantu
Gile cepet amet u balesny
-
^ lgi ketik uda dibls
btw itu software buat apa ya??
-
service temporary unavaiable pass g klik lin-nya... :-?
-
software inventory pake sql server 7, 2000, ama access. Entar ada pilihanny disitu. Update an terbaru si uda sampe mysql. Tapi lagi males upload.
[to] N1AR -> software apa ya?
-
oh service temporary un...
sorry, limitny uda terbatas. g apus dulu ye
-
"Open source" kok make VB ma Access ???
-
software inventory pake sql server 7, 2000, ama access. Entar ada pilihanny disitu. Update an terbaru si uda sampe mysql. Tapi lagi males upload.
[to] N1AR -> software apa ya?
semuanya lah.. gak tau aye
-
Program yang bagus bro..
Sedikit comment ya..
Bagusnya seh.. waktu pilih kode barang / kode pemasok.. jangan pake dropdown / text.. soalnya biasanya user gak hafal seh..
tapi bisa manfaatin tombol search gitu..
Contoh :
Kode : P______ [Tombol]
Ketika kita klik [Tombol] / bisa juga pake Event Keypress di VB (gw biasa pake tanda panah bawah) langsung muncul kotak dialog baru..
|============================= |
| Kode | Nama Barang | Sat |
|============================= |
| P01 | Pena | PCS |
| | | |
| | | |
============================== |
-
[at] Forte
di combo box kan ada auto search kalo pilihan sortnya True, jadi bisa mempermudah.
dan penggunaan combo box, bisa mempercepat user dalam mencari.
kelemahannya ya harus load listnya dulu.
emank sih ada positif dan negatifnya.
-
gw dulu pernah pake combo box.. tapi kalau datanya sangat banyak.. misal data kode barang / kode supplier yang capai ribuan record.. gw gak berani pake combo box.. dikomplen user.. :)) soalnya kadang user mau seenak jidatnya aja.. dia lupa kode supplier.. tapi dia ingat nama tengah nama supplier.. makanya enakan pake sql syntax %variabel%
-
Btw.. koq jadi forum programming yak..
Ayo2.. buka sub forum programming yoooooooookkkkk :))
**lirik Tuhan DC :))
-
kalo gw implementasikan dengan menambah tombol, "cari berdasarkan"
gambarannya spt ini
Kode | Nama
trus ada tombol buat ubah "dasar pencarian" jadi
Nama | Kode
tapi form search sendiri memang lebih flexible, tetapi saya sih gak nyaranin kalo jumlah field yang ada cuma 1,2
mungkin kalo dasar pencarian yg diinginkan lebih dari 3 baru penggunaan combo ini menyulitkan.
-
Btw.. koq jadi forum programming yak..
Ayo2.. buka sub forum programming yoooooooookkkkk :))
**lirik Tuhan DC :))
hehehe........... setuju atu....
trus di partisi lagi bahasa programmingnya, gmana?
-
iye sih, kebanyakn dari kite membuatny dengan ada tombol dengan langsung cari yang diinginkan. tapi g pikir terlalu banyak textbox, jadi ga bagus. hehehe... malah mencet sana mencet sini. makany updatean g yang terbaru menggunakan web service untuk meload langsung di server. jadi untuk masalah load di combo box itu terpecahkan (ga semua data diload ke combo box). hanya ketikan user yang dimunculkan.
Belom upload yang terbaru. males, soalny size ny tambah lama tambah gede. jadi g mikirin mungkin diantara kalian ada yang bisa menghilangkan masalah load data yang terlalu banyak selain web service yang g gunain tadi.
-
ntar g upload kodingny. jadi kalian yang pengen ubah2. langsung aja. besok aja yah, uda malem, males uploadny
-
[at] whatte
kalau, "query on the fly" kayak gitu rentan banget, kalo koneksi putus, bisa2 tu user ngehang di jarum pasir :))
-
[at] Atas..
Biasanya kalau style gw.. cari berdasarkan itu :
Kriteria : [ComboBox] => isinya namafield dari yang akan dicari
Nilai : __________________
====================================================
| Kode | Nama Supplier | Alamat | Kota | Telp | Contact Person |
=====================================================
Ketika [ComboBox] diclick akan jadi seperti seperti
[____________]V
Kode
Nama
Alamat
Kota
Telp
Contact Person
Jadi user bebas memilih.. mau search berdasarkan apa fieldnya..
-
iye sih, kebanyakn dari kite membuatny dengan ada tombol dengan langsung cari yang diinginkan. tapi g pikir terlalu banyak textbox, jadi ga bagus. hehehe... malah mencet sana mencet sini. makany updatean g yang terbaru menggunakan web service untuk meload langsung di server. jadi untuk masalah load di combo box itu terpecahkan (ga semua data diload ke combo box). hanya ketikan user yang dimunculkan.
Belom upload yang terbaru. males, soalny size ny tambah lama tambah gede. jadi g mikirin mungkin diantara kalian ada yang bisa menghilangkan masalah load data yang terlalu banyak selain web service yang g gunain tadi.
Supaya gak mencet sana sini.. pake donk event KeyPress.. :D gw juga gak gitu suka banyak tombol.. biasanya pake event keypress.. kalau gak tombol bawah.. ya tombol Tab
-
[at] Forte
coba deh tawarkan solusi tersebut ke data center,
paling2 tu user bakal kelibet jarinya :))
g pernah di komplain ma user g, soale rumit makenya
dia orang monya, input -> enter ->input -> enter ->input ->enter
dah... gitu doank.
emank sih kasian juga kalo g liat, bayangin aja mesti input sekardus faktur.
-
yup.. rata2 user pengennya begitu.. makanya gw biasanya style coding.. mouse itu hampir gak pernah kepegang.. untuk memunculkan dialog box pake tombol panah bawah.. tekan enter langsung loncat ke text box berikutnya.. terus bisa main tab.. jadi mouse hampir gak pernah kepegang.. jadi mirip pemograman dos.. tapi bikin kerja lebih cepat..
[joke] paling user berharap.. andai saja faktur ini ada barcodenya dan bisa discan :hammer:
-
ngomong2 yg usulin ke empu DC, ada khusus Programming jgn g ya.
siapa gek, soale g dah minta Child IT, ntar dikira dikasih hati minta jantung lagee.
-
kalau, "query on the fly" kayak gitu rentan banget, kalo koneksi putus, bisa2 tu user ngehang di jarum pasir :))
bener juge, itu bisa diset di databaseny pake transaction rollback
-
hehehe.....
lebih baik lagi kalo scanner reader =)) tinggal jepit , teken tombol execute beres deh. =))
-
ngomong2 yg usulin ke empu DC, ada khusus Programming jgn g ya.
siapa gek, soale g dah minta Child IT, ntar dikira dikasih hati minta jantung lagee.
:)) cuma joke koq.. lagian di sini cukup bahas konsep logic saja.. kalau bahas bahasa programming kayaknya kelewat banyak ntar.. si A jago php.. ntar si B jago delphi.. si C jago ruby.. si D jago vb.. macem2.. :))
-
Option joke explicit
Public class Dhammacittamain()
Private Topic as String
Private subTopic as new collection
Public subMakeNeatProgrammingTopic(sumedho as Person)
Topik = "Programming"
subTopik.add VB
subTopik.add Delphi
subTopik.add VFP
subTopik.add Java
subTopik.add C#
subTopik.add C++
subTopik.add C
if makeNewTopik(Topic) then
call makeNewChildTopic(subTopik)
else
Me.Suicide
endif
end sub
end class
-
hehehe.. yang demen vb dah beraksi dah.. :))
-
sys.exit ("Kalo bakal banyak peminatnya nanti dibuatin, sekarang ini keknya sih belum")
-
kalo gitu,
Option joke explicit
Public class Dhammacittamain()
Private Topic as String
Private subTopic as new collection
Public subMakeNeatProgrammingTopic(sumedho as Person)
Topik = "Programming"
subTopik.add VB
subTopik.add Delphi
subTopik.add VFP
subTopik.add Java
subTopik.add C#
subTopik.add C++
subTopik.add C
if makeNewTopik(Topic) then
call makeNewChildTopic(subTopik)
else
do events //Me.Suicide
endif
end sub
end class
-
Dear all,
ini source code inventory ny, enjoy!!!
http://www.geocities.com/niqmk/inventory.zip
-
We're sorry, but this page is currently unavailable for viewing.
If this site belongs to you, please read this help page for more information and assistance.
For general questions see our main help area, or search for other member pages.
-
Jangan langsung diklik. Kalo langsung diklik di langsung ke subdomain us.share.
copy link aja. buka process baru
-
sip lagi dl.
-
ikut senang liat rekan2 yg semangat di programming....
-
[at] atas.. ikut nyumbang donk..
ntar malam gw mau nyumbang juga dah.. tapi mungkin nyumbang konsep aja. :P
soalnya bahasanya VFP seh..
-
Aye bagi ini ah.. ;D
Skinning with Visual FoxPro 9
(http://hostgambargratis.com/foto-asli-hgg-3726.jpg)
Ide ini terlintas ketika saya melihat VFP-Skin 3, hanya saja harus bayar.. Dan.. daripada bayar.. bagus saya rancang gambar dan scripting agar tampilannya tidak kalah dengan VFP-Skin 3. Jadi bagi yang bosan dengan tampilan program yang bentuknya kotak.. bisa coba script ini, dengan tampilan yang lebih 'sexy' ;D
Fitur :
- Lengkap dengan tombol min, max, close yang bisa menyala bila mouse didekatkan
- Title bar yang bisa drag & drop
- Title bar yang bila diklik 2x bisa resize max dan kembali ke normal bila diulangi 2x klik
1. Desain 1 skin yang Anda sukai dan potonglah menjadi 9 bagian file BMP + 3 file BMP :) dan 1 skin messagebox
Ps : Semua skin diwarnai background dengan warna kuning RGB(255,255,0)
File tersebut adalah :
a. kiriatas.bmp (115 x 103) = height x width
b. tengahatas.bmp (115 x 5)
c. kananatas.bmp (115 x 103)
- kamin.bmp (file bmp dengan gambar tombol minimize menyala yang ukurannya sama dengan kananatas.bmp)
- kamax.bmp (file bmp dengan gambar tombol maximize menyala yang ukurannya sama dengan kananatas.bmp)
- kaclose.bmp (file bmp dengan gambar tombol close menyala yang ukurannya sama dengan kananatas.bmp)
d. kiri.bmp (5 x 103)
e. tengah.bmp (5 x 5)
f. kanan.bmp (5 x 103)
g. kiribawah.bmp (
i. tengahbawah.bmp
j. kananbawah.bmp
k. msgbox.bmp
2. Buat New Class dengan Base On Form dan Tentukan nama file vcx nya
3. Setelah muncul Form, maka ditambahkan 9 object image dan ditentukan properties picture sesuai nama filenya seperti point a s/d j
4. 9 image tersebut disusun dengan rapi dan dicatat nilai properties top dan left nya
5. Setelah disusun rapi, masukkan 3 object command button yang diset style nya menjadi INVISIBLE dan diatur posisinya di gambar min, max, close
(cmdmin,cmdmax,cmdclose)
6. Masukkan lagi object shape dan label yang diset transparant dan dihilangkan bordernya dan diatur posisinya
7. Setelah selesai, tekan control-A, dan ubah top semua image menjadi 1000000 (biar tidak ketahuan boongnya :p)
8. Tambahkan lagi image baru untuk msgbox.bmp
9. Tambahkan 3 command button (cmd1, cmd2,cmd3)
10.Tambahkan label untuk tampilan isi, logo(kebetulan saya pakai label), dan title messagebox
11. Atur posisi agar kelihatan bagus
12. Form tersebut diset property showwindow = 2 (As Top Level)
13. Tambahkan method(M) dan properties(P) berikut ini :
gantisize(M)
hnormal(P) = 0
initlain(M)
iregular(M)
m_isi(P) = ""
m_jenis(P) = ""
mousedownx(P) =0
mousedowny(P) =0
msgform(P) =.f.
n_button(P) =1
nflags(P) = .f.
wnormal(P) = 0
14. Sebagai contoh dilampirkan Init method dari class myform
this.AutoCenter = .T.
this.BorderStyle= 0
this.Closable = .F.
this.ControlBox = .F.
this.TitleBar = 0
IF this.wnormal=0 AND this.hnormal=0
this.wnormal=this.Width
this.hnormal=this.Height
ELSE
this.wnormal=604
this.hnormal=329
ENDIF
this.BackColor = RGB(255,255,0)
IF DODEFAULT()
TRY
DECLARE INTEGER SetLayeredWindowAttributes IN win32api;
INTEGER HWND, INTEGER crKey, INTEGER bAlpha, INTEGER dwFlags
*These functions get and set a window's attributes
DECLARE INTEGER SetWindowLong IN user32.DLL ;
INTEGER hWnd, INTEGER nIndex, INTEGER dwNewLong
DECLARE INTEGER GetWindowLong IN user32.DLL ;
INTEGER hWnd, INTEGER nIndex
CATCH
MESSAGEBOX("Could not load the required libraries. Make sure you are running Windows 2000 or higher.")
ENDTRY
ENDIF
This.iregular(thisform.HWnd,thisform.BackColor,1)
this.initlain
15. Method Iregular
********************************************************************************
* To create a non-rectangular form, a transparent color needs to be set.
* Anything drawn using this color will be transparent, and any
* mouse clicks in these regions will pass through to the visible form.
*
* This technique only works in Windows 2000/XP but it is much more efficient
* than previous techniques of setting a bounding region for the form.
*
* This can be used to create non-rectangluar forms, to create hovering agents,
* or simply to confuse your coworkers <g>.
*
* Although this function makes a form transparent, the Form must be setup
* accept these changes. First, the ShowWindow property MUST BE set to
* 2 'As Top-Level Form'. Otherwise the window cannot be drawn layered.
* Second, if you want to turn off the window's frame, since it will not be
* drawn transparent, you can set the following properties:
* BorderStyle = 0
* Caption = ""
* Closable = .F.
* ControlBox = .F.
* TitleBar = 0
*
********************************************************************************
*-- Pass in the window handle (Thisform.HWIND) and the color to make transparent.
LPARAMETERS nHWND, nColor, nAction
*Constants for SetLayeredWindowAttributs
#DEFINE LWA_COLORKEY 1
#DEFINE LWA_ALPHA 2
*Constants for SetWindowLong and GetWindowLong
#DEFINE GWL_EXSTYLE -20
#DEFINE WS_EX_LAYERED 0x00080000
LOCAL lnFlags
*The form's window must be set to Layered, so that it is drawn
* in a separate layer.
do case
case nAction = 1 && Make Transparent
lnFlags = GetWindowLong(nHWND, GWL_EXSTYLE) &&Gets the existing flags from the window
thisform.nFlags = lnFlags
lnFlags = BITOR(lnFlags, WS_EX_LAYERED) &&Appends the Layered flag to the existing ones
SetWindowLong(nHWND, GWL_EXSTYLE, lnFlags) &&Sets the new flags to the window
SetLayeredWindowAttributes(nHWND, nColor, 0, LWA_COLORKEY)
case nAction = 2 && Make Opaque
SetWindowLong(nHWND, GWL_EXSTYLE, thisform.nFlags) &&Sets the original flags to the window
SetLayeredWindowAttributes(nHWND, nColor, 0, 0)
endcase
16. Method Gantisize
LOCAL nilx,nily
nilx=this.Width
nily=this.Height
this.AutoCenter=.t.
**Pengaturan Skin Form Yang Statis
*Image
this.plu.Left=8
this.plu.top=8
this.pl.Left=8
this.pl.top=110
this.pc.top=110
this.pc.left=123
this.plb.left=8
this.pu.Top=8
this.pu.left=123
this.pr.top=110
this.pru.Top=8
this.pb.left=123
this.pu.Stretch= 2
this.pl.Stretch= 2
this.pc.Stretch= 2
this.pr.Stretch= 2
this.pb.Stretch= 2
*Title Shape & Label
this.titleshape.Left=8
this.titleshape.Top=33
this.titlename.Left=78
this.titlename.Top=40
*Cmd Min, Max, Close
this.cmdmin.Top=36
this.cmdmax.Top=36
this.cmdclose.Top=36
**Pengaturan Skin Form yang Dinamis
this.pl.Height= nily - (110*2)
this.pr.Height = this.pl.Height
this.pu.Width = nilx -(123*2)
this.pb.Width = this.pu.Width
this.pr.Left=nilx-123
this.plb.Top=nily-110
this.prb.Top=this.plb.Top
this.prb.left=this.pr.Left
this.pb.Top=this.prb.top
this.pc.Height=this.pl.Height
this.pc.Width=this.pu.Width
*Tombol
this.pru.Left=nilx-123
this.cmdmin.left=this.pru.Left + 25
this.cmdmax.left=this.pru.Left + 48
this.cmdclose.left=this.pru.Left + 71
*TitleBar dan TitleName
this.titlename.Width=this.pu.Width-20
this.titleshape.Width=this.pr.left
17. Method Destroy
if this.msgform=.t.
CLEAR EVENTS
endif
18. Titleshape.dblclick
this.Parent.cmdmax.Click
19. Titleshape.mousedown
LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nButton = 1
this.parent.mousedownx = m.nXCoord
this.parent.mousedownY = m.nYCoord
ENDIF
20. Titleshape.mouseleave
LPARAMETERS nButton, nShift, nXCoord, nYCoord
this.parent.mousedownx = 0
this.parent.mousedownY = 0
21. Titleshape.mousemove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
LOCAL lnDifferenceX, lnDifferenceY
IF nButton = 1 AND (this.parent.mousedownx != 0 OR this.parent.mousedowny != 0)
m.lnDifferenceX = m.nXCoord - this.parent.mousedownx
m.lnDifferenceY = m.nYCoord - this.parent.mousedowny
this.parent.Move(this.parent.LEFT + m.lnDifferenceX, this.parent.TOP + m.lnDifferenceY, this.parent.Width, this.parent.Height)
THIS.MouseDown(nButton, nShift, nXCoord - m.lnDifferenceX, nYCoord - m.lnDifferenceY)
ENDIF
22. Cmdmin.click
this.Parent.WindowState= 1
23. Cmdmin.mouseenter
this.parent.image3.picture="kamin.bmp" &&gambar tombol min menyala
23. Cmdmin.mouseleave
this.parent.image3.picture="kananatas.bmp" &&gambar tombol normal
24. Isi juga cmdmax, cmdclose, tapi dibedakan properties picturenya sesuai dengan jenis tombolnya
25. cmd1.click
nhasil=1
this.parent.release
26. Untuk cmd2, cmd3, diganti nhasil menjadi 2 dan 3
27. Buat suatu file prg
PROCEDURE runpesan()
LPARAMETERS jenis,tombol,isi
if pcount()=3
oForm=newOBJECT("phxform","d:\vfp9\plx\classes\phxclass.vcx")
PUBLIC nhasil
nhasil=0
WITH oForm
.addproperty("Caption","ALOHA")
.addproperty("msgform",.t.)
.addproperty("m_jenis",jenis)
.addproperty("n_button",tombol)
.addproperty("m_isi",isi)
.init()
.show(1)
ENDWITH
READ events
return(MESSAGEBOX(nhasil))
endif
ENDPROC
-
busseeet, skinning.
g dari dulu gak pernah nyentuh2 nyang namanya skinning, g jadi penasaran skinning kek gmana.
thanx neh om Forte. tapi sayangnya di VFP ya. mesti substitusi dulu neh.. :)
-
Skinning itu pada prinsipnya menyamarkan warna latar menjadi transparent..
Warna latar yang saya gunakan pada gambar BMP sebenarnya warna kuning.. dan pas saya scripting agar kuning => transparent di method iregular.
-
Btw.. koq jadi forum programming yak..
Ayo2.. buka sub forum programming yoooooooookkkkk :))
**lirik Tuhan DC :))
setoejoe..
biar gw bisa nanya PR gw..
;D
-
kalo skinny, g pengen recomended ni produk. g uda develope ni barang ama produk g. Judulny "INFRAGISTIC". Bagi yang develope pake VB.NET, C#.NET, ASP.NET. Bisa pake produk ini. Ada trialny kok. Siplah...
-
[at] whatte
neyy, ada ada paa nya ya???
kok g jalanin firewall g malah ngasih warning??
trus keknya ad bug di Surat terima barang, n bagemana menentukn HPP??
-
kok g jalanin firewall g malah ngasih warning??
nah lo... :o
-
whattle..
koq prog inventory u dibuat otomatis loading pas start up ya ?
-
whattle..
koq prog inventory u dibuat otomatis loading pas start up ya ?
nah... semakin mencurigakan... ;D
joke:
kok di komputer gw keluar tulisan you are my zombie?
-
whattle..
koq prog inventory u dibuat otomatis loading pas start up ya ?
nah... semakin mencurigakan... ;D
joke:
kok di komputer gw keluar tulisan you are my zombie?
eh mas.. u jangan ikutan baca doank..
mana program u.. share di sini.. jangan pelit2 :))
peaceeeeeeeeeee
-
hehehe..
sip deh Forte, ntar g share......
sabar donk, susah neh nyari program g yg jadul2
-
bukan u.. tapi tesla :))
-
[at] whatte
neyy, ada ada paa nya ya???
kok g jalanin firewall g malah ngasih warning??
trus keknya ad bug di Surat terima barang, n bagemana menentukn HPP??
soalny ada konektifitas port untuk komunikasi antar komputer. Pake winsock
-
whattle..
koq prog inventory u dibuat otomatis loading pas start up ya ?
ya supaya user bisa liat otomatis pas jalanin komputer ny. itu kan buat komputer client not for server
-
bukan u.. tapi tesla :))
belum selesai...
btw ada java program yg gw buat utk jadi base bot game travian (enginenya dah jadi, ga ada gui, cuma console)
baru siap base utk komunikasi dg web server, tinggal bikin auto nya aja... berguna ga ya?
-
bukan u.. tapi tesla :))
belum selesai...
btw ada java program yg gw buat utk jadi base bot game travian (enginenya dah jadi, ga ada gui, cuma console)
baru siap base utk komunikasi dg web server, tinggal bikin auto nya aja... berguna ga ya?
share aja.. ntar tinggal bikin update2 aja.. bisa diatur tuh ma :))
-
nih... kasih source aja ya...
compile sendiri & download HtmlUnit dulu (library)
loh udah ga bisa attach file ya?
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package travianbot;
import java.io.*;
import java.util.*;
import com.gargoylesoftware.htmlunit.*;
import com.gargoylesoftware.htmlunit.html.*;
/**
*
* [at] author Administrator
*/
public class Bot {
private static final int DELAY_MILLISECONDS = 2000;
private WebClient client = new WebClient(BrowserVersion.FIREFOX_2);
private String server;
private String currentVillageId;
private String currentVillageName;
private String lastPageUrl; // for caching
private HtmlPage lastPage;
public Bot(String server) {
this.server = server;
}
// TRAVIAN FUNCTION
public HtmlPage login(String userName, String password) throws IOException {
HtmlPage page = getPage("/login.php");
HtmlForm form = page.getFormByName("snd");
// name of <input> changed every day -_-"
HtmlTextInput inputName = (HtmlTextInput) form.getByXPath("//input[ [at] type='text']").get(0);
HtmlPasswordInput inputPassword = (HtmlPasswordInput) form.getByXPath("//input[ [at] type='password']").get(0);
HtmlImageInput inputLogin = (HtmlImageInput) form.getInputByName("s1");
inputName.setValueAttribute(userName);
inputPassword.setValueAttribute(password);
delay(DELAY_MILLISECONDS);
HtmlPage dorf1 = (HtmlPage) inputLogin.click();
lastPageUrl = "?";
return dorf1; //dorf1.php or login.php(if failed)
}
public void logout() throws IOException {
getPage("/logout.php");
getPage("/login.php?del_cookie");
lastPageUrl = "?";
}
public boolean isLogged(HtmlPage dorf1) {
// check is <div id="lres0"> exists in dorf1.php?
// if not logged, dorf1.php actually contains login.php
boolean result = false;
try {
dorf1.getHtmlElementById("lres0");
result = true;
} catch (ElementNotFoundException ex) {
result = false;
}
return result;
}
public String getCurrentVillageName(HtmlPage dorf1) {
return ((HtmlElement) dorf1.getByXPath("//div[ [at] id='lmid2']/div[1]/h1").get(0)).asText();
}
public List<Village> getVillages(HtmlPage dorf3) {
List<Village> result = new ArrayList<Village>();
List elements = dorf3.getByXPath("//div[ [at] id='lmid2']/p/table/tbody//tr");
for (int i = 2; i < elements.size(); i++) {
HtmlTableRow tr = (HtmlTableRow) elements.get(i);
HtmlAnchor a = (HtmlAnchor) tr.getByXPath("td[1]/a").get(0);
Village v = new Village();
v.id = a.getAttribute("href");
v.id = v.id.substring(v.id.lastIndexOf("=")+1);
v.name = a.asText();
result.add(v);
}
return result;
}
/*
* [at] param page page that contains <div id="lres0">
* eg. dorf1.php, dorf2.php, dorf3.php, karte.php
*/
public String[] getResource(HtmlPage page) {
String wood = page.getElementById("l4").getTextContent();
String clay = page.getElementById("l3").getTextContent();
String iron = page.getElementById("l2").getTextContent();
String crop = page.getElementById("l1").getTextContent();
String cropUsage = ((HtmlElement) page.getByXPath("//div[ [at] id='lres0']/table/tbody/tr/td[9]").get(0)).asText();
return new String[] { wood, clay, iron, crop, cropUsage };
}
public String[] getProduction(HtmlPage dorf1) {
String wood = ((HtmlElement) dorf1.getByXPath("//div[ [at] id='lrpr']/table/tbody/tr[1]/td[3]/b").get(0)).asText();
String clay = ((HtmlElement) dorf1.getByXPath("//div[ [at] id='lrpr']/table/tbody/tr[2]/td[3]/b").get(0)).asText();
String iron = ((HtmlElement) dorf1.getByXPath("//div[ [at] id='lrpr']/table/tbody/tr[3]/td[3]/b").get(0)).asText();
String crop = ((HtmlElement) dorf1.getByXPath("//div[ [at] id='lrpr']/table/tbody/tr[4]/td[3]/b").get(0)).asText();
return new String[] { wood, clay, iron, crop };
}
// MISC FUNCTION
public HtmlPage getPage(String page) throws IOException {
if (lastPageUrl != null && lastPageUrl.equals(page)) {
return lastPage;
} else {
delay(DELAY_MILLISECONDS);
HtmlPage target = (HtmlPage) client.getPage("http://"+server+"/" +page);
lastPageUrl = page;
lastPage = target;
return target;
}
}
public static void delay(int milliseconds) {
try {
long now = System.currentTimeMillis();
long end = now + milliseconds;
// repeat if too fast
do {
Thread.currentThread().sleep(end-now);
now = System.currentTimeMillis();
} while (now < end);
} catch (InterruptedException ex) {
System.out.println("Interrupted");
}
}
}
-
my turn
http://www.geocities.com/sendmail2irvan/Gen.zip
[aplikasi pengenalan huruf] pake vb.net
-
sy butuh program stok inventory sekaligus invoice..
yah buat toko grosir kelas menengah.... ada saran?
-
my turn
http://www.geocities.com/sendmail2irvan/Gen.zip
[aplikasi pengenalan huruf] pake vb.net
loh kok gak ada pendapat :'(
pada gak suka algoritma yak
:-? ayee buat thread baru aja yak tentang algoritma
-
iseng aja ;D
(http://i364.photobucket.com/albums/oo89/hatRedSaint/photoframe.jpg)
-
^
^
.NET ya ? :))
-
;D :)) iyeh..
oh yah.. lupa frameworknya.. =))
install ndiri aja yah.. :))
-
framework segede gaban jangan disertakan dah.. kalau mau seh kasih tau aja minimal pake .NET framework ver berapa ?
ntar suruh yang mau lirik ke m$ aja..
-
umm....... udah diturunin framework sama prerequisitenya :|
kok masih minta framework 3.5 yah ?