|
Is there a simple way to hook calls to other files, so that I can redirect or stop them?
Thanks.
|
|
|
|
|
Do you mean attempts to open files ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yes, I need to stop one application from opening a second. I don't have the source code to either of them.
Thanks
|
|
|
|
|
How about moving, renaming, or deleting the file?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
That won't work, the first application won't start if the second one isn't in the proper place (and the second application will just update itself to where it was before).
|
|
|
|
|
I am trying to trap specific request for pages on my website. The custom errors defined in web config works fine for URLS with a page reference such as:
http://www.mydomain.com/123/i_dont_exist.aspx
This will redirect to my error page.
The problem is this:
http://www.mydomain.com/123
The directory 123 does not exist but the ie 404 displays, not my custom error page.
Any thoughts would be greatly appreciated.
|
|
|
|
|
I am looking for a way using C# to retrieve the "Apply Onto" value viewed when looking at the advanced properties for a directory.
<br />
...<br />
AuthorizationRuleCollection arc = security.GetAccessRules(true, true, SECURITY_IDENTIFIER_TYPE);<br />
foreach (FileSystemAccessRule fsar in arc) {<br />
String type = fsar.AccessControlType.ToString();<br />
...<br />
}<br />
I am trying to progromatically figure out which "Permissions Group" ( Full Control, Modify, Read and Execute a file and or directory is assigned.
List folder contents, Read, Write) is assigned.. I don't see anything stored on the FileSystemAccessRule to give me the "Apply Onto" field. Is there another object I have to use?
Read and Execute AND List folder contents have the same exact rights, but differ by the "Apply Onto" field.
List folder contents the Assigned onto field is : "This folder, subfolder and files"
Read and Execute the Assigned onto field is : "This folder and subfolders"
Is there another way to figure out this problem?
Any help would be appreciated.
Thanks.
|
|
|
|
|
I need to pass a few strings & vars to MessageBox. The following works, but is there a better way than creating the object?
Object[] warning = new Object[] { "File " fileName " needed from " fileLocation " is missing." };
MessageBox.Show(string.Concat(warning));
Thanks.
|
|
|
|
|
MessageBox.Show("File " +fileName+ " needed from " +fileLocation+ " is missing.");
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
|
Look into String.Format . You can rewrite your message like this:
String warning = String.Format("File {0} needed from {1} is missing.", fileName, fileLocation);
|
|
|
|
|
|
Better yet, put your string in a resource dictionary, in the format File {0} needed from {1} is missing.. Then, in your code retrieve it and format it using
string format=string.Format(resourceText, fileName, fileLocation); The advantage of doing this is that you can easily localise your applications by doing this - the {0} {1} can be rearranged in different languages as appropriate so the text will be displayed in the format the user would expect.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thank you for the extra comments Pete, much appreciated. Guess I better take a look at resource dictionaries.
|
|
|
|
|
hi. We have a problem with the ellipsis button using in a listview project in c#. we need to use it as the picture below which is linked.it is same like the property grid.
thanks
see this picture
|
|
|
|
|
Hello,
I m creating a C# .NET Project in which i m trying to load third party Assemblies which are installed in GAC.
But in some machines I m getting an error stating "Unable to Load assembly of specified version 7.0.351.0".
when i tried to do an assembly redirection it didn't work it still shows the same error.
Note:
7.0.351.0 -The is version with which it is compiled.
12.0.0.0 - Assembly present in the Target machine
Properties of Reference
Specific Version -> False
Aliases -> global
Copy Local -> False
This is my sample application configuration file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" >
<dependentAssembly>
<assemblyIdentity
name="Act.Framework"
publicKeyToken="ebf6b2ff4d0a08aa" />
<bindingRedirect oldVersion="7.0.351.0"
newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Logs of FUSLOGVW shows
"LOG: No application configuration file found."
But I already added the App Config file. Is it not detecting my config file?
How do I make it detect?
Steps I did to add App.Config file:
1. Add New Item through Project wizard and select "Application Configuration file".
|
|
|
|
|
Your config file should be named after your application. For example, if your app is myapp.exe, you config file should be named myapp.exe.config and should reside in the same folder as your exe file.
|
|
|
|
|
|
This question might be better suited in the WPF / WCF / WF forum..
|
|
|
|
|
I have the following lines of code (2.0 framework) that worked in Win XP, but doesn't work with Windows 7:
if (!Directory.Exists(@"c:\Program Files\Newsham\PigtrakDesktop\RAPI"))
{
Directory.CreateDirectory(@"c:\Program Files\Newsham\PigtrakDesktop\RAPI");
}
Here's the weird part: If I try to navigate to c:\Program Files\Newsham\PigtrakDesktop using the Windows 7 explorer, the RAPI directory is NOT there.
However, in my code, if tell it to list the files in the same directory, there ARE FILES THERE!
This is really killing me. Any thoughts?
|
|
|
|
|
I can't explain WHY the **** this is like this, but I found my files. They are located at:
C:\Users\pbrower\AppData\Local\VirtualStore\Program Files\Newsham\PigtrakDesktop
What the hell?
|
|
|
|
|
Maybe something to do with MS not being so keen on us writing (and adding directories) to the Program Files folder in Vista and Windows 7? Just a thought (on friday afternoon)...
|
|
|
|
|
"C:\Program Files" is not writable for standard users (just as it was since Win2000 and earlier).
Starting with Vista, the default user account is a standard user; getting admin rights only when you explicitly run an app with them (UAC).
To allow old programs to continue to run, Windows will redirect writes to the "VirtualStore". This is done only with programs that are not marked as "UAC-compatible".
So you have to do two things:
1) to avoid confusion due to file system virtualization; mark your program as UAC-compatible by embedding an UAC manifest. VS2008 should do this automatically (see "Application Manifest" in the project options); for VS2005 it's a little bit more complicated: http://blogs.msdn.com/shawnfa/archive/2006/04/06/568563.aspx[^]
2) Don't write to Program Files.
|
|
|
|
|
More specifically, don't write anywhere but the AppData folder.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi,
Lets supose i have C# application witch gets object position in desktop (for example "icon" or "shotcut") coordinates (x,y).
I need method whitch uses coordinates from application (x,y, and x_put, y_put) take object from one position and DRAG and DROP that objet to other position. Also it would be great if that methot can WORK FAST.
I appretiate your help,
|
|
|
|