Cov txheej txheem:

Yuav Ua Li Cas Kom Yooj Yim Sib Tham Hauv Visual Basic Siv Microsoft Winsock Control: 7 Cov Kauj Ruam
Yuav Ua Li Cas Kom Yooj Yim Sib Tham Hauv Visual Basic Siv Microsoft Winsock Control: 7 Cov Kauj Ruam

Video: Yuav Ua Li Cas Kom Yooj Yim Sib Tham Hauv Visual Basic Siv Microsoft Winsock Control: 7 Cov Kauj Ruam

Video: Yuav Ua Li Cas Kom Yooj Yim Sib Tham Hauv Visual Basic Siv Microsoft Winsock Control: 7 Cov Kauj Ruam
Video: yuav coj li cas kom luag nyiam 2024, Hlis ntuj nqeg
Anonim
Yuav Ua Li Cas Yooj Yim Sib Tham Hauv Visual Basic Siv Microsoft Winsock Control
Yuav Ua Li Cas Yooj Yim Sib Tham Hauv Visual Basic Siv Microsoft Winsock Control

Hauv qhov tsis txaus ntseeg no kuv yuav qhia koj yuav ua li cas thiaj yooj yim tham nrog hauv qhov muag pom. Kuv yuav hla txhua qhov chaws ua li ntawd koj yuav kawm raws li koj ua, thiab thaum kawg kuv yuav qhia koj yuav siv nws li cas.

Kauj ruam 1: Txheej txheem cej luam

Txoj Haujlwm Tshiab "," saum ": 0.44341801385681295," sab laug ": 0.2802690582959641," siab ": 0.2632794457274827," dav ": 0.5067264573991032}, {" noteID ":" NJL01ANFG0GJ54J "," sau ":" twenglishlish1 ": "Qhov no yog yam koj xav xaiv ces nyem qhib", "sab saum toj": 0.25635103926096997, "sab laug": 0.017937219730941704, "qhov siab": 0.22401847575057737, "dav": 0.23542600896860988}] ">

Txheej txheem cej luam
Txheej txheem cej luam

Txoj haujlwm no yuav cia koj pauv cov lus ntawm ob tus neeg ntawm koj tib lub network. Nws yuav ua haujlwm yog tias koj tsis nyob hauv tib lub network tab sis kuv tsis tuaj yeem sim nws tam sim no.

Koj yuav tsum muaj Microsoft Visual Basic 6.0, uas yog qhov kuv siv. Kev paub ua haujlwm yooj yim yog pom zoo Cia pib ua haujlwm !!! qhib qhov muag pom yooj yim thiab tsim Tus Qauv EXE

Kauj Ruam 2: Tsim Tus Neeg Siv Tsis Txaus Siab

Tsim Tus Neeg Siv Txoj Cai
Tsim Tus Neeg Siv Txoj Cai
Tsim Tus Neeg Siv Txoj Cai
Tsim Tus Neeg Siv Txoj Cai

Tam sim no nws yog lub sijhawm los tsim tus neeg siv daim ntawv

koj yuav tsum tau ntxiv winsock tswj rau lub cuab yeej ua qhov no los ntawm: 1. txoj nyem rau qee qhov hauv lub thawv ntawv uas tsis muaj dab tsi 2. nyem Cheeb Tsam 3. hauv cov npe ntev pom Microsoft Winsock Control 6.0 thiab khij lub npov ib sab ntawm nws 4. ces nyem thov ces kaw Ntxiv: 5 lub thawv ntawv 4 hais kom ua nyees khawm 1 winsock tswj kom lawv zoo li daim duab thib ob hauv qab no

Kauj Ruam 3: Hloov Npe thiab Lwm Yam Khoom Hloov

Hloov npe thiab Lwm Yam Khoom Hloov
Hloov npe thiab Lwm Yam Khoom Hloov

