菜鳥求助(代碼轉化),請大家幫忙。。。

jackyhyoung jackyhyoung 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
下面的代碼可不可以轉用C語言或者是CVI來寫,各位大俠請幫幫忙寫一下,多謝。。
private: System::Void Form1_Load(System::Object * sender, System::EventArgs * e)
{
//**** Read INI

String* fileName;
String* add;
String* line;
int platform;

// create the application path and name
fileName = String::Concat( Directory::GetCurrentDirectory(), S"\\add.ini");

//Check INI Existence
if (File::Exists(fileName)) //Exist
{
FileStream* fs = new FileStream(fileName, FileMode::Open);
StreamReader* sr = new StreamReader(fs);


if (sr->Peek() >= 0) //Loop until end of file
{
line = sr->ReadLine();
if ( parseItemValue(line)->Length > 0 )
{
this->txtAddress->Text = parseItemValue(line);
}
else
{
MessageBox::Show(S"INI File Corrupted!");
this->btnDownload->Enabled = false;
}
}
fs->Close();
sr->Close();
fs = NULL;
sr = NULL;
}
else
{
MessageBox::Show(S"INI File Corrupted!");
this->btnDownload->Enabled = false;
}
//==================
String* getFileNameFrPath(String* path)
{
String* result;
int ptr;

ptr = path->LastIndexOf(S"\\");

result = path->Substring(ptr+1);
result = String::Concat(Directory::GetCurrentDirectory(),S"\\", result );
return result;
}
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
jackyhyoung
VC.NET 7,538 成员 27,670 内容