社区
C#
帖子详情
C#程序中用到CString,要using什么东西?
wxyidong
2005-09-02 04:49:04
C#程序中用到CString,要using什么东西?
...全文
995
15
打赏
收藏
C#程序中用到CString,要using什么东西?
C#程序中用到CString,要using什么东西?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
15 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zhaoliang_chen
2006-04-25
打赏
举报
回复
CString可以用String代替
Losthk
2006-04-25
打赏
举报
回复
CString能用什么别的东西代替么??
LMTZ
2005-09-13
打赏
举报
回复
TO TomMax(笑望人生) :
你好,高手!
你刚才所说的C++的标准库里面的char[]应该是string类吧?
CString是MFC中提供的吧?
你说是用dllimport可以引入dll, dllimport是什么东西,麻烦你给大家详细解释一下吧!
sdd330
2005-09-13
打赏
举报
回复
没用到过CString学习
屡败屡战数马援
2005-09-13
打赏
举报
回复
CString 是C风格字符串,大家不懂不要乱说。
C风格字符串实际上是一个char[],CString在C++的标准库里面有支持,你看看是否有C++的静态dll链接库,找到了用dllimport就可以使用了。
LMTZ
2005-09-13
打赏
举报
回复
C#里没有CString这个类!
这是MFC中的类吧!
C#中你可以用
System.String
或者
System.Text.StringBuilder
hnldsfww
2005-09-13
打赏
举报
回复
迷糊...请勿打扰
sillybirdustc
2005-09-02
打赏
举报
回复
一定是从网上或什么三流书上人家自己写的类
Samen168
2005-09-02
打赏
举报
回复
呵呵,实在没听说有CString在C#里
泥巴潭
2005-09-02
打赏
举报
回复
using System.Text;
要是用到StringBuilder类还要声明using System.Text.StringBuilder
JasonHeung
2005-09-02
打赏
举报
回复
用string 或者StringBuilder代替,
using System.Text;
givenchy
2005-09-02
打赏
举报
回复
c#里没这个东西。
wxyidong
2005-09-02
打赏
举报
回复
楼上两个都不是。
hzw66
2005-09-02
打赏
举报
回复
System.Runtime.InteropServices.MarshalAsAttribute
forcool
2005-09-02
打赏
举报
回复
using System.Text;
在VC
中
使用XMLHTTP
主 题: 在VC
中
使用XMLHTTP,怎样初始化,怎样建立连接?在线等。 我的一段代码在.NET
中
用
C#
已经调通,我想搬到VC++ 6.0上,但不知道任何各种写法规则。
C#
中
为: MSXML2.XMLHTTP xmlHttp_ = new XMLHTTP(); xmlHttp_.open("PROPFIND", serverUrl, false, username, password); xmlHttp_.send(null); 放到VC++ 6.0
中
应为什么? 以下是我写的,但运行出错。 #import "msxml4.dll"
using
namespace MSXML2; HRESULT hr; //MSXML2::IXMLHTTPRequest pIXMLHttpRequest; C
String
serverUrl ="http://services.msn.com/svcs/hotmail/httpmail.asp"; MSXML2::IXMLHTTPRequestPtr pIXMLHttpRequest; pIXMLHttpRequest.CreateInstance("Msxml2.XMLHTTP.4.0"); if (pIXMLHttpRequest==NULL) AfxMessageBox("pIXMLHttpRequest error"); try { // Create XMLHttpRequest object and initialize pIXMLHttpRequest. hr = pIXMLHttpRequest->open(_bstr_t(_T("PROPFIND")), _bstr_t(_T(serverUrl)), _variant_t(VARIANT_FALSE), _variant_t("test5_12"), _variant_t("1234567")); if(SUCCEEDED(hr)) ::MessageBox(NULL, _T("Success !"), _T(""), MB_OK); } catch(...) { //DisplayErrorToUser(); AfxMessageBox("error"); } 在调用方法open的时候出错! 回复人: masterz(www.fruitfruit.com) ( ) 信誉:273 2003-06-10 21:34:02Z 得分:20 ? #import "msxml.dll" #import "msxml2.dll"
using
namespace MSXML2; int main(int argc, char* argv[]) { printf("Test of XMLHTTP by masterz!\n"); CoInitialize(NULL); try { IXMLHTTPRequestPtr xmlrequest; xmlrequest.CreateInstance("Msxml2.XMLHTTP"); _variant_t varp(false); xmlrequest->open(_bstr_t("GET"),_bstr_t("http://www.csdn.net/expert/topic/855/855052.xml?temp=.176037"),varp); xmlrequest->send(); BSTR bstrbody; xmlrequest->get_responseText(&bstrbody); _bstr_t bstrtbody(bstrbody); printf("%s\n",(LPCTSTR)bstrtbody); } catch (_com_error &e) { printf("Description = '%s'\n", (char*) e.Description()); } CoUninitialize(); printf("program end\n"); return 0; } ///////Post with XMLHTTP/////////////////////// #import "msxml.dll" #import "msxml2.dll" #include "Atlbase.h"
using
namespace MSXML2; int main(int argc, char* argv[]) { printf("Test of XMLHTTP by masterz!\n"); CoInitialize(NULL); try { IXMLHTTPRequestPtr xmlrequest; //xmlrequest.CreateInstance("Msxml2.XMLHTTP"); xmlrequest.CreateInstance(__uuidof(XMLHTTP)); CComVariant vFalse(FALSE); CComVariant vNull(NULL); xmlrequest->open("POST", _bstr_t("http://211.157.102.21/member/logon.asp"),vFalse,vNull,vNull); xmlrequest->setRequestHeader("Content-Type:","application/x-www-form-urlencoded"); _bstr_t bsdata("name=xxx&pass=xxx&type=1");//use your login name and password xmlrequest->send(_variant_t(bsdata)); BSTR bstrbody; xmlrequest->get_responseText(&bstrbody); _bstr_t bstrtbody(bstrbody); printf("%s\n",(LPCTSTR)bstrtbody); //MessageBox(0,bstrtbody,"",MB_OK); } catch (_com_error &e) { printf("Description = '%s'\n", (char*) e.Description()); } CoUninitialize(); printf("program end\n"); return 0; }
C
String
的GetBuffer用法,GetBuffer本质,GetBuffer常见问题解决方法
一.函数原型 C
String
::GetBuffer LPTSTR GetBuffer( int nMinBufLength ); throw( CMemoryException ); Return Value An LPTSTR pointer to the obje
c#
简答题题库_
C#
练习题
一、单项选择题1.在类作用域
中
能够通过直接使用该类的( )成员名进行访问。A. 私有 B. 公用 C. 保护 D. 任何2.小数类型(decimal)和浮点类型都可以表示小数,正确说法:( )A. 两者没有任何区别B. 小数类型比浮点类型取值范围大C.小数类型比浮点类型精度高D. 小数类型比浮点类型精度低3.能作为
C#
程序
的基本单位是( )。A. 字符...
VC++直接操作使用
C#
类库基本操作
C#
简单易操作,而且有比较丰富的类库, 方便处理各种情况,比如来说处理字符串,我觉得用
C#
就比较的方便,或者是用java之类的,用C++处理起来感觉比较繁琐,所以在用VC进行编程的时候放着
C#
不用感觉蛮可惜,好了,废话不多说,进入正题! 开发环境:VS2005,VC++ 项目:VC++ MFC 1,使用的环境条件 新建一个VC++的项目: 首先环境配置,右键项目-->属性-->配置
大学生
c#
期末复习题库 选择题,填空题,判断题(含答案)
161、在
C#
程序
中
,显示一个信息为“This is a test!45、在
C#
的类结构
中
,class关键字前面的关键字是表示访问级别,下面哪个关键字的访问级别是表示只有在同一个
程序
集内,且内部类型或成员才是可访问的?255、类声明后,可以创建类的实例,创建类的实例要使用(new)关键字,类的实例相当于一个变量,创建类的实例的格式如:(类名 对象名= new 对象名())139、在定义类时,如果希望类的某个方法能够在派生类
中
进一步进行改进,以处理不同的派生类的需要,则应将该方法声明为(virtual)。
C#
110,499
社区成员
642,576
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章