peb tam sim no yuav hloov pauv cov kab lus (dab tsi yog hais hauv cov lus txib khawm) 1. nyem qhov hais kom ua 12. saib ntawm sab xis hauv cov khoom thiab nrhiav Caption3. hloov nws mus rau Hostdo tib yam rau qhov so tab sis ua rau lawv: command2 = Connectcommand3 = Closecommand4 = Sendnow peb yuav hloov pauv cov kab ntawv hais dab tsi. nyem rau ntawm lub npov ntawv uas hais tias text12. mus rau lub ntsej muag lub ntsej muag thiab nrhiav cov ntawv Cov cuab yeej 3. ua blank4. ua tib yam rau qhov uas hais tias Text25. tam sim no nyem text3 thiab hloov cov ntawv ntiag tug mus rau 127.0.0.16. tam sim no nyem text4 thiab hloov cov ntawv ntiag tug mus rau 12347. tam sim no nyem text5 thiab hloov cov ntawv ntiag tug mus rau Name127.0.0.1 yog koj tus IP hauv zos yog li koj tuaj yeem sim qhov program hauv koj lub computer thaum nws ua tiav 1234 yog qhov chaw nres nkoj koj tuaj yeem ua nws txawm koj xav tab sis cia li tso nws 1234 rau tam sim no

Kauj Ruam 4: Hloov Cov Npe Ntawm Cov Khawm thiab Cov Thawv Ntawv

Hloov Cov Npe Ntawm Cov Khawm thiab Cov Thawv Cov Ntawv
Hloov Cov Npe Ntawm Cov Khawm thiab Cov Thawv Cov Ntawv
Hloov Cov Npe Ntawm Cov Khawm thiab Cov Thawv Cov Ntawv
Hloov Cov Npe Ntawm Cov Khawm thiab Cov Thawv Cov Ntawv

peb yuav tsum tau hloov lub npe hais kom ua cov nyees khawm thiab kab ntawv kom ua rau lawv yooj yim dua rau cov cai

1. nyem Text1 thiab mus rau cov khoom thiab nyem rau ntawm lub npe thiab hloov mus rau txtLog Kuv tau xaiv qhov ntawd vim tias nws yog lub cav ntawm cov lus koj xa thiab tau txais 2. ua tib yam rau tus so tab sis ua cov npe: hloov Text2 rau txtSend hloov pauv Text3 to txtIP hloov Text4 rau txtPort hloov Text5 rau txtName hloov Command1 rau cmdHost hloov Command2 rau cmd Txuas txuas Hloov Command3 rau cmd Kaw qhov hloov Command 4 rau cmd Xa hloov Winsock1 rau sckMain tam sim no muaj ib yam ntxiv uas koj xav tau hloov nyem txtLog thiab hauv cov khoom qhov rai pom MultiLine thiab ua kom muaj tseeb cov kauj ruam no yuav ua rau qee qhov tsis meej pem yog tias koj muaj lus nug tshaj tawm cov lus lossis xa kuv

Kauj ruam 5: Coding Command Command Buttons

Coding cov lus txib khawm
Coding cov lus txib khawm

tam sim no nws yog lub sijhawm los sau cov cai rau cov lus txib khawm pib nrog thawj tus cmdHost1. ob npaug nias nws, qhov no yuav coj mus rau qhov chaws window2. nws yuav tsum zoo li qhov noPrivate Sub cmdHost_Click () Xaus Sub3. nkag mus rau tus lej nockckain. LocalPort = txtPort.textsckMain.listennow txhais tau tias txhais li cas ?? kaw qhov ntawd thiab ob npaug nias rau cmdConnectenter tus lej nockMain. RemoteHost = txtIP.textsckMain. RemotePort = txtPort.textsckMain. Connect thawj ob kab hloov RemoteHost thiab RemotePort ntawm winsock (sckMain) mus rau ip thiab chaw nres nkoj peb xav tau sckMain. Connect qhia nws txhawm rau txuas rau ib tus neeg mloog ntawm qhov chaw nres nkoj ntawd thiab ipnow rau kaw qhov sib tw ob npaug nyem rau ntawm cmdClose thiab homckMain.closetxtLog = txtLog.text & "Kev kaw tau kaw!" & vbCrlfthe sckMain.close qhia qhov winsock kom txuas ob txoj kab txuas ntxiv txuas rau txtLogdouble nyem rau ntawm cmdSend thiab typesckMain.senddata "[" & txtName.text & "]" & txtSend.texttxtLog = txtLog.text & "[" & txtName. text & "]" & txtSend.text & vbcrlftxtSend.text = "" thawj ob kab ntawv tsis yog lawm kuv muaj lawv txoj cai hauv tus kws kho thiab nws hloov lawv thaum kuv txuag yog li saib daim duab rau txoj cai codefirst kab xa cov ntawv hauv txtSend thiab koj lub npe hauv txtNamesecond kab ntxiv cov lus koj xa thiab koj lub npe rau txtLogthird kab tshem cov ntawv hauv txtSend

