|
I want to use pointers.bt the problem is c# does not provide pointers.
Is there any other method?
Regards,
chanzeb chaudhary....
|
|
|
|
|
C# does provide for pointers, but you need to compile with 'unsafe' code, so you need to set that option.
And then use the <font color="333333">unsafe</font> keyword, either for your class, or just like an if statement:
unsafe class myClass
{
}
class myClass
{
static void main(string[] args)
{
unsafe {
}
}
}
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
You can use pointers in C#. All you have to do is mark a method as unsafe (and change the assembly to allow unsafe code) and you are good to go.
|
|
|
|
|
Can we Serialize the static variables and generic lists ?
B V KIRAN KUMAR
|
|
|
|
|
Bhimuni wrote: Can we Serialize the static variables and generic lists ?
What have you tried? The best way to find something out like this is to write a piece of code that attempts to do just what you have asked. This way, you learn problem solving skills, rather than relying on somebody else to do your thinking for you - especially as they may well end up giving you incorrect information.
|
|
|
|
|
I have hosted a dhtml control on a C# form. I can not figure out a way to catch its text drag events.
|
|
|
|
|
I have an application that uses the System.Windows.Forms.WebBrowser control from .net 2.0.
I have noticed that the window does not resize when the window.ResizeTo javascript method is called.
However, when a AxSHDocVw.AxWebBrowser browser component is used instead, the same javascript works absolutely fine - resizing the browser control and the form containing it. I have a demo project that uses both types of controls on the same HTML page and for some reason the Windows.Forms.WebBrowser control just will not pick up the resize event.
This may be related - I've noticed that if you extend both controls, and override WndProc, the AxSHDocVw control will receive messages for WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED but the other control will not.
Does anyone know what the problem is or how to fix it? It is not possible for me to use the AxSHDocVw component instead.
|
|
|
|
|
Hello experts,
How can I manage global variables through out the application in C#.Net...?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Use a static class. For instance:
public static class MyClass
{
public string MyKey = string.Empty;
} To refer to it in other places, you would use MyClass.MyKey = "Hello";
|
|
|
|
|
Create a public class named like Global
and make some public static property and access it in application anywhere
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hello!
Ive been trying to make a regular expression remove everything from a string that´s not a numeric d1-10 with comma and d1-2 after. The expression looks like this:^\d{1,10}(\,)?(\d{1,2})?$, and I try to use it like this:
original = Regex.Replace(original, @"^\d{1,10}(\,)?(\d{1,2})?$", "");
but this amounts to nothing. If original for instance would be "345,46 £" I would want the £ and the blankspace removed. Does anyone know what Im doing wrong?
|
|
|
|
|
There are a couple problems with your code and regex.
First, the regex will match the correct pattern of 345,46, but only if it's at the beginning and end of the line (because you specify the ^ and $ before and after it). Because your input string has " £" at the end, your regex won't match.
Assuming that "345," is not a valid number, then the "(\,)?(\d{1,2})?" part should be "(,\d{1,2})?". If "345," is a valid number, then the "(\d{1,2})?" part should really be "\d{0,2}". I'm going to assume that "345," is not valid though.
Now, the actual parameters to the Replace method are incorrect also. Assuming you don't have any back references in the "replacement string", then whatever is match will be replaced. So you would be replacing the number, not the "extra" stuff.
Based on this your regex needs to be "^.*?(?<num>\d{1,10}(?:,\d{1,2})?.*?$", and your replacement string needs to be "${num}". This will extract the FIRST number to match the pattern. So in "123,4 dd 567,89", the resulting string will be "123,4".
Basically, we match the entire input string with our regex, but we save the number in the group named "num". Then we reference that group to generate the output.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
|
No problem. Please get the regex from my previous post again, though. I forgot to use & l t ; so the <num> part was removed.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi again!
I´ve tried your example but cant quite get it to work. In its original form I get an error message, "Not enough )'s". If I alter the regex to look like this
original = Regex.Replace(original, @"^.*?(?<num>\d{1,10}(?:,\d{1,2})?.*?$)", "${num}")
nothing happens with my string.
|
|
|
|
|
Sorry, the missing paren goes before the last .*?, so:
^.*?(?<num>\d{1,10}(?:,\d{1,2})?).*?$
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
|
Hi
Few question if any one knows answer plz let me know
1. What is MAC address ?
2. Is it unique to every system in a network
3. How to know the MAC Address of Clients System.
4. If Q2 answer is yes then how to find all the MAC address of the ' Systems connected in a network using C# code
Plz if any idea also share with me
REGARDS
Tiwari
its me sid
|
|
|
|
|
sindhutiwari wrote: 1. What is MAC address ?
MAC address - Wikipedia[^]
sindhutiwari wrote: 2. Is it unique to every system in a network
Yes
sindhutiwari wrote: 3. How to know the MAC Address of Clients System.
Goto command prompt and type ipconfig/all
sindhutiwari wrote: 4. If Q2 answer is yes then how to find all the MAC address of the ' Systems connected in a network using C# code
Use ManagementClass in System.Management
|
|
|
|
|
Thanks for ur reply i am having a code to know the mac address ...i am getting the mac address of my system along with that i am getting some other things also please see to this and help me out
ManagementObjectSearcher query = null;
ManagementObjectCollection queryCollection = null;
query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration");
queryCollection = query.Get();
foreach (ManagementObject mo in queryCollection)
{
if (mo["MacAddress"] != null)
{
MessageBox.Show(mo["MacADDress"].ToString());
}
}
its me sid
|
|
|
|
|
It should be noted, however, that it's possible to spoof a computer's MAC address, so two systems could be given the same address. However, this would cause all sorts of networking problems.
|
|
|
|
|
Hi guys,
I have a C# 2.0 project in VS 2005 under Vista. When I try to debug it, it throws Error:
The requested operation requires elevation
I can build it and when run from .exe it throws the UAC dialog.
I don't know what's so special about this project that it needs to be run under administrator rights. It is a regular win app with one attached dll. That attached dll is used in other projects too, which don't demand "elevation". I know I could probobly use the mt.exe utility but I don't want to, because there is no reason to bother user with aksing for administrator rights that are not required for this app.
any ideas?
zilo
|
|
|
|
|
hello,
how can i write the debug trace to a log file
regrads
dghdfghdfghdfghdgh
|
|
|
|
|
One way to do it would be to use the TraceListenerTextWriter class. This[^] sample shows you how.
|
|
|
|
|
Google it.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|