xml Element

Programming/C# 2016. 8. 2. 16:50

xml 내가사용했던것만.. 더 있지만 간단한것부터..


<1>                           <----------   Element

<2></2>               <----------- Element 1의  Child

</1>


// 소스는 아니니 참고하여 파일에서 가져오는지 아닌지 확인하고 만들것.


Element 객체를 만들고 CreateElement 1(<1>을 사용했기때문)

elementName.AppendChild(CreateNode 2)

하면 위와 같은 형태로 저장 할 수 있다.


elementName.AppendChild(CreateNode 3)을 하나 더 썻다면.

<1>                           <----------   Element

<2></2>               <----------- Element 1의  Child

<3></3>

</1>

위와 같은 형태가 된다.


<1>

<2>

<3>

</3>

</2>

</1>


위와 같은 형태로 만들고 싶다면


Element 객체를 3개를 만들어야 하며,  InnerText 를 이용하여

하위 Element를 포함해주어야 한다.

블로그 이미지

SherryBirkin

,

"일반적으로 String은 다 똑같다." 라고 알고있었는데


C++으로 코딩을 해보니 같은 String이지만


std::String과 닷넷String은 다르다


그래서 std::string으로 변수사용을 했다면 컨트롤에 있는 Text를


해당 변수에 넣어주기 위해서는 변환해주어야 한다.



std::string -> System::String 변환방법


#include <msclr\marshal_cppstd.h> // 헤더 추가하고


std::string 변수명 = mslr::interop::marshal_as<std::string>(System::String의 TEXT);



System::String -> std::string 변환방법


String^ temp = gcnew String(System::String변수명.c_str());



위와 같은 방법을 쓰면 변환이 가능하다.



블로그 이미지

SherryBirkin

,

숫자야구 할 때 

경우의 수를 추려 주는 프로그램


Html + JavaScript

Number_BaseBall.html

src.js



C#

NumberBaseball.exe


C++

NumberBaseBall_C .exe



블로그 이미지

SherryBirkin

,