|
|
Search for books on Amazon about DirectX. I'm reading a couple and they explain a bit of this, though not using the advanced techniques of modern 3D engines for games. That takes experience and deep research into modern game programming.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
No, Mueller hints at this in his book "In Search of the Lost Win32API."
I have not seen anybody actually write code for a Windows Application.
All the texts write their code for Console Applications.
Dave Brighton
|
|
|
|
|
I want to know how to send data from one form to another? Like lets say I want my program to put data in the textbox of another form, how would I go about doing this?
Thanks,
K
|
|
|
|
|
This was anwserd so many times in thsi forum ...
Search a little.
But the idea is to pass a refrence of the form with the textvox to the form that wants to change that textbox in the constructor.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
|
Thanks, but what if I didn't create the class for the textbox I want to send to. For example, if I wanted to send info to a text box in a web browser, where I can start the process with the Process class, but how would I access a reference to it?
|
|
|
|
|
That's been answered many times as well. You need to get a handle to the process (see the System.Diagnostics.Process class in the .NET Framework SDK) then P/Invoke FindWindow and FindWindowEx to get the window handle (HWND - represented by an IntPtr in .NET) of the control. Then you can P/Invoke SendMessage to send WM_SETTEXT to the HWND with the text you want to set. Search this forum for more information, and see the Platform SDK for details. Previous experience with Windows messaging will definitely be a plus.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks alot I saw your previous post with the code. I searched for this, but I wasn't getting back results that applied to what I wanted to do, I guess the keywords I was searching for weren't specific enough.
K
|
|
|
|
|
Hi,
What is the best way to store encripted passwords?
I'm using a simple XML file to store the passwords but I don't know how to store the key used in encriptation in a safe way.
The passwords are to connect to a database, so they need to be tranformed back to the original values.
Thanks
|
|
|
|
|
You might want to look up documentation of the following method. I think it is what you are looking for
FormsAuthentication.HashPasswordForStoringInConfigFile
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
DrGreen wrote:
The passwords are to connect to a database, so they need to be tranformed back to the original values.
That's not a good way to do it. You should store passwords in a one-way hash (like MD5) which someone else mentioned. Instead of sending clear-text passwords across the wire (which can be easily sniffed) and decrypting the passwords from the database to compare, a much more secure approach is to hash the clear-text password and compare that with the password in the database. This can be done better by using a SALT value and other mechanisms to avoid replay attacks.
There are several articles about this here on CodeProject.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
can anyone tell me to create a prev/next in datagrid. I would like to display record in a datagrid with multiple pages.
thank You
|
|
|
|
|
I take it this is in reference to ASP.NET's DataGrid ? If so, this belongs in the ASP.NET forum. Really, though, the documentation is pretty clear about how to do this and even includes examples.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
In general you are talking about pagination, maybe a google on "datagrid pagination" is in order.
if you are referring to asp.net, research the following properties of the datagrid;
AllowPaging
AllowCustomPaging
event:
PageIndexChanged
Good luck!
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
Hi
I want to be able to create an Type from an string.
I have tried using Type.GetType(string). But I just cant get it too work.
Im getting assembly not found in msorlib thing or the executing assembly errors.
Im trying to get the Type from for example Type.GetType("TextBox"). But this dont work since the program doesnt seem to know where to look.
How can I load the System.Windows.Forms assembly so it knows where to look?.
|
|
|
|
|
Have you tried Type.GetType("System.Windows.Forms.TextBox") ?
|
|
|
|
|
Yes and I allways get an TypeLoadException.
The problem is that the Type.GetType method searches the executing assembly in this case an testlibrary.
"An unhandled exception of type 'System.TypeLoadException' occurred in xmltestlibrary.dll
Additional information: Could not load type System.Windows.Forms.TextBox from assembly TestLibrary, Version=1.0.1589.1600, Culture=neutral, PublicKeyToken=null."
|
|
|
|
|
Then you have to force .NET to load the correct assembly:
<br />
String name = System.Reflection.Assembly.CreateQualifiedName("System.Windows.Forms", "TextBox");<br />
<br />
System.Reflection.Assembly a = System.Reflection.Assembly.LoadWithPartialName("System.Windows.Forms");<br />
<br />
Type t = a.GetType("System.Windows.Forms.TextBox", true, false);<br />
|
|
|
|
|
Thx it worked like a charm.
|
|
|
|
|
And after you get the Type like Corrina said, then you can use a number of ways to instantiate it, like Activator.CreateInstance . See the .NET Framework SDK documentation for more ways, like getting the constructor with a certain parameter list and calling that to create a new instance with the parameters you want.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I know that. Then I can use various methods to be able to execute methods.
I can even load an unknown dll and search it find and class and call methods.
So I know about the capabilities.
As I replied to Corrina.
Yes and I allways get an TypeLoadException.
The problem is that the Type.GetType method searches the executing assembly in this case an testlibrary.
"An unhandled exception of type 'System.TypeLoadException' occurred in xmltestlibrary.dll
Additional information: Could not load type System.Windows.Forms.TextBox from assembly TestLibrary, Version=1.0.1589.1600, Culture=neutral, PublicKeyToken=null."
I dont get it. I've looked at examples but they arent very helpfull.
|
|
|
|
|
Notice how it's trying to load a Type that should be in the System.Windows.Forms.dll assembly? You have to specify a correct partial or full Type, like:
Type t = Type.GetType("System.Windows.Forms.TextBox, System.Windows.Forms"); Notice the assembly name in there, too? If you want to get specific, you can also include the version, culture, and publicKeyToken attributes.
There are plenty of examples - even in common .config sections do you specify the fully-qualified Type name and either a partial of full assembly reference. If you don't specify the assembly, then it assumes the Type name is in the currently executing assembly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
HI!
I want to detect CPU usage and Net speed using PerformanceCounter, but the vaules are always 0.
For net speed here is the code:
private void GetNetSpeed()
{
PerformanceCounterCategory category = new PerformanceCounterCategory("Network Interface");
foreach(string adapter in category.GetInstanceNames())
{
if(adapter == "MS TCP Loopback interface")
continue;
PerformanceCounter netRCounter = new PerformanceCounter("Network Interface","Bytes Received/sec",adapter);
PerformanceCounter netSCounter = new PerformanceCounter("Network Interface","Bytes Sent/sec",adapter);
txtSys.Text += "Recived: " + netRCounter.NextValue().ToString() + " b/s.";
txtSys.Text += "Sent: " + netSCounter.NextValue().ToString() + " b/s.";
}
}
Could anybody tell me way is always 0?
HELLO!
|
|
|
|
|
would like to know how to get hold of excel cells using the Excel namespace?
Is there anyone with ideas, I need to read a lot of data and manipulate it from a spread sheet.
thanks
Dries
|
|
|
|