I m试图允许用户使用其当地扫描仪,通过载有浏览器粉面的IIS as页,使用终端服务器。 粉碎机可以扫描文档,并将数据传送到一个星页上,把文件上载到服务器。
I m 采用HttpContext。 现任。 用户。 姓名,包括载有遥远用户名称的画面。 如何在终端服务器上找到用户文件夹?
I m试图允许用户使用其当地扫描仪,通过载有浏览器粉面的IIS as页,使用终端服务器。 粉碎机可以扫描文档,并将数据传送到一个星页上,把文件上载到服务器。
I m 采用HttpContext。 现任。 用户。 姓名,包括载有遥远用户名称的画面。 如何在终端服务器上找到用户文件夹?
取得了一定的进展。 这里为使用Powerhell的已知用户名找到一条途径:
$user = Get-WmiObject Win32_UserAccount | Where-Object { $_.Name -eq known_username }
cd HKLM:softwareMicrosoftWindows NTCurrentVersionProfileList
$key = Get-Item $user.SID
$saveLocation = $key.GetValue("ProfileImagePath")
C#版本:
string loginName = HttpContext.Current.User.Identity.Name;
Regex r = new Regex(@"w+[\]");
string userName = r.Replace(loginName, "");
throw new System.ArgumentException("Debug: " + HttpContext.Current.User.Identity.IsAuthenticated.ToString() +" ", "userName");
SelectQuery sQuery = new SelectQuery("Win32_UserAccount", "name= " + userName + " ");
ManagementObjectSearcher mSearcher = new ManagementObjectSearcher(sQuery);
string sid = "";
foreach (ManagementObject mObject in mSearcher.Get())
{
sid = mObject["SID"].ToString();
break; //mSearcher.Get() is not indexable. Behold the hackyness!
}
string saveLocation = Microsoft.Win32.Registry.GetValue(
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\" + sid,
"ProfileImagePath", null).ToString();
C#不是我的母语;可能有一些方法可以做到这一点,但这种方式不太unt。 但does工作。
In my webpages I have references to js and images as such: "../../Content/Images/"Filename" In my code if I reference a file as above, it doesnt work so i have to write: "c:/miscfiles/"filename" 1-...
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
I m looking for best practices here. Sorry. I know it s subjective, but there are a lot of smart people here, so there ought to be some "very good" ways of doing this. I have a custom object called ...
I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...
i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...
For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?
I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!