As soon as you rely on external components (i.c. WMP) several things could go wrong: WMP may not be installed, or it may be disabled (maybe this[^] could help), or you are trying to use a WMP browser plug-in that isn't installed (possibly by using the WebBrowser Control).
As such possibilities exist, your code should be such that it gracefully degrades, so the least you should do is catch exceptions and report to the user in functional terms; what I tend to always do is include a log facility that reports to the programmer in technical terms. Furthermore, if you were to use some operation that may never terminate, you should figure out a way to give it a timeout anyway.
FWIW: if you access Controls on a thread that didn't create them, all kind of weird things may happen, and not necessarily in a reproducible way.
I believe you can also get to the Event-Logs in windows via Visual Studios Env; which is better, since it groups up items for you. The path I use is Server Explorer>Servers>[Computer]>Event Logs>Application>[Your App].
Hi, my office hire a vendor to develop MIS system for internal use. The system is develop and configured with Microsoft SharePoint and their code is written in C#.Net language. Everything is running fine but one thing that really concern me is the implication of wrong setting or functionality when we we ask them to update the new feature or fix any issue, the target feature/issue is developed or fixed. But their code is impact to the other module of the system that cause something wrong. I have discussed with them and found that they are modify some share function or code which work great for target request module but impact the function of other module which later on we found.
My question from here is: do anyone in here know any style or tool to help them to manage their code more efficiency so making the progress of updating some feature won't impact to the functionality of other feature. Thank in advance!
All this is kind of vague: what's a specific example you have observed ?
Are you competent enough in C# and .NET architecture to understand the code base ? To judge how well it's put together ? Is it your job to deal with the code ?
The possible structural issue here ... your dependency on a 3rd. party's code which you can't maintain/fix yourself (evidently) ... well, that may be something you can't modify. And, the idea of giving the 3rd. party some magic tool that will change everything ... seems like a fantasy.
On a business level, do you have any form of leverage with the 3rd. party ? Are they willing, able, to change ? The best leverage, of course, is financial; can you take your business elsewhere; are there funds they have not been paid, yet, etc.
You'd really have to describe the full context of the business relationship to say much more.
«Differences between Big-Endians, who broke eggs at the larger end, and Little-Endians gave rise to six rebellions: one Emperor lost his life, another his crown. The Lilliputian religion says an egg should be broken on the convenient end, which is now interpreted by the Lilliputians as the smaller end. Big-Endians gained favor in Blefuscu.» J. Swift, 'Gulliver's Travels,' 1726CE
What i have found in here is when the vendor change/update one module to meet our requirement, there is an impact to the functionality of the other module in our MIS system. As talk with them, I found that the problem because they use the share code module that is why they change their code to fit with one module it is impact to the code in another module.
It is hard for me to raise to management for the support contract to fix an issue that is not produce during first system development but it is an issue of produced by another support task. I think if there is any method or tool that help them to manage their code efficiency so there is no impact from one module to another module when there is any change made in the code.
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
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
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.
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.
foreach (string f in Directory.GetFiles(@"X:\someDir"))
if (IsHardlink(f) == false) Console.WriteLine(" is real fileentry");
else Console.WriteLine(" is hardlink and the target is " + GetTargetName(f));
privatebool IsHardLink(string filePath)
privatestring 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.
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).
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.
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?
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.
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.
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!
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!).