C#/NTFSアクセス権の設定
をテンプレートにして作成
Search in
this wiki
and
or
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
#ref(ntfs.png,around,right);
NTFSでは、フォルダやファイルに対して、Windowsグループま...
他にもやり方はあるでしょうが、[[David Hall氏:http://www...
*** NT Security Classes for .NET(mmsseclib.dll)のコンパイル
まず、[[The Code ProjectのWebサイト:http://www.codeproj...
公開されているソースをVisualStudio.NET2003でビルドする...
#ref(builderror.png,center);
どうもヘッダファイルのinclude順序に問題があるようです。...
using namespace System;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Principal;
using namespace Win32;
#include "enums.h"
#include "mgdhelp.h"
#include <lm.h>
という記述順序を
using namespace System;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Security::Principal;
using namespace Win32;
#include <lm.h>
#include "enums.h"
#include "mgdhelp.h"
using namespace System::Runtime::InteropServices;
に変更してビルドすると成功するはずです。
*** NT Security Classes for .NETの利用法
使い方はとてもシンプルです。D:\testフォルダのアクセス権...
SecuredObject sec = new SecuredObject("D:\test", Secured...
//親オブジェクトの権限を継承するか?
sec.Permissions.InheritFromParent = false;
//現在のアクセス権を一旦クリアする
sec.Permissions.Clear();
//ユーザに権限を与える
WindowsUser user1 = new WindowsUser(System.Environment.M...
+ "\\IUSR_" + System.Environment.MachineName);
sec.Permissions.GrantAccess(user1,AccessRights.FileFullC...
AceInheritanceFlags.ContainerInherit|AceInheritanceF...
//グループに権限を与える
WindowsUser user2 = new WindowsUser(System.Environment.M...
sec.Permissions.GrantAccess(user2,AccessRights.FileFullC...
AceInheritanceFlags.ContainerInherit|AceInheritanceF...
//Buildinグループを直接指定して権限を与える
sec.Permissions.GrantAccess(WindowsUser.WellKnownIdentit...
AceInheritanceFlags.ContainerInherit|AceInheritanceF...
[[NT Security Classes for .NET:http://www.codeproject.c...
終了行:
#ref(ntfs.png,around,right);
NTFSでは、フォルダやファイルに対して、Windowsグループま...
他にもやり方はあるでしょうが、[[David Hall氏:http://www...
*** NT Security Classes for .NET(mmsseclib.dll)のコンパイル
まず、[[The Code ProjectのWebサイト:http://www.codeproj...
公開されているソースをVisualStudio.NET2003でビルドする...
#ref(builderror.png,center);
どうもヘッダファイルのinclude順序に問題があるようです。...
using namespace System;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Principal;
using namespace Win32;
#include "enums.h"
#include "mgdhelp.h"
#include <lm.h>
という記述順序を
using namespace System;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Security::Principal;
using namespace Win32;
#include <lm.h>
#include "enums.h"
#include "mgdhelp.h"
using namespace System::Runtime::InteropServices;
に変更してビルドすると成功するはずです。
*** NT Security Classes for .NETの利用法
使い方はとてもシンプルです。D:\testフォルダのアクセス権...
SecuredObject sec = new SecuredObject("D:\test", Secured...
//親オブジェクトの権限を継承するか?
sec.Permissions.InheritFromParent = false;
//現在のアクセス権を一旦クリアする
sec.Permissions.Clear();
//ユーザに権限を与える
WindowsUser user1 = new WindowsUser(System.Environment.M...
+ "\\IUSR_" + System.Environment.MachineName);
sec.Permissions.GrantAccess(user1,AccessRights.FileFullC...
AceInheritanceFlags.ContainerInherit|AceInheritanceF...
//グループに権限を与える
WindowsUser user2 = new WindowsUser(System.Environment.M...
sec.Permissions.GrantAccess(user2,AccessRights.FileFullC...
AceInheritanceFlags.ContainerInherit|AceInheritanceF...
//Buildinグループを直接指定して権限を与える
sec.Permissions.GrantAccess(WindowsUser.WellKnownIdentit...
AceInheritanceFlags.ContainerInherit|AceInheritanceF...
[[NT Security Classes for .NET:http://www.codeproject.c...
ページ名: