void InitializeComponent(void)
{
this->button1 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// button1
//
this->button1->DialogResult = System::Windows::Forms::DialogResult::OK;
this->button1->Location = System::Drawing::Point(91, 84);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(91, 22);
this->button1->TabIndex = 0;
this->button1->Text = L"Make dir";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 262);
this->Controls->Add(this->button1);
this->Name = L"Form1";
this->Text = L"Server Backup";
this->ResumeLayout(false);
}
The specific line is this:
this->button1->DialogResult = System::Windows::Forms::DialogResult::OK;
I later have:
int funct(){
if (DialogResult == System::Windows::Forms::DialogResult::OK)
{
mkdir("C:\\test\\TestDIR");
}
return 0;
}
However, the directory is never made when the button is pressed.
My next issue, is in a command line program, I have:
#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <CString>
#include <direct.h>
#include <string>
#include <time.h>
using namespace std;
bool b = true;
int a;
string path = "c:\\Users\\Admin\\Desktop\\Server\\Test";
int main() {
while(b == true) {
cin >>a;
if (a == 0) {
mkdir("path");
system("xcopy C:\\Users\\Admin\\Desktop\\Servertest c:\\Users\\Admin\\Desktop\\Server\\Test /Y /I /E");
cout <<GetLastError();
}
}
}
The issue is my xcopy, I want to have a variable in the path.
For example, it uses the string path in the xcopy function instead of the entire c:\\users etc,
Also, A user input after the string.
So for example, you'd have string path = "c:\\Users\\Admin\\Desktop\\Server\\Test\\ & $test"
Where test is another string that the user inputs, like
cin >>test; or however.
Can anyone help me?

New Topic/Question
Reply


MultiQuote






|