1>c:\users\kid account\documents\visual studio 2010\projects\final pinger\final pinger\Form1.h(172): error C2039: 'c_str' : is not a member of 'System::String'
1>c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : see declaration of 'System::String'
#pragma once
#include <iostream>
#include "stdafx.h"
#include <Windows.h>
#include <string>
namespace FinalPinger {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:
ata;
using namespace System:
rawing;
/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ label1;
protected:
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Timer^ timer1;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button5;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Required designer variable.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
this->label1 = (gcnew System::Windows::Forms::Label());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
this->button3 = (gcnew System::Windows::Forms::Button());
this->button4 = (gcnew System::Windows::Forms::Button());
this->button5 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System:
rawing:
oint(124, 9);
this->label1->Name = L"label1";
this->label1->Size = System:
rawing::Size(29, 13);
this->label1->TabIndex = 0;
this->label1->Text = L"Host";
//
// textBox1
//
this->textBox1->Location = System:
rawing:
oint(9, 34);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System:
rawing::Size(260, 20);
this->textBox1->TabIndex = 1;
//
// button1
//
this->button1->Location = System:
rawing:
oint(34, 69);
this->button1->Name = L"button1";
this->button1->Size = System:
rawing::Size(82, 2
;
this->button1->TabIndex = 2;
this->button1->Text = L"Start";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// button2
//
this->button2->Location = System:
rawing:
oint(157, 69);
this->button2->Name = L"button2";
this->button2->Size = System:
rawing::Size(88, 2
;
this->button2->TabIndex = 3;
this->button2->Text = L"Stop";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
//
// timer1
//
this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick);
//
// button3
//
this->button3->Location = System:
rawing:
oint(12, 115);
this->button3->Name = L"button3";
this->button3->Size = System:
rawing::Size(77, 26);
this->button3->TabIndex = 4;
this->button3->Text = L"Fast";
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click);
//
// button4
//
this->button4->Location = System:
rawing:
oint(95, 115);
this->button4->Name = L"button4";
this->button4->Size = System:
rawing::Size(83, 26);
this->button4->TabIndex = 5;
this->button4->Text = L"Medium";
this->button4->UseVisualStyleBackColor = true;
this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
//
// button5
//
this->button5->Location = System:
rawing:
oint(184, 115);
this->button5->Name = L"button5";
this->button5->Size = System:
rawing::Size(77, 26);
this->button5->TabIndex = 6;
this->button5->Text = L"Slow";
this->button5->UseVisualStyleBackColor = true;
this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
//
// Form1
//
this->AutoScaleDimensions = System:
rawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System:
rawing::Size(281, 149);
this->Controls->Add(this->button5);
this->Controls->Add(this->button4);
this->Controls->Add(this->button3);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->label1);
this->Name = L"Form1";
this->Text = L"Death Pinger";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Start();
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Stop();
}
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) {
system (("Ping" + (textBox1->Text)->c_str()));
}
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Interval = 50;
}
private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Interval = 100;
}
private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Interval = 250;
}
};
}
1>c:\users\kid account\documents\visual studio 2010\projects\final pinger\final pinger\Form1.h(172): error C2039: 'c_str' : is not a member of 'System::String'
1>c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : see declaration of 'System::String'
#pragma once
#include <iostream>
#include "stdafx.h"
#include <Windows.h>
#include <string>
namespace FinalPinger {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:
ata;
using namespace System:
rawing;
/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ label1;
protected:
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Timer^ timer1;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button5;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Required designer variable.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
this->label1 = (gcnew System::Windows::Forms::Label());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
this->button3 = (gcnew System::Windows::Forms::Button());
this->button4 = (gcnew System::Windows::Forms::Button());
this->button5 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System:
rawing:
oint(124, 9);
this->label1->Name = L"label1";
this->label1->Size = System:
rawing::Size(29, 13);
this->label1->TabIndex = 0;
this->label1->Text = L"Host";
//
// textBox1
//
this->textBox1->Location = System:
rawing:
oint(9, 34);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System:
rawing::Size(260, 20);
this->textBox1->TabIndex = 1;
//
// button1
//
this->button1->Location = System:
rawing:
oint(34, 69);
this->button1->Name = L"button1";
this->button1->Size = System:
rawing::Size(82, 2
;
this->button1->TabIndex = 2;
this->button1->Text = L"Start";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// button2
//
this->button2->Location = System:
rawing:
oint(157, 69);
this->button2->Name = L"button2";
this->button2->Size = System:
rawing::Size(88, 2
;
this->button2->TabIndex = 3;
this->button2->Text = L"Stop";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
//
// timer1
//
this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick);
//
// button3
//
this->button3->Location = System:
rawing:
oint(12, 115);
this->button3->Name = L"button3";
this->button3->Size = System:
rawing::Size(77, 26);
this->button3->TabIndex = 4;
this->button3->Text = L"Fast";
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click);
//
// button4
//
this->button4->Location = System:
rawing:
oint(95, 115);
this->button4->Name = L"button4";
this->button4->Size = System:
rawing::Size(83, 26);
this->button4->TabIndex = 5;
this->button4->Text = L"Medium";
this->button4->UseVisualStyleBackColor = true;
this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
//
// button5
//
this->button5->Location = System:
rawing:
oint(184, 115);
this->button5->Name = L"button5";
this->button5->Size = System:
rawing::Size(77, 26);
this->button5->TabIndex = 6;
this->button5->Text = L"Slow";
this->button5->UseVisualStyleBackColor = true;
this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
//
// Form1
//
this->AutoScaleDimensions = System:
rawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System:
rawing::Size(281, 149);
this->Controls->Add(this->button5);
this->Controls->Add(this->button4);
this->Controls->Add(this->button3);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->label1);
this->Name = L"Form1";
this->Text = L"Death Pinger";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Start();
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Stop();
}
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) {
system (("Ping" + (textBox1->Text)->c_str()));
}
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Interval = 50;
}
private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Interval = 100;
}
private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Interval = 250;
}
};
}
Copyright © 2026, NextGenUpdate.
All Rights Reserved.