A bit of background. I would like to be able to process text for the line that the caret is on in a WPF RichTextBox. Please see my earlier question about the TextPointer class: How to keep track of TextPointer in WPF RichTextBox?. I know how to get the TextPointer at the start of the current line by using GetLineStartPosition with 0 as the argument but would now like to get the TextPointer at
一点背景。 我希望能够处理插入在WPF RichTextBox中的行的文本。 请参阅我之前关于TextPointer类的问题:如何跟踪WPF RichTextBox中的TextPointer? 我知道如何通过使用带有0作为参数的GetLineStartPosition来获取当前行的开始处的TextPointer,但现在想要在行尾获得TextPointer。 在我之前的问题中提出,使用GetLineStartPosition方法是可行的。 如果有人能够解释一下GetLineStartPosition如何处理行尾指针,我将不胜感
I have this WPF RichTextBox and I want to programmatically select a given range of letters/words and highlight it. I've tried this, but it doesn't work, probably because I'm not taking into account some hidden FlowDocument tags or similar. For example, I want to select letters 3-8 but 2-6 gets selected): var start = MyRichTextBox.Document.ContentStart; var startPos = start.GetPosit
我有这个WPF RichTextBox,我想以编程方式选择给定范围的字母/单词并突出显示它。 我试过这个,但它不起作用,可能是因为我没有考虑一些隐藏的FlowDocument标签或类似的东西。 例如,我想选择字母3-8但选择2-6): var start = MyRichTextBox.Document.ContentStart; var startPos = start.GetPositionAtOffset(3); var endPos = start.GetPositionAtOffset(8); var textRange = new TextRange(startPos,endPos); textRange.Ap
I have an project that is much like MS Word and needs to display and Edit a range of pages with contains Rich text and want to show this content onscreen in multiple rich-text-box controls that are stacked vertically and scrolled to create the effect of document flow. Also i would like the content to flow automatically between the controls and overflow to the next control etc. is there any ot
我有一个非常类似MS Word的项目,需要显示和编辑包含Rich文本的一系列页面,并希望在垂直堆叠和滚动的多个富文本框控件中显示此内容,以创建文件流程。 另外我希望内容在控件之间自动流动并溢出到下一个控件等。 有没有其他方法,如果这是不可能的?
This question already has an answer here: How can I launch an Internet Explorer process as another user, a la /netonly? 2 answers Error in Process.Start() — The system cannot find the file specified 4 answers
这个问题在这里已经有了答案: 如何以另一个用户身份启动Internet Explorer进程? 2个答案 Process.Start()中的错误 - 系统找不到指定的文件4个答案
I have a GUI process that is running as nt authoritysystem. I'd like to launch another process (preferably via Process class) as the user that is interacting with the GUI process. If I just call Process.Start the new process will also run as nt authoritysystem but I want it to be domainuser. Edit: for clarification, I don't have the current user's username or password. I just wan
我有一个作为nt authority system运行的GUI进程。 我想要启动另一个进程(最好通过Process类)作为与GUI进程交互的用户。 如果我只是调用Process.Start ,新进程也将作为nt authority system运行,但我希望它是域用户。 编辑:为了澄清,我没有当前用户的用户名或密码。 我只想运行该过程,就好像用户自己启动它一样,而不必询问用户名/密码。 使用具有有效凭据的StartInfo属性。 Process proc = new Process(); proc.St
I currently have a windows service that is running under the System Account. My problem is that i need to start certain processes from within the service as the current logged on user. I have all the code etc to get the current logged on user / Active session. My problem is that i need spawn a process as the logged on user but will not know the user credentials etc. The service is .net comp
我目前有一个在系统帐户下运行的Windows服务。 我的问题是,我需要从服务内部启动某些进程作为当前登录的用户。 我有所有的代码等来获取当前登录的用户/活动会话。 我的问题是,我需要产生一个进程作为登录用户,但不会知道用户凭据等。 该服务是.net编译服务,我期望我需要使用一些Pinvoke方法来获得当前用户进程之一的句柄,以便将句柄复制和午餐处理。 不幸的是,我找不到任何有关如何实施它的好文档/解决方案? 如
Environment - C#, .net 4.0, VS 2010 Hello, I have written a simple shell replacement for Windows. The shell is launched automatically when users log in. The normal Windows "explorer.exe" is launched when users exit my shell. Now, when users exit (and to properly support this) I need to be able to check if "explorer.exe" is running for the current logged-in user. This pre
环境 - C#,.net 4.0,VS 2010 您好,我已经为Windows编写了一个简单的shell替换程序。 当用户登录时,shell会自动启动。当用户退出我的shell时会启动正常的Windows“explorer.exe”。 现在,当用户退出(并正确支持此操作)时,我需要能够检查当前登录用户是否在运行“explorer.exe”。 这可以防止代码不必要地再次启动它,这会导致“Windows资源管理器”应用程序窗口。 我已经看到了无数的例子来说明如何检查一个进程是否
I want to run a EXE file under current user in windows XP. I want to do that ProcessStartInfo class and Process.Start() method. In current user there is no password. so how can i do that ? Process.Start will execute under the current account by default. You do not have to provide credentials for that to happen. 你可以简单地使用Process.Start(your_exe);
我想在Windows XP中的当前用户下运行一个EXE文件。 我想要执行ProcessStartInfo类和Process.Start()方法。 在当前用户中没有密码。 所以我该怎么做? Process.Start默认在当前帐户下执行。 您不必提供凭证即可发生。 你可以简单地使用Process.Start(your_exe);
I was always under the impression that when you're running a process as (domainuser) mydomainmyuser , when using Process.Start() it would start this new process using the same credentials - mydomainmyuser . The issue I'm having is that my Process.Start() call seems to be creating a process under the SYSTEM account which is causing me permission issues in the started process (which must
我一直觉得,当你使用Process.Start()作为(domainuser) mydomainmyuser运行一个进程时,它会使用相同的凭证 - mydomainmyuser启动这个新进程。 我遇到的问题是我的Process.Start()调用似乎是在SYSTEM帐户下创建一个进程,这会导致我在启动的进程中出现权限问题(由于其工作原因,它必须在管理员帐户下运行) 。 如果它改变了一切 - 我正在从Windows安装程序中产生这个过程(一个定制的exe)。 有什么建议么? 我已经阅读了
Currently I am working on an windows installer which has a custom action built in to run an installed exe immediately after installation. My problem is that using System.Diagnostics.Process the application launches under the SYSTEM user when I would like the application to launch under the same user that is running the installer. Is this possible? 您可以使用Start方法的重载之一,该方法使用use
目前我正在开发一个Windows安装程序,该安装程序具有内置的自定义操作,可在安装后立即运行已安装的exe。 我的问题是,当我希望应用程序在运行安装程序的同一用户下启动时,使用System.Diagnostics.Process应用程序将在SYSTEM用户下启动。 这可能吗? 您可以使用Start方法的重载之一,该方法使用username和password 。