|
|
i have to execute 3 *.exe using a project.
i used System.Diagnostics Process to run the existing exe.
i checked for running process since one exe cannot be run twice
now the problem i am havin is that i cannot bring already running process as Windows foreground after i switch to another window.
how can i set a running process as a foreground window??
SUCIL
|
|
|
|
|
|
Hi all, I'm new to Windows Mobile 6 and C# programming, I'm currently using the Microsoft SQL Server Compact Edition and have created the database programmatically. May I ask how to export the contents of datagrid to excel or csv. I gratefully appreciate for any help. Thanks in advance.
codenoobie
|
|
|
|
|
|
|
Hello Experts,
I would like to use
object System.Xml.Serialization.XmlSerializer.Deserialize(System.IO.StreamReader stream) within a constructor
public class MyObject()
{
public MyObject (string fileName)
{
System.IO.StreamReader readingStream = new System.IO.StreamReader(fileName);
System.Xml.Serialization.XmlSerializer readingSerializer = new System.Xml.Serialization.XmlSerializer(typeof(MyObject));
MyObject justRead = (MyObject)readingSerializer.Deserialize(readingStream);
}
} But I don't know what to do with justRead.
Of course, I could just forget about the constructor and use a method
public static MyObject Load (string fileName)
But is it really impossible to create something usable like this one?
MyObject iLoadedThisFromFile = new MyObject (storageFileName);
Ciao,
luker
|
|
|
|
|
The easiest way would be to copy the variables of justRead to the variables of your new class.
Example:
this.Prop1 = justRead.Prop1;
this.Prop2 = justRead.Prop2;
...
this.PropN = justRead.PropN;
So you construct your new class out of an old class of the same type (works teh same like a copyconstrutor).
Hope that helps.
Greetings
Covean
|
|
|
|
|
Hi,
I have a stored proc that at the end executes the following line:
Select @ID
In my C# I have the following to try and grab it:
SqlParameter AgentID = new SqlParameter("@ID", SqlDbType.Int, 4);
AgentID.Direction = ParameterDirection.ReturnValue;
sqlCmd.Parameters.Add(AgentID);
int NewAgentID = 0;
try
{
sqlCon.Open();
sqlCmd.ExecuteScalar();
sqlCon.Close();
NewAgentID = int.Parse(sqlCmd.Parameters["@ID"].Value.ToString());
return NewAgentID;
}
In debug this seems to set NewAgentID to -1, however it should be a legitimately returned variable from the stored proc, any ideas what is wrong?
|
|
|
|
|
You need to get C# to excute your stored procedure then get the return variable and store it in NewAgentID.
I use Microsoft Database access application block. So in c# the code would look somehting like this.
int NewAgentId = int.Parse(SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "Call for Stored Procedure").ToString());
|
|
|
|
|
jamesc69 wrote: I have a stored proc that at the end executes the following line:
Select @ID
This means that you are returning the value of @ID. try some thing like this
sqlCon.Open();
object result = sqlCmd.ExecuteScalar();
sqlCon.Close();
if (result != null)
NewAgentID = int.Parse(result.ToString());
|
|
|
|
|
Hi,
Thanks all, this is the correct solution
Thanks
James
|
|
|
|
|
Hello,
I want to develop a software that restricts copy of CD (compact disc).
I know C# and VC++.
You can help me in any of these languages.
Regards
|
|
|
|
|
Member 3219104 wrote: I want to develop a software that restricts copy of CD (compact disc).
Do you mean an application that prevents that the CD is copied, or an application that restricts access to the burner itself?
There are some tools available that could protect your software from piracy, but there's nothing that's 100% secure. As for restricting access to a device; it might be that "restricted users" don't have burning-permissions in Windows XP. That would depend on the security-policy. You might also be able to prevent the usage of the internal recording-API, but that won't block any third-party applications.
I are Troll
|
|
|
|
|
Actually I want to write a software which prevents my CD to copy, actually i have a client. She is having some tutorial. She want that tutorial cannot be played without CD. And once I create CD that should not be get copied. I know VC++ and C#. I want any clue for this type of software.
|
|
|
|
|
That kind of thing has been an industry pipe dream for decades. There's no such thing as copy protection.
You cannot prevent the CD from being read because how would your application get at it's data??
You could use a third party encryption driver that is required to read the CD, but this adds a large layer of complexity to the application, and for simple tutotials, this is way overkill, not cheap, and probably something the users will not feel is worth the trouble. It's also easily defeatable. All the users would have to do is load the driver, then copy all the files off the CD to an unecrypted location and burn a new disk without the encryption.
You also cannot disable the burning features of CD/DVD drives because the users would just throw lawsuits at you for tampering with their machines. You have no right to disable features of their computer that they would normally use outside of your application.
|
|
|
|
|
I think I was unable to explain my query. I don't want to disable burning feature. My concern is my CD should not get copied (cd to cd copy) again.
Happy Programming.
|
|
|
|
|
Yeah, you were clear. Apparently we're not. You cannot do what you want. You cannot prevent a CD, or any other removable media, from being copied. It's that simple.
|
|
|
|
|
Yes sir, I got it.
Thank you.
|
|
|
|
|
Member 3219104 wrote: Actually I want to write a software which prevents my CD to copy, actually i have a client. She is having some tutorial. She want that tutorial cannot be played without CD. And once I create CD that should not be get copied. I know VC++ and C#. I want any clue for this type of software.
A copy-protection scheme. A CD doesn't "know" how often it's been played, so there's no way to prevent someone from installing the software again.
Don't panic, that's a good thing. That means that they can reinstall your software after they reinstalled Windows, without calling your helpdesk or buying a new CD. Customers should have that option, since they paid for your software.
There's multiple ways to protect the software, and none of them are 100% secure. I'd go for something that calls home and sends an activation code by email, for the application on a specific combination of hardware-id's. There's also companies specializing in copy-protection, like Aladdin[^].
I are Troll
|
|
|
|
|
I'd go for something that calls home and sends an activation code by email, for the application on a specific combination of hardware-id's.
Actually this is what I want. Can you please suggest how could I achieve this ? And if my CD gets copied how come I know that installation of this CD already been done.
Thanks .
pranitkothari@rediffmail.com
|
|
|
|
|
Member 3219104 wrote: Can you please suggest how could I achieve this ?
The MAC-address[^] is the serial number of the network-card. The motherboard[^] also has a serial number. The drive-volume[^] has a number that changes each time that the harddisk if formatted.
The idea would be that you application makes a hash from these numbers and then sends that to you. That would be an unique identifier for an installation, and it would have to match a registration. Once the number is in, you send back an activation-code to unlock the application.
You can't link the information to a particular CD - since it's simple to make an exact duplicate of that thing.
I are Troll
|
|
|
|
|
Really helpful.
Thank you.
|
|
|
|
|
You're welcome
I are Troll
|
|
|
|
|