C++μμ Managed ν΄λμ€λ₯Ό μ¬μ©νκ³ μΆλ€!
λλΆλΆ κΈλ€μ΄ C#μμ λ€λ₯Έ μΈμ΄λ‘ κ°λ°ν dllμ΄λ ν¬ν
μ λμμλλ° κ±°κΎΈλ‘ νλ λ°©λ²μ μλμ μλ κ² κ°μμ μν΄λ€μ΄ μ¬μ¬ν΄μ λ§λ€μ΄λ³΄λ λμνλκ΅°μ κ·Έλμ 곡μ λ립λλ€.
μμλ‘ μ
λ ₯λ μ£Όμλ‘λΆν° html μ½λλ₯Ό μ€ν¬λννλ ν΄λμ€λ₯Ό λ©νν΄λ³΄μμ΅λλ€.
μμ
C# μ½λ
namespace ConsoleSharp
{
internal class Program
{
static void Main(string[] args)
{
var scrapper = new SharpScrapperLib.SimpleScraper();
var html = scrapper.GetHtml("https://www.naver.com");
System.Console.WriteLine(html);
}
}
}
C++ μ½λ
#include <iostream>
#include <expInteropScrapper.h>
void main()
{
try {
auto scrapper = expInterop::expInteropScrapper::create();
auto html_content = scrapper->getHtml("https://www.naver.com");
std::cout << html_content << std::endl;
}
catch (std::exception ex) {
}
}

