永发信息网

vb中修改文本的指定行

答案:2  悬赏:10  手机版
解决时间 2021-01-25 02:32
500T冷端中控室: d:\a.txt中有以下字符:
AA
AB
AC
AD
AE
AF
等等,有几千项

Open "D:\a.txt" For Input As #1
Do Until EOF(1)
Line Input #1, a
Ds1 = Ds1 & a & vbCrLf
Loop
Close
ds2 = Split(Ds1, vbCrLf)

怎样直接修改ds2数组里的指定项.
如直接把AE改成AD.不要全部重新写入.
最佳答案
加个计数的,读到某行后,改了在转存到另一个文本内。
全部回答
vb.net中删除指定文本文档中的指定行内容代码: yval hwnd as intptr, _ byval wmsg as int32, _ byval wparam as int32, _ byval lparam as string _ ) as int32 private overloads declare auto function sendmessage lib "user32" ( _ byval hwnd as intptr, _ byval wmsg as int32, _ byval wparam as int32, _ byval lparam as int32 _ ) as int32 private const em_getline as int32 = &hc4 private const em_getlinecount as int32 = &hba private const max_char_per_line as int32 = &h100 private const em_linelength as int32 = &hc1 private const em_lineindex as int32 = &hbb private function getline(byval text as textboxbase, byval line as integer) as string dim dwlinestart as int32 = sendmessage(text.handle, em_lineindex, line, 0) dim dwlinelen as integer = sendmessage(text.handle, em_linelength, dwlinestart, 0) dim buff as string = chr(dwlinelen and &hff) & chr(dwlinelen / &h100) & space(dwlinelen) dim dwlen as int32 = sendmessage(text.handle, em_getline, line, buff) getline = strings.left(buff, dwlen) end function private sub button3_click_1(byval sender as system.object, byval e as system.eventargs) handles button3.click dim g as graphics = textbox1.creategraphics() dim w as integer = ctype(g.measurestring(textbox1.text, textbox1.font).width, integer) dim s as string = getline(textbox1, 0) msgbox(s) end sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
顺意旅社(莘县黄河河务局北)地址在哪,我要去
lol中有没有类似飞船的英雄
谁能给我一个铅笔画出曲线的字符号,我打不出
【法的渊源指的是】法的渊源通常是指a法的历
从外貌来描述一下
火葬场是怎么将人火化的
华中旅馆(河南省范县产科急救中心西南)地址有
经典的百听不厌的伤感歌曲、推荐下?
【牧童评画】文言文:牧童评画的译文
德国丝皙茶树清凉洗发水320毫升的批发价是多
鑫华旅馆(Z011)地址有知道的么?有点事想过去
英语翻译要用于传媒广告行业企业文化语
气体反吹式振打有几种
姐姐的守护神拼音
他无故动怒爆跳如雷使人感觉莫名其妙.哪个字
推荐资讯
第十题怎么算?
【二年级好句大全短一点】二年级的夸张句大全
x+y=3 x*y=2,求x和y的值
托福成绩出来后我的一直是Not Available,可
金樽网咖怎么去啊,我要去那办事
宾川县人民检察院反贪局地址有知道的么?有点
某企业想租一辆车,现有甲乙两家汽车出租公司,
【整体护理】整体护理
舟山中通快递电话号码
沭阳县章集中学地址有知道的么?有点事想过去
从1到100个数中任取一个数; 1.能被3整除的数
有谁知道BTA08-600c可以替换BTA08-8cWG吗
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?