清问怎样设置一个长度为255的buffer,内容为null

huhaha7171 2004-07-20 03:22:33
xie
...全文
88 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jiezhi 2004-07-20
  • 打赏
  • 举报
回复
public class Win32API {
[DllImport("User32.Dll")]
public static extern void GetWindowText(int h, StringBuilder s,
int nMaxCount);
}
public class Window {
internal int h; // Internal handle to Window.
public String GetText() {
StringBuilder sb = new StringBuilder(256);
Win32API.GetWindowText(h, sb, sb.Capacity + 1);
return sb.ToString();
}
}
huhaha7171 2004-07-20
  • 打赏
  • 举报
回复
jiezhi(風依舊) :
我是想用 GetWindowText
不知道该怎么套,您能给个代码吗?

jiezhi 2004-07-20
  • 打赏
  • 举报
回复
byte[] buffer = new byte[255];

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