C#调用telnet
aix服务器,使用c#调用telnet时执行df,vmstat等命令的时候一切正常,可是在执行topas的时候返回的就不理想了,我需要取执行topas结果中的PAGING SPACE,可是topas命令执行后是每两秒自动刷新结果的,这样我取回来的值中需要的地方貌似都是些占位符,这可怎么解决好?TelnetClient client = new TelnetClient();
string connectResult = client.Connect("10.98.38.8", 23, "root", "root", 1000);
DisplayProcess(connectResult.ToString());
client.Send("df -g", 500);
string ss = client.Receive();
DisplayProcess(ss);
client.Send("vmstat 3 3", 10000);
DisplayProcess(client.Receive());
client.Send("export TERM=vt100", 1000);
//DisplayProcess(client.Receive());
client.Send("topas", 10000);
DisplayProcess(client.Receive());
执行topas后返回的数据是这样的:(乱七八糟)
$ topas
=[?7h[?1l(B=[m(B[H[2JTopas Monitor for host: metro1_1[13CEVENTS/QUEUES FILE/TTY
Tue Jun 11 16:56:58 2013 Interval: 2[9CCswitch[10CReadch
[23DSyscall[10CWritech
CPU [;7m(BUser%[2C[m(BKern% Wait% Idle%[17CReads[12CRawin
[22DWrites[11CTtyout
[23DForks[12CIgets
[22DExecs[12CNamei
[22DRunqueue[9CDirblk
[23DWaitqueue
[9DPAGING[11CMEMORY
[23DFaults[11CReal,MB
[24DSteals[11C% Comp
[23DPgspIn[11C% Noncomp
[26DPgspOut[10C% Client
[25DPageIn
[6DPageOut[10CPAGING SPACE
[29DSios[13CSize,MB
[7D% Used
[23DNFS (calls/sec) % Free
[23DServerV2
[8DClientV2[11CPress:
[25DServerV3[11C"h" for help
[31DClientV3[11C"q" to quit[18A[69D[H[2JTopas Monitor for host: metro1_1[13CEVENTS/QUEUES FILE/TTY
Tue Jun 11 16:56:58 2013 Interval: 2[9CCswitch[10CReadch
[23DSyscall[10CWritech
CPU [;7m(BUser%[2C[m(BKern% Wait% Idle%[17CReads[12CRawin
[22DWrites[11CTtyout
[23DForks[12CIgets
Network [;7m(BKBPS[3C[m(BI-Pack O-Pack KB-In KB-Out Execs[12CNamei
[22DRunqueue[9CDirblk
[23DWaitqueue
[9DPAGING[11CMEMORY
Disk Busy% [;7m(BKBPS[5C[m(BTPS KB-Read KB-Writ Faults[11CReal,MB
[24DSteals[11C% Comp
[23DPgspIn[11C% Noncomp
[26DPgspOut[10C% Client
[25DPageIn
[6DPageOut[10CPAGING SPACE
[29DSios[13CSize,MB
[7D% Used
[23DNFS (calls/sec) % Free
[23DServerV2
[8DClientV2[11CPress:
[25DServerV3[11C"h" for help
[31DClientV3[11C"q" to quit[17A[69D[2A
ALL 0.0 0.0 0.0 0.0[8B
dac0[6C0.0 4.7K 75.0 4.7K 0.0
hdisk3 0.0 4.7K 75.0 4.7K 0.0
dac1[6C0.0 0.0[6C0.0 0.0 0.0[8A[36D[10B
Name[12CPID CPU% PgSp Owner
dataserv 258208 0.0 6.4 sybase
dataserv 250010 0.0 6.5 sybase
dataserv 291214 0.0 7.3 sybase
dataserv 192566 0.0 6.6 sybase
dataserv 344374 0.0 6.4 sybase
dataserv 274938 0.0 6.6 sybase
dataserv 221580 0.0 6.4 sybase[17A[29D[H
[15C7:00
[12D1.3 2.3 18.6 77.7
en0[7C7.3 19.0 7.0 6.3 1.0
en2[7C1.1[6C4.0 7.0 0.3 0.8
lo0[7C0.6[6C3.5 3.5 0.3 0.3
hdisk3 10[7C27.9K 457.0 27.8K 76
dac0 [11C27.9K 457.0 27.8K 76[7A[34D[H
[59C4634[12C28.0M
[58C11488[12C82682
[60C527[16C0
[60C381[14C694
[62C0[16C0
[62C1[14C340
[60C0.5[16C0
[60C0.0
242[12C15712
[62C0[13C84
[16D0[13C15
[16D0[13C15
[16D0
0
[49D21580 1.6[37C0[12C16384
aioserve 438664 0.5 0.4 root [39C0
topas 89714[6C3 3.4 whafc [37C100
[65D274938 0.1[38C0
[51D29121[6C1 7.3[32C0
[51D192566 0.1[38C0
aioserve 69672[6C1 0.4 root [25C0[17A[55D[H
[18C2
[10D5[6C7 21.0 74.8
[22D10[7C26.5 9[7C9.2[7C1
[34D3[8C5 8.5[13C1.0
[36D1.2[6C6.0 6.0[7C6[7C6
[38D 95[6C32.4K 533.0 32.2K 112
[26D32.4K 533.0 32.2K 112[7A[34D[H
[59C5245[12C32.3
[19D341[11C114.0K
[61C41
680[14C820
[62C0[14C101
[62C0
37[6B[41D2.1
3
aioserve 663920 0.2 0.4 root
aioserve 696720 0.2 0.4 root
[25D34437[6C2 6.4
dataserv 274938[9C6.6 sybase[17A[29D[H
[18C4
[10D6[6C3 19.5 76.6
[22D 9.0[8C0 6[7C8[7C0.8
[36D2.0[6C5.0 12.0[15C7
[36D0.5[6C2.5 2.5[7C3[7C3
[37D8[7C27.8K 456.0 27.7K 84
[26D27.8K 456.0 27.7K 84[7A[34D[H
[59C4598[12C27.7
[21D 9959[11C 87429
[60C463
346[14C549
[77C 98
[62C5
11[6B[41D1.7
5
3
dataserv 344374 0.3 6.4 sybase
[25D29121[10C7.3[15A[22D[H
[18C6
[12D9.5[6C0 10.6 77.9
[23D213.2 387.5[7C5 212.3[7C9
[38D118.1[12C377[9C4 117
[32D7[6C4[7C4[9C4[7C4
[37D40[6C10.0K 179.0 9.9K 160
[26D10.0K 179.0 9.9K 160[7A[34D[H
[59C3873[12C10.1
[21D11400[11C161.2K
[60C17
54[15C98
[79C9
[62C9[6B[42D10.1
[12D663920 0.3
dataserv 344374[9C6.4 sybase
[25D192566 0.2 6.6
aioserve 43866[6C1 0.4 root
[25D274938
topas 786470[9C4.4 whafc [17A[29D aix c# telnet topas
补充:.NET技术 , C#