|
Only one user can be logged in at a time, so the service can only work for the currently logged on user. Maybe you have to reset something when a user logon event is detected..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,
I created a trial license for our application. I have some doubts in my concepts:
1. i used in my concept , get system time using DateTime.Now when installed our application. For example
installed Date: 1/03/2010
Expire Date: 30/03/2010
Expire Days: 30
remaining Days: 30
every time when i application start , corresponding manipulation were done. current time - installed date based on these manipulation remaining date will reduced.. In the positive scenario its working fine .
but if daily uses the date when the software is installed , the remaining date should not reduced its my problem .. so i think dont take a directly from system can we should be use some another idea ... On that time in Linux can possible to take system Tick which is directly calculated from 1970 jan 1 . so no need to change if even changes the system date .. if you have any idea related this or have any new idea.. please share with me ....
Thanks....
|
|
|
|
|
Imho, the only really fail-safe way to check for license expiration, validity and seat count is for the application to communicate with a license server that's under the control of the manufacturer of the software.
/ravi
|
|
|
|
|
Thanks for quick replay
but i am using a standalone application . which is no need to server connection . with in a system we can run this . (i m using mysql database thats also a local ).
Thankyou
|
|
|
|
|
please help me .. In our application needs real Date for trail license....
here before we are used System.DateTime ... but have some problem ,
so i will decide to uses BIOS Date instead of System.DateTime
my doubts is...
1) Is possible to change BIOS Date
2) may we use BIOSDate insted of System.DateTime
Thanks....
|
|
|
|
|
BIOS Date and System.DateTime.Now are one and the same; change one, the other changes with it.
BTW: there is NO solution to your problem; the owner of a stand-alone PC can do to it whatever he chooses. What you can do is:
- use an external system (such as a server on the network or Internet);
- use a dongle, i.e. some piece of hardware+software the user cannot forge as it contains unfamiliar stuff
- hide information at several unexpected locations (registry, file system).
Plus: improve security by applying encryption.
And whatever you do, the code involved could always be reverse-engineered.
|
|
|
|
|
Thanks for reply....
i don't aware of dongle concept. can u give a brief explanation or give article related this please. And can we make dongle software in same c# . or which language we want uses for this..
Thanks....
|
|
|
|
|
|
I want to write a word at at a time in MS word by using voice. Not a single letter. is it possible .if it is how it is possible....give idea...or process..
|
|
|
|
|
You can use the Microsoft Speech SDK with Word interop.
But I'm sure that Windows 7 and Windows Vista can already do this.
|
|
|
|
|
sir i also know that it is already exists in windows 7....but i want to implement it myself..because it is a task of my project in undergraduate level...if you have any idea or code please help me..by the way i have already done voice command operating system and using voice i can open the MS word page.....
|
|
|
|
|
Use the Microsoft Speech SDK and Word interop.
|
|
|
|
|
|
Sir,
i think you can't understand my problem..using voice command i can open the MS word page.. now i want to write here using voice....i can do it as a letter for e.g a b c using command. but i want to write a word for e.g you, table etc... how can i do it...please help me.
|
|
|
|
|
This capability already exists in Word. No code required. It's been in Word since 2003, I think.
|
|
|
|
|
hi all,
i am trying to deserialize a xml string into an object but i am getting following error :
"An exception of type 'System.InvalidCastOperationException' occured in System.Xml.dll but was not handled in user code.
Additional information: There is an error in XML document(1,2)."
I am using following code to deserialize :
object obj = new object();
System.Xml.Serialization.XmlSerializer x = new XmlSerializer(obj.GetType());
StringReader sr = new StringReader(strNewXml);
XmlTextReader xml = new XmlTextReader(sr);
obj = (object)x.Deserialize(xml);
I tried to see the value of XmlTextReader xml, but it is showing as {None}.
I even tried with a string which i earlier serialized from an object but same error is displaying with it too.
Can anyone tell me where i am doing wrong.
Thanks and Regards,
Nagendra
|
|
|
|
|
I have solved the problem by modifying my code as below:
object objNewTransactionEntry = new object();
XmlRootAttribute xmlRoot = new XmlRootAttribute("Session");
System.Xml.Serialization.XmlSerializer y = new XmlSerializer(objNewTransactionEntry.GetType(), xmlRoot);
StringReader sReader = new StringReader(strNewXml);
XmlTextReader xmlReader = new XmlTextReader(sReader);
objNewTransactionEntry = (object)y.Deserialize(xmlReader);
|
|
|
|
|
I have attached the following code. I have a datagridview with three comboboxes on it. When I select an item from the first combobox it functions as intended. The problem I am having is that when I click on the second or third combobox it executes the item_SelectedIndexChanged event as shown below. I know I am missing something stupid! Any help is appreciated! Thanks!
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
int columnindex = dataGridView1.CurrentCell.ColumnIndex;
ComboBox combo;
if (dataGridView1.CurrentCell.ColumnIndex == 3)
{
combo = e.Control as ComboBox;
if (combo == null) return;
combo.SelectedIndexChanged -= item_SelectedIndexChanged;
combo.SelectedIndexChanged += item_SelectedIndexChanged;
}
}
void item_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox cmbBox = (ComboBox)sender;
int x = Convert.ToInt32(cmbBox.SelectedIndex.ToString());
int y = dataGridView1.CurrentRow.Index;
dataGridView1.Rows[y].Cells[4].Value = dsInvoice.Parts.Rows[x]["DESC"].ToString();
dataGridView1.Rows[y].Cells[5].Value = Convert.ToDecimal(dsInvoice.Parts.Rows[x]["Price"].ToString());
}
|
|
|
|
|
kruegersck wrote: The problem I am having is that when I click on the second or third combobox it executes the item_SelectedIndexChanged event as shown below.
I'm not sure what you mean. Is the problem that it is supposed to execute that routine and does something you don't want, or that you want it to execute something else?
If you want it to do something else, we need to know what you are trying to do.
If you don't want it to execute that routine, then remove it from the events or use a different routine.CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I have RichTextBox with the ScrollBars property set to Both. In a forms-based program, I would like to be able to programatically determine if a given scroll bar--vertical or horizontal--is visible (i.e., showing or not, depending on the RichTextBox contents.)
Thanks,
Tom
|
|
|
|
|
Hi,
AFAIK that will not be simple as there is no .NET support for it. I would suggest:
- getting the Handle;
- calling EnumChildWindows;
- somehow recognizing which of those are scroll bars (don't recall how right now);
- look at their visibility.
That will take a lot of P/Invoke stuff; these prototypes may help:
public delegate bool LP_EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
[DllImport("user32.dll", CallingConvention=CallingConvention.StdCall)]
public static extern int EnumChildWindows(IntPtr hParent,
LP_EnumWindowsProc ewp, IntPtr lParam);
[DllImport("user32.dll", CallingConvention=CallingConvention.StdCall)]
public static extern bool IsWindowVisible(IntPtr hWnd);
|
|
|
|
|
Hi,
There's an article on MSDN with VB code describing how this can be done by testing for the WS_HSCROLL and WS_VSCROLL bits in the window style retrieved with GetWindowLong.
How To Detect If Scroll Bars Are Visible on a Control[^] and it is applicable to .Net as the underlying control is the same. Here's an excerpt from a C# test programme.
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);
private const Int32 GWL_STYLE = -16;
private const Int32 WS_HSCROLL = 0x100000;
private const Int32 WS_VSCROLL = 0x200000;
private void TestForSB(RichTextBox rtb) {
Int32 style = GetWindowLong(rtb.Handle, GWL_STYLE);
Boolean hasVertical = (style & WS_VSCROLL) != 0;
Boolean hasHorizontal = (style & WS_HSCROLL) != 0;
label1.Text = String.Format("Vertical: {0}, Horizontal: {1}", hasVertical, hasHorizontal);
}
Alan.
|
|
|
|
|
Yes, that's much easier.
|
|
|
|
|
Hi
I've used from this link to define a new simple type and then save to disk with .dll extension via this code :
private void button1_Click(object sender, EventArgs e)
{
AssemblyName asmName = new AssemblyName();
asmName.Name = "HelloWorld";
AssemblyBuilder asmBuilder = Thread.GetDomain().DefineDynamicAssembly(asmName, AssemblyBuilderAccess.RunAndSave);
ModuleBuilder modBuilder = asmBuilder.DefineDynamicModule("HelloWorld");
TypeBuilder typeBuilder = modBuilder.DefineType("Hello", TypeAttributes.Public, typeof(object), new Type[] { typeof(IHello) });
MethodBuilder methodBuilder = typeBuilder.DefineMethod("SayHello", MethodAttributes.Private | MethodAttributes.Virtual, typeof(void), new Type[] { typeof(string) });
typeBuilder.DefineMethodOverride(methodBuilder, typeof(IHello).GetMethod("SayHello"));
ILGenerator il = methodBuilder.GetILGenerator();
il.Emit(OpCodes.Ldstr, "Hello, {0} World!");
il.Emit(OpCodes.Ldarg_1);
il.Emit(OpCodes.Call, typeof(string).GetMethod("Format", new Type[] { typeof(string), typeof(object) }));
il.Emit(OpCodes.Call, typeof(Console).GetMethod("WriteLine", new Type[] { typeof(string) }));
il.Emit(OpCodes.Ret);
Type type = typeBuilder.CreateType();
IHello hello = (IHello)Activator.CreateInstance(type);
hello.SayHello("Emit");
asmBuilder.Save(asmName.Name + ".dll");
}
it saved my dll on disk, but when i open it via Reflector, it does not have anything! just have a module named 'RefEmit_OnDiskManifestModule'
can anybody help me where is my problem and how to solve it ?
thanks in advance
|
|
|
|
|
Hi,
IMO the problem is with the DefineDynamicModule() , where you should use an overload and specify the DLL file there too.
|
|
|
|