|
Buy an application that protects yours. Such software can be found here[^], for example.
You could also pick up a book on programming, learn for a few weeks and try to build one yourself. The basic idea is to generate a number that's unique for the combination of a product/computer/user. If the registered key is different from your computed value, you're either dealing with an unregistered key, or a bug
I are Troll
|
|
|
|
|
Hi,
I'm creating a user control that displays a DataGridView control. I want to be able to programmatically select multiple cells/rows. So i made this function:
public bool SetSelectedValues(string ColumnName, List<object> CellValues)
{
bool FoundRows = false;
for (int ColumnIndex = 0; ColumnIndex < gridData.Columns.Count; ColumnIndex++)
{
if (gridData.Columns[0].Name == ColumnName)
{
gridData.ClearSelection();
for (int RowIndex = 0; RowIndex < gridData.Rows.Count; RowIndex++)
{
foreach (object CellValue in CellValues)
{
if (gridData.Rows[RowIndex].Cells[ColumnIndex].Value.ToString() == CellValue.ToString())
{
gridData.Rows[RowIndex].Cells[ColumnIndex].Selected = true;
gridData.CurrentCell = gridData.Rows[RowIndex].Cells[ColumnIndex];
FoundRows = true;
}
}
}
break;
}
}
return FoundRows;
}
It doesn't work, only the last cell gets selected, because i cannot select multiple cells in the CurrentCell. How can i solve this?
Regards,
Willem
|
|
|
|
|
I don't the code here setting MultiSelect as true. See if you have done that. Plus, not sure about CurrentCell thing. Why are you setting it in first place?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Found the solution myself, the setting of selected cell's is only effective after the datasource is bound to the control. This is not done jet when you are in the Form_Load, so you have to wait for it. This is my solution:
private string Selection_ColumnName = null;
private List<object> Selection_CellValues = null;
public void SetSelectedValues(string ColumnName, List<object> CellValues)
{
Selection_ColumnName = ColumnName;
Selection_CellValues = CellValues;
gridData.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(gridData_DataBindingComplete);
}
private void gridData_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
{
bool CellFound = false;
for (int ColumnIndex = 0; ColumnIndex < gridData.Columns.Count; ColumnIndex++)
{
if (gridData.Columns[0].Name == Selection_ColumnName)
{
gridData.ClearSelection();
for (int RowIndex = 0; RowIndex < gridData.Rows.Count; RowIndex++)
{
foreach (object CellValue in Selection_CellValues)
{
try
{
if (gridData.Rows[RowIndex].Cells[ColumnIndex].Value.ToString() == CellValue.ToString())
{
gridData.Rows[RowIndex].Cells[ColumnIndex].Selected = true;
if (!CellFound) gridData.CurrentCell = gridData.SelectedCells[0];
CellFound = true;
}
}
catch
{
}
}
}
break;
}
}
gridData.DataBindingComplete -= new DataGridViewBindingCompleteEventHandler(gridData_DataBindingComplete);
}
|
|
|
|
|
Hi,
I am trying to retrieve mails from a server like gmail. I have used TcpClient class to connect to the server.Connection is established successfully.During authentication using SslStream.AuthenticateAsClient() method to authenticate..I receive an exception saying..(HandShake Failed due to unexpected packet format)..
Can anyone help me with this..
Thank you.
|
|
|
|
|
Probably the connection on the server side is not SSL.
Or, you must first send some data (to identify you want to use SSL) to then call SslStream.Authenticate.
|
|
|
|
|
Hi again..
This is continuance from 2 Nov '09
Is there any another solution for win XP ?
I try this:
<br />
[DllImport("ntdll"), SuppressUnmanagedCodeSecurity]<br />
public static extern int NtGetCurrentProcessorNumber();<br />
and I get this exception:
System.EntryPointNotFoundException was unhandled
Message="Unable to find an entry point named 'NtGetCurrentProcessorNumber' in DLL 'ntdll'."
Source="XP_Multicore_try_0"
TypeName=""
StackTrace:
at XP_Multicore_try_0.Program.NtGetCurrentProcessorNumber()
at XP_Multicore_try_0.Program.loop() in C:\Documents and Settings\evyatarv\Desktop\XP_Multicore_try_0\XP_Multicore_try_0\Program.cs:line 24
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
|
|
|
|
|
ntdll.dll is a native code dll. You will not be able to access this dll from user code.
You have to write a native code service or driver to access it.
Greetings
Covean
|
|
|
|
|
Covean wrote: ntdll.dll is a native code dll. You will not be able to access this dll from user code
All of the Windows core is native code, and its API functions can be accessed perfectly using P/Invoke.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Once again you are right. I can invoke it. Just ignore my post.
Greetings
Covean
|
|
|
|
|
so..
Did I do something wrong ?
Why I get this exception ?
Thanks..
Evyatar
|
|
|
|
|
Can you please give me an example, I think I don't realy understand what
I'm needed to do to make it work.
Thanks..
Evyatar
|
|
|
|
|
That message is thrown when the method can't be found in the library. You might want to try to use the GetCurrentProcessorNumber method instead.
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern int GetCurrentProcessorNumber();
Hope this helps
I are Troll
|
|
|
|
|
Windows XP does not support this.
|
|
|
|
|
|
Building a windows service which needs to call a custom DLL. When I try to start the service it gives me an error stating it can't find the DLL. Which makes since since I was unable to register the DLL using Regsvr32. If I take out the DLL the service works fine (minus functionality of custom DLL). If I create a project with the same functionality as the service everything works fine once I add a reference to the DLL. Is there anything I can do to get the windows service to work with this custom DLL?
Only thing I have found is to add the DLL to the System32 direcotry which I have done.
|
|
|
|
|
What is the exact error message you are getting ?
|
|
|
|
|
Ever tried to get the current directory of your service? I think this will not be the directory
you are awaiting, normally its C:\Windows\system32 for services.
So if your dll is not in the C:\Windows\system32 directory you have to find out
where your service install path is.
For example:
Registry.GetValue("HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\[yourservice_name]", "ImagePath", null);
Greetings
Covean
|
|
|
|
|
Thanks Covean. As usual I amde it much more difficult than it needed to be. All I had to do was put the dll in the same directory as the file used to create the service. Thanks, you pointed me in the right direction.
|
|
|
|
|
Give Some Idea to get this Approach
I want to create folder access permission for entire of system ... Once if the folder has assigned to the login permission in our application , that is give a password of access that folder .... Dont access with out permission in authentication person
How can i do this scenario through C#
Thanks
|
|
|
|
|
Your question isn't very clear at all. I'm guessing you want to assign passwords to folders in the file system??
|
|
|
|
|
ya .... Sorry for explanation
Need a folder Access permission... like folder lock software
|
|
|
|
|
This requires writing a file system extension to NTFS. This is something that you cannot do in C#, only C++. On top of that, you also need to write a management app that manages the passwords and can reset them. Of course, you can't just let anyone reset the passwords either. Even that is going to need its own security. By the way, this is always something a newbie comes up with. Noone ever writes it when they find out how much work it really is to do.
|
|
|
|
|
Hi,
I have a text object on my crystal report. The text interpretation is "RTF text". Data in this text object appears in correct format except tables.
What is problem with table?
|
|
|
|
|
The CrystalReport RichTextBox doesn't support tables, and a bunch of other stuff.
You can read more about it here[^].
|
|
|
|