| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 792 人关注过本帖
标题:编程问题
只看楼主 加入收藏
zhangqing42
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-12-31
收藏
得分:0 

还是不行哦。

2006-12-31 15:15
zhanghuan_10
Rank: 1
等 级:新手上路
威 望:2
帖 子:751
专家分:0
注 册:2006-10-25
收藏
得分:0 
出错错在了那里?

该学习了。。。
2006-12-31 15:32
zhangqing42
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-12-31
收藏
得分:0 


Private Sub Command1_Click()

Dim Ans As String
Ans = GetOpenFileNameDLG("需要修改的文件 *.*|*.*", "请选择一个文件", "", Me.hwnd)

If Ans <> "" Then
Text1.Text = Ans
End If
Text1.SetFocus

End Sub

Private Sub Command2_Click()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "警告! 你是否想修改 " & Trim(Text1.Text) & " 的内容。 "
Msg = Msg & vbCrLf & vbCrLf & " 强力推荐先备份该文件,然后修改?"
Msg = Msg & vbCrLf & vbCrLf & " 你需要继续吗(Y/N)?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "警告!修改文件处于待命状态."
Response = MsgBox(Msg, Style, Title, Help, Ctxt)

If Response = vbYes Then ' User chose Yes.
MyString = "Yes"
Else
MyString = "No"
End If

If MyString = "Yes" Then
'修改Text1.text的文件中Text2.text内容,替换为Text3.text"
ChangeFile Text1.Text, Text2.Text, Text3.Text
End If
End Sub

Private Sub Command3_Click()

Unload Me

End Sub

Private Sub Form_Load()

Label1.Caption = "选择文件:"
Label2.Caption = "搜索字符:"
Label3.Caption = "替换字符:"
Check1.Caption = "使用通配符 ?"
Check1.Value = 1
Command1.Caption = "选择(&S) ..."
Command2.Caption = "开始替换(&R)"
Command3.Caption = "关闭退出(&E)"
Command3.Cancel = True
Command2.Enabled = False
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""

End Sub

Private Sub Text1_Change()

If Trim(Text2.Text) = "" Or Trim(Text1.Text) = "" Then
Command2.Enabled = False
Else
Command2.Enabled = True
End If

End Sub

Private Sub Text1_GotFocus()

Text1.SelStart = 0
Text1.SelLength = Len(Trim(Text1.Text))

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
Text2.SetFocus
End If

End Sub

Private Sub Text2_Change()

If Trim(Text2.Text) = "" Or Trim(Text1.Text) = "" Then
Command2.Enabled = False
Else
Command2.Enabled = True
End If

End Sub

Private Sub Text2_GotFocus()

Text2.SelStart = 0
Text2.SelLength = Len(Trim(Text2.Text))

End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
Text3.SetFocus
End If

End Sub

Private Sub Text3_GotFocus()

Text3.SelStart = 0
Text3.SelLength = Len(Trim(Text3.Text))

End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
If Command2.Enabled = True Then
Command2.SetFocus
End If
End If

End Sub
帮我看看用这段程序行不行
要改那些语句

2006-12-31 15:41
zhanghuan_10
Rank: 1
等 级:新手上路
威 望:2
帖 子:751
专家分:0
注 册:2006-10-25
收藏
得分:0 
大哥呀,我看不懂,是c语言吗?呵呵,好像不是啊!

该学习了。。。
2006-12-31 15:46
zhangqing42
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-12-31
收藏
得分:0 

Private Sub Command1_Click()

Dim Str() As String, OutStr As String, i As Integer
Str() = Split(Text1.Text, ",")
For i = 0 To UBound(Str)
OutStr = OutStr & Str(i) & Space(3 - Len(Str(i))) & ","
Next i
Text2.Text = OutStr

End Sub

我测试过,Str() = Split(Text1.Text, ",")不行啊

2006-12-31 16:49
liubuwei
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2006-12-27
收藏
得分:0 

#include <stdio.h>
#define m 1000
void main()
{
char str[m];
int a=0,b=0,c,i,j;
gets(str); //输入字符串
for(i=0;i<1000;i++)
{
if(str[i]=='\0')
break;
} //判断字符串长度

while(a<1000)
{
b++;
if(str[a]=='\0')
break;

if(str[a]==','&&b<5)
{
for(j=i;j>=a;j--)
{
str[j+6-b]=str[j];
}
i=j+6-b;

for(c=0;c<6-b;c++)
{
str[a]=' ';
a++;
}


b=0;
}

if(str[a]==',')
b=0;
a++;

} //后移要移的字符

puts(str);
}

还是不行,有谁帮说一下,谢谢了!

2007-01-01 01:45
快速回复:编程问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028499 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved