سورس تغییر دادن ویژگی های فایل-مخفی-سیستمی-read only

بازدید42.4kپست ها2آخرین فعالیت10 سال پیش
0
0

سلام این کد Attribute فایل مشخص شده رو تغییر میده
چهار تا Check box بذارید نا نام های خواسته شده و یه Button

سورس:

Dim ListOfAttributes As Integer
        Dim filep As New OpenFileDialog
        If chkArchive.Checked = True Then
            ListOfAttributes += FileAttributes.Archive
        End If

        If chkHidden.Checked = True Then
            ListOfAttributes += FileAttributes.Hidden
        End If

        If chkReadOnly.Checked = True Then
            ListOfAttributes += FileAttributes.ReadOnly
        End If

        If chkSystem.Checked = True Then
            ListOfAttributes += FileAttributes.System
        End If
        filep.ShowDialog()
        File.SetAttributes(filep.FileName, ListOfAttributes)
0

این کد رو به زبان ++C لطفا برام بذارید اگر امکان داره ممنون میشم

0
#using <mscorlib.dll>

using namespace System;
using namespace System::IO;
using namespace System::Text;

void main() {
String* path = S"c:\\temp\\MyTest.txt";
// Delete the file if it exists.
if (!File::Exists(path)) {
File::Create(path);
}

if ((File::GetAttributes(path) & FileAttributes::Hidden) ==
FileAttributes::Hidden) {
// Show the file.
File::SetAttributes(path, FileAttributes::Archive);
Console::WriteLine(S"The {0} file is no longer hidden.", path);
} else {
// Hide the file.
File::SetAttributes(path,
static_cast<FileAttributes>(File::GetA… |
FileAttributes::Hidden));
Console::WriteLine(S"The {0} file is now hidden.", path);
}
}

_find, _wfind Functions (CRT)
Retrieving and Changing File Attributes (Windows)

سوال برنامه نویسی دارید؟

ندونستن عیب نیست، نپرسیدن چرا!

خوش آمدید

برای طرح سوال، ایجاد بحث و فعالیت در سایت نیاز است ابتدا وارد حساب کاربری خود شوید. در صورتی که هنوز عضو سایت نیستید میتوانید در عرض تنها چند ثانیه ثبت نام کنید.