|
|
As Richard suggested you are suffering from bad design or probably undisciplined coding. There are various tools built into Visual Studio to help find dependencies, these have obviously not been used.
There are also various practices and strategies to avoid the situation you find yourself in. It is good and normal practice to create shared methods, what you are missing is the skill and discipline to support the application. You have a crappy vendor!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Don't know if your vendor is better or worse than average ("bug" wise); however, most "professionals" use "version control software" (VCS) that allows for maintaining a "history" of software changes so that one can always (or most of the time) "fall back" to a previous version of the "app" that worked.
"$ cost" is not a factor since there are open-source VCS: e.g. GIT, SVN.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Possibly a 3-rd party vendor like telerik. Use of the XAML Dictionary to group up the styles. Also, on the WPF Themes - Home[^] on CodePlex, there are additional toolkits that might help.
Ben Scharbach
Temporalwars.Com
YouTube:Ben Scharbach
|
|
|
|
|
The second time my program encounters this linq statement it changes the resolution of the application.
List<type> ZObjects = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(assembly => assembly.GetTypes())
.Where(x=> x.FullName.Contains("MyDataClasss") &&
x.Name.Substring(0,1) == "Z").ToList();
Can anyone explain why this would happen?
Thanks
|
|
|
|
|
Well, the first problem is what do you mean by "changes the resolution of the application". Also, what kind of application is this? Windows Forms, WPF, Console, ...?
On the surface, the only explanation is "not possible".
There is something else going on that's causing this, possibly very subtle, but it's not possible with the code shown.
|
|
|
|
|
It is a Windows Form application using DevExpress controls. I am running Windows 10 and a friend saw the same behavior on his Apple running a Windows emulator. Another friend did not see the same behavior on his Windows 7 machine. I am using a Surface and not in its highest resolution.
I am not sure how else to explain the action, but the form, which is maximized and takes up the full screen the first time its run shrinks to about 2/3's of the screen and shows maximized. If I click the normal / maximize button it toggles to non maximized and back, but never takes more than 2/3's of the display. Its like its in its own screen which is maximized at about 2/3's of the available display size. But the rest of my programs show underneath at their normal resolution.
I fixed the problem by using a different approach but remain interested in why this happened. I am trying to replicate it in a simple project that I can share but so far no luck. When I do I will post back to this thread.
Thanks
|
|
|
|
|
Do you mean that you get a different result the second time you run this statement to the first time you run it? If you do, the obvious answer is that the list of assemblies that are available at the second point are different to the first point. There could be many reasons for this, but they are all going to revolve around the fact that the application must be loading assemblies later on than the point you think it's finished loading them. As an example, your application might be using MEF and reacting to plugins being dropped into a plugin folder it's watching.
This space for rent
|
|
|
|
|
Hi. All i want to do is something like
...
foreach (string f in Directory.GetFiles(@"X:\someDir"))
{
Console.Write(f);
if (IsHardlink(f) == false) Console.WriteLine(" is real fileentry");
else Console.WriteLine(" is hardlink and the target is " + GetTargetName(f));
}
...
private bool IsHardLink(string filePath)
{
???
}
private string GetTargetName(string filePath)
{
???
}
I 'googled' for days, found tons of articles 'how to create hardlinks, junctions' etc, also many examples for 'get the linkcount of a given file" (the target), but nothing for my need.
Please help, give me advice, point me in a direction.
Thank you
|
|
|
|
|
Detecting a junction should be as simple as:
private static bool IsHardLink(string filePath)
{
var attributes = File.GetAttributes(filePath);
return attributes.HasFlag(FileAttributes.ReparsePoint);
}
Retrieving the target is more complicated, but Jeff Brown has a solution:
Manipulating NTFS Junction Points in .NET[^]
private static string GetTargetName(string filePath)
{
return JunctionPoint.GetTarget(filePath);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
JunctionPoint deals with Directory.
My need is file symlink, espec HardLink, which means that the link resides on the same volume as the target but in another Directory.
|
|
|
|
|
With Windows all kinds of links are indicated by the FILE_ATTRIBUTE_REPARSE_POINT flag:
A file or directory that has an associated reparse point, or a file that is a symbolic link. To differentiate between file and directory links use the corresponding attribute flag. To check if a file is on the same drive (hard link), you have to resolve the resparse point to get the target (which you want anyway).
I have no solution for C# but the source of the article mentioned by Richard may contain useful information. A solution for C/C++ can be found at HowTo: Correctly read reparse data in Vista | Jochen Kalmbach's Blog[^].
|
|
|
|
|
For hard links, you can't do what you want. This Stack Overflow answer[^] explains why:
Quote: On NTFS all files are hard links. You can detect that a file has multiple hard links pointing to it, but there's no "real file" that it points to. You can think of hard links as just different names for the same file. So for example if you have file1.txt and you create a hard link file2.txt that points to the first file, both are hard links and the 'target' is the data on your disk.
What you can do, is detecting if a file is a symbolic link: c# - Check if a file is real or a symbolic link - Stack Overflow[^]
The quick brown ProgramFOX jumps right over the Lazy<Dog> .
|
|
|
|
|
I hope someone can help me abit. I have a customer that wants to sell his application only with a special tablet computer with windows as operating system. The application shall not be able to run on any other windows computer than the tablet that he is selling with the app. It's a very special project so please don't discuss if it is a good idea to bundle the app with the hardware.
My question is, how can I realise that? How can the app (C#, wpf) detect if it's the right computer?
For me this is a new area so I have no idea how this could work. How can I tell the application that this is the right computer? Where to store that information so that the app can compare during startup if it's still the same harware?
|
|
|
|
|
Quote: how to bind a wpf app to the hardware? You should understand the fact that a WPF application requires a .NET framework installation to work properly on the machine. Binding WPF to hardware, would require binding .NET framework to it as well.
Quote: The application shall not be able to run on any other windows computer than the tablet that he is selling with the app. You can modify the Windows Registry with some special keys, that only your publisher has access to and then check if they exist in the machine's registry. That would mean, that even a clean Windows install would remove any chances of using the application again — no keys, no usage.
Also, this is not just the hardware anymore, it is the operating system that controls the application. For hardware, you might want to consider tweaking with the BIOS — not recommended, and not necessary at all — and an even better way to do that would be to use a native application, such as a module written in C++.
You can take a look at Qt application development framework, they support embedded programming, or native programming to control and look for hardware-related stuff. Yet, providing the graphical components for your cross-platform development. This may be a better approach as compared to WPF and C#, because WPF requires .NET framework, which is only installable on Windows as .NET Core does not support WPF at the moment. Thus anything you do, first requires to pass the test of Windows operating system. Then, you can do that.
If you want to do that using WPF, please consider reading the documentation for modification of Windows Registry, How to: Create a Key In the Registry (Visual C#) | Microsoft Docs
Qt | Cross-platform software development for embedded & desktop
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Basically, you can't. Registry keys etc. are all very well, but an image backup of the tablet "hard disk" will allow it to be restored onto any compatible hardware.
All you can do is use the hardware serial numbers (such as the processor serial number: How To Get Hardware Information (CPU ID, MainBoard Info, Hard Disk Serial, System Information , ...)[^] ) and use those to restrict the software to that exact tablet (but even then, you'll probably need to record that serial data at a remote site and check it in when the app starts of while it's running to avoid chating).
It's a difficult area - it's generally not worth putting a lot of effort into this as the better your protection, the more people want to crack it. And it's very, very easy to end up costing more to implement and maintain that it saves you in piracy. (Adobe spend a fortune protecting Photoshop, and the cracked version is normally still available on torrents the same day the legitimate version is released.) Add to that the fact that any failure will really piss off loyal, legitimate customers, and it gets silly to do it at all. (It's very easy to lose a good reputation, but very hard to get it back).
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Member 13196574 wrote: a special tablet computer How can you identify that "special tablet computer"? You have to ask your customer what he does here, and that might be a combination of things.
Then you have to find out how to read that information from the device.
If some hackers can find out how to pretend that their "standard" tablet computer is that "special" one, well, that's a problem of your customer, and you shouldn't worry about that (make sure your contract does not tell different!).
|
|
|
|
|
Almost every device I'm aware of, has a "physical" / MAC address tied to (usually) the network interface (card).
It should be globally unique, and will even identify the vendor (of the card) via the first xx-xx-xx of xx-xx-xx-xx-xx-xx (hex).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
|
hi how can i download offline Mappoint SDK API to integrate in my .net desktop software
where i can find that file
|
|
|
|
|
shaz17 wrote: download offline Mappoint SDK API to integrate in my .net desktop software That contradicts a lot, API SDKs are generated for online applications, you need to capture their REST architecture for the API and then code against it. All the applications, consuming these services require the connection to their APIs, or a test key which provides a dummy data.
You can start from here, Integrating MapPoint in your .NET applications
MapPoint
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
You have already been told the answer, why are you reposting the question? If you want to use Google maps then go to the Google developer website for information.
|
|
|
|
|
hi how can i download offline Mpoint SDK API to integrate in my .net desktop softwrea
|
|
|
|
|
What's mpoint? Is it just a mistype of MapPoint?
This space for rent
|
|
|
|
|