Kauj Ruam 6: Coding Winsock

Coding Winsock
Coding Winsock

tam sim no nws yog lub sijhawm los sau cov winsock! lub npov code nws yuav tsum hais tias: yuam kev nyem lub npov nco thiab xaiv qhov kev thov txuas tam sim no nws yuav tsum tau ua qhov chaw tshiab nkag mus rau codein muaj hom: Yog sckMain.state sckClose thensckMain.closeend ifsckMain.accept requestidtxtLog = txtLog.text & "Txuas rau: "& sckMain. RemoteHostIP & vbcrlffirst thiab kab thib ob txheeb xyuas yog tias winsock (sckMain) raug kaw thiab yog tias nws tsis yog li ntawd nws kaw kab thib plaub kaw qhov yog kab lus qhia rau yav tom ntej qhia rau winsock (sckMain) lees txais kev sib txuas kab thib tsib qhia rau koj tias koj tau txuas nrog los ntawm kev ntxiv kab rau txtLognow peb yuav tsum qhia winsock yuav ua li cas nrog cov ntaub ntawv nws tau txais nyob rau sab xis saum toj ntawm txoj cai qhov rai nyem rau lub npov nco thiab xaiv: DataArrivalnow nkag mus rau tus lej no: dim Cov ntaub ntawv raws li stringsckMain.getdata Data, vbstring txtLog = txtLog.text & data & vbcrlffirst kab ua cov ntaub ntawv ib txoj hlua yog qhov twg cov ntaub ntawv uas tau txais yog yuav muab tso ua ntej nws tau ntxiv rau txtLogsecond kab tau txais cov ntaub ntawv thiab muab nws tso rau hauv cov hlua cov ntaub ntawv raws li kab vbstringthird ntxiv cov ntaub ntawv tau txais rau txtLognow ib zaug ntxiv yog tias nws tsis meej pem thiab koj muaj lus nug tshaj tawm lus lossis xa kuv

Kauj Ruam 7: Siv Txoj Haujlwm/Xaus

Siv Txoj Haujlwm/Xaus
Siv Txoj Haujlwm/Xaus

ok tam sim no kuv yuav qhia koj yuav siv qhov program li cas

hauv qhov pom yooj yim nyem cov ntaub ntawv tom qab ntawd ua project1.exe txuag nws rau koj lub khoos phis tawj yog tias muaj qhov tsis raug tso tawm cov lus tawm thiab kuv yuav sim pab koj tam sim no mus rau qhov chaw koj tau ua qhov program thiab nyem ob zaug nws ob zaug thiab ob txoj haujlwm yuav tsum tshwm rau ntawm ib tus tswv tsev thiab ntawm lwm qhov nyem txuas thiab ntawm qhov koj nyem tus tswv tsev nws yuav tsum hais: Txuas nrog: 127.0.0.1 tam sim no ntaus lub npe rau ob ntawm lawv thiab koj tuaj yeem xa xov ntawm ob qhov nws ua haujlwm ntawm LAN thiab nws tej zaum yuav ua haujlwm ntawm WAN tab sis kuv tsis paub tseeb tawm cov lus qhia rau kuv paub tias kuv tau ua li cas lossis yog koj muaj lus nug lossis yog tias koj tsuas xav zoo li nws yog tias koj nyiam nws lossis tsis nyiam nws ntsuas nws

Pom zoo: