|
Ok, thanks for the help. I'll check it out.
|
|
|
|
|
I have one program(app_1) that has only read access to drives and write access only to memory.
the second program(app_2) has access to memory and write access to drive.
How can I load a file or whatever in to memory (buffer) with app_1 and get that file or whatever in app_2
*********************
no access to clipboard,
app_2 can't access the file from app_1 on disk(thats fact)
most be done thru memory
and please don't send me to c++
If you can help then please do
Thanks a Bunch
|
|
|
|
|
Hi,
I am not sure what your app(s) are trying to achieve; maybe this is useful:
Windows supports the concept of "memory mapped files". They are very good at sharing data
between two processes. They support the situation where multiple processes can read/write
the same file, where the file is actually in memory (so it gets mapped in the address
space of each participating process).
I dont think .NET supports this directly; but applying P/Invoke on Win32 functions
such as CreateFile, OpenFile, WriteFile etc. solves this.
I have used this for logging: one app logs to memory, another process actually
consumes the log information and processes it.
|
|
|
|
|
do you have a small code snippet?
|
|
|
|
|
Hi,
I dont have it at hand, and I am not sure anymore about the Win32 function names;
it may well be things like CreateFileMapping, MapViewOfFile, etc.
And it would not be "a small code snippet", it really requires some setup code.
I suggest you search around (Google) for MMF or memory-mapped file.
|
|
|
|
|
|
Hi,
I want to create a demo for an application I have created in C# so as to work for only eight days when installed on a client machine
Kezy
|
|
|
|
|
Hi!
So what's the problem?
You have to either save the date of installation or the initial remaining time somewhere and then, during startup, calculate if your still within the demo time range.
But beware - with registy and file system watching programs it's quite easy to find out the location where you save your time information. That way one can always uninstall your app and re-install it to get another 8 days.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
as mav's said pure clientside solutions can easily be defeated. If you can require demo users to have a net connection and you have a 24/7 server you could have your app phone home with system details such as mac address, harddrive serials, etc to your server to ask for permission to run. Organized hackers will still be able to edit your application to disable the checks. If possible limited functionality in a time unlimited demo is probably more effective at forcing a user to go from the demo to the full version of your application, than a fully featured demo with a time limit.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Hi, for creating a demo application that runs only for 8 days, u can enter the date/time settings in a text file, that will be created during the application installation. change the ext of the text file to something else, and during the installation , make it a point to install the file in some safe area of the client machine that normally he does not /cannot access. Also make sure to make the file hidden. This will defeat any attempt to uninstall the app and reinstalling it to get 8 more days, since uninstalling the app will delete only the program related files and not the text file that u create from ur C# code. So each time the application is opened up this file will be checked for some status flag, upon not finding the correct value, the app wont start.Just try this technique on ur machine first.
Cheers
|
|
|
|
|
gladiatron wrote: install the file in some safe area of the client machine that normally he does not /cannot access.
Where would this be? If the user has got the rights to write the file during installation, then he'll be able to get the neccessary access rights to delete the file. Simple as that, nothing you can do about it.
gladiatron wrote: This will defeat any attempt to uninstall the app and reinstalling it to get 8 more days,
What should anyone keep from deleting the file?
Even beginners can have a program monitor the creation of a file, if you try to ofuscate what you're doing by making the file hidden then it's even easier to find.
There are lots of applications that log every file and every registry key written to during an installation and they will easily defeat this overly simplistic scheme.
Using a feature-crippled version or a web-based licensing is much effective.
P.S.: If 'u' follow the forums here '4' a while 'u'll see that people here really don't like people writing 'u' instead of you. The only valid reason to do this is if your keyboard is broken and the Y and O keys are missing, which doesn't seem to be the case on your side.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
How can i get a window's icon? (by it's handle).
Just so it's clear: i'm not talking about my own program's window, but about another window.
|
|
|
|
|
|
Hello I have to obtain a process whose owner is Current User, actually I´m getting a process like this:
string processname1 = "msiexec";
System.Diagnostics.Process[] myprocess1 = System.Diagnostics.Process.GetProcessesByName(processname1);
But there are two instances of the process, one Current user’s process and the system´s process.
Thank you!!!
José Guzman
|
|
|
|
|
You can P/Invoke OpenProcessToken[^]. Get the token information and check if the username and the process name are the one you want and do the operation you need to do
Or use WMI
System.Management.ManagementObjectSearcher moSearch;
string sQuery = "";
System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("msiexec");
foreach (System.Diagnostics.Process p in processes)
{
sQuery = "Select * From Win32_Process Where ProcessID = " + p.Id;
moSearch = new System.Management.ManagementObjectSearcher(sQuery);
string[] args = new string[5];
foreach (System.Management.ManagementObject mo in moSearch.Get())
{
mo.InvokeMethod("GetOwner", args);
if (args[0] == strCurrentUser)
{
}
}
}
|
|
|
|
|
hi
how can raise an event in c#?
for example in VB.NET we can write follow code to raise an event :
RaiseEvent SendMessage(message);
tanks
|
|
|
|
|
SendMessage(message);
Was it that difficult to figure out
only two letters away from being an asset
|
|
|
|
|
Well i have lil doubt about handling exception...
Well i have created a ABCException class based over Exception class.
which includes ABCException class constructors with differnt parameters like..
class STAFException : Exception
{
public ABCException() {...}
public ABCException(Uint32 cc) {...}
public ABCException(Uint32 cc, string message) : base(message) {...}
public ABCException(string message) : base(message){...}
}
Now my question is ... for instance look at the below mentioned method
<br />
public IDictionary createInstance()<br />
{<br />
Hashtable treemap = new Hashtable();<br />
treemap.Add("map-class-name", _mapClassDef["name"]);<br />
return treemap;<br />
}<br />
So if i want to handle its exception...is the below method correct or am i doing it wrong...
<br />
public IDictionary createInstance()<br />
{<br />
try<br />
{<br />
Hashtable treemap = new Hashtable();<br />
treemap.Add("map-class-name", _mapClassDef["name"]);<br />
return treemap;<br />
}<br />
catch(Exception e)<br />
{<br />
throw new ABCException("unknown exception: " + ee.Message);<br />
}<br />
}<br />
<br />
Is it right way to deal with it...can i use this approach with my other methods aswell..?
Thanks
|
|
|
|
|
Software_Specialist wrote: Is it right way to deal with it...can i use this approach with my other methods aswell..?
If you are going to catch an exception and throw a new one you should add the original exception as an innerException to the existing one. That way you'll still have access to the full stack trace. If you don't do that you are throwing away valuable information.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
And how could i do that..how to add the original exception as an innerException to the existing one ?
Thanks
|
|
|
|
|
Call the appropriate base constructor:
Exception(Exception innerException)<br />
Exception(string message, Exception innerException)
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
I love seeing questions like this from some calling themself Software_Specialist. It gives me hope that there is job security for me.
only two letters away from being an asset
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Have you seen the O/S and toys on cell phones lately? What utter crap!
It's only a matter of time before it's simply not worth having your entire customer base pissed at you because you outsourced software development to a company that has too many people who don't know what their doing. At least I hope that's the case!
|
|
|
|
|
Well, Knuth says programming is an art. How many artists you can see around you?
Of course there are several reasons behind this scenario: There is a strong request for software and employers tend to prefer cheap teams; usually Project Managers insist on deadlines more than on software quality; new languages and tools are often presented as accessible to untrained people (and indeed they are, but good programming has NOT such accessibility) and so on...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|