gpt4 book ai didi

c# - 如何将 C# 转换为 C++

转载 作者:可可西里 更新时间:2023-11-01 15:29:59 26 4
gpt4 key购买 nike

<分区>

有人可以帮我把 C# 转换成 C++ 吗?这是一个例子:

using System;
using System.Net;
using System.Text;
using System.IO;
using System.Threading;
namespace read_website
{
class Program
{
static void Main(string[] args)
{
while (true)
{
DownloadString("http://www.xxx.asp");
Thread.Sleep(100);//update every 100 millisecoand
}
}

public static void DownloadString(string address)
{
WebClient client = new WebClient();
string website = client.DownloadString(address);
get_Current_X1_value(website);
}

static void get_Current_X1_value(string web)
{
int x = web.IndexOf("Current X1 value:");
string part1 = web.Substring(x, 100);
string[] array = part1.Split('>', '<');
for (int i = 0; i < array.Length; i++)
{
if (array[i].Contains("Current X1 value:"))
Console.Write(array[i]);
if (array[i].Contains("W"))
Console.WriteLine(array[i]);
}

}
}
}

实际上,由于在 unix 上混合使用 C# 和 C++ 很复杂,我正在尝试将 C# 转换为 C++

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com