|
To reduce memory consumption should all instances of a particular class need read-only access to the same value. If they also need write, then you need to synchronize access to the member.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
fmardani wrote: ///////???????Please explain why static may be used with the private access modifier??????////////////////
The simple answer is: because it doesn't need be more visible than that.
As a general rule, you should make your methods/properties no more public than they need to be. This makes it easier to refactor the class later if you choose to.
Regards,
Alvaro
|
|
|
|
|
Hi I'm looking for ANY resources on financial problems and their solutions in .NET 1.1. Especially various multi currency and rounding issues. If you know ANY resource be it web, book, event or course please tell me about it.
Thanks in advance!
Kind regards,
Johannes Hansen
frontAvenue A/S
-- modified at 7:47 Friday 6th January, 2006
|
|
|
|
|
Dear All,
I want to write a code for backup and restore of sql database in C#. Please help me for code.
PS-I know how to execute Stored procedures and queries of SQL in C#
With Regards
Manoj
|
|
|
|
|
hey guys i want to restrict paste option for my textbox control in windows application.
how do i do this in c#
|
|
|
|
|
Trap the Ctrl+V event on the textbox and
clear the Clipboard before the paste event
Regards,
Pramod
|
|
|
|
|
Yadav Pramod wrote: clear the Clipboard before the paste event
Why is this necessary? It seems overly aggressive to silently clear the contents of the clipboard.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
You may be able to implement this by (a) removing the Paste item from the textbox's context menu (accessible using the ContextMenu property) and (b) handling the KeyPress event to ignore Ctrl/V.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Have a look at this[^] article. It traps the paste event (overrides WndProc and handles WM_PASTE), which is what you wanted.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
Lets say I have a website called www.ABC.com, which is the main site. I have other sites, for example www.ABC.co.za, and www.abc.com.au. If the user selects www.abc.com, it must determine that the user is from Australia and redirect him to www.abc.com.au.
The above sites I used just as examples. But I think eBay has this feature.
If anyone has such sample code, please let me know.
Regards
ma se
|
|
|
|
|
You have to determine this by ip address then redirect them to the contry subdomain.
here is some sample code.
' This sample code is provided as is, for aiding understanding.
' I make no warranty about its fitness for purpose.
' If you find it useful please use it.
' Don't expect me to sort out any problems unless you are prepared to pay me.
' Written by Paul Stanley Software http://www.pssuk.com
' Set IP string, 1st check for proxy
sIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if sIP = "" then
sIP = Request.ServerVariables("REMOTE_ADDR")
end if
' Handle extended IP addresses
nComma = Instr(sIP, ",")
if nComma > 0 then
sIP = Left(sIP, nComma - 1)
end if
set oConnIP = CreateObject("ADODB.Connection")
sConn = "Driver={Microsoft Access Driver (*.mdb)}; Dbq="
sConn = sConn & Server.MapPath(".") & "\IPCountry.mdb"
sConn = sConn & "; Uid=admin; Pwd="
oConnIP.Open sConn
set oRSip = CreateObject("ADODB.RecordSet")
oRSip.ActiveConnection = oConnIP
oRSip.CursorLocation = adUseClient
nIP = Dot2LongIP(sIP)
sSQL = "SELECT [CountryShort] FROM [IPCOUNTRY] WHERE " & CStr(nIP) & " BETWEEN [ipFrom] AND [ipTo];"
oRSip.Open sSQL, oConnIP, adOpenForwardOnly, adLockReadOnly
sCountry = oRSip("CountryShort")
function Dot2LongIP (ByVal DottedIP)
Dim i, pos, PrevPos, num
' Convert IP String like "1.12.124.22" to 32 bit integer
if len(DottedIP) < 7 or isnull(DottedIP) or DottedIP = "unknown" then
Dot2LongIP = 0
else
PrevPos = 0
for i = 1 To 4
pos = InStr(PrevPos + 1, DottedIP, ".", 1)
if pos = 0 then
If i = 4 Then
pos = Len(DottedIP) + 1
else
Dot2LongIP = 0
exit function
end If
end if
num = Int(Mid(DottedIP, PrevPos + 1, pos - PrevPos - 1))
PrevPos = pos
Dot2LongIP = ((num Mod 256) * (256 ^ (4 - i))) + Dot2LongIP
next
end If
end function
|
|
|
|
|
Hi all,
Currently .Net supports multiple file types such as bmp,jpg, gif etc just to name a few , which is supported by Image class
Can anyone please help me, how can i convert a bmp file to a raw format file using .NET?
|
|
|
|
|
What format do you mean by raw format? There are a whole bunch of them...
---
b { font-weight: normal; }
|
|
|
|
|
You can ask Canon for their SDK for the series of cameras they offer - specifically, their RAW format as well. You just have to fill out a Web form and they'll email you a URL & password to download it.
If you ask Nikon for theirs, they'll give it to you only after signing your name in blood, sending the forms in triplicate to Japan, then swearing on penalty of death you wont share the SDK with anyone else...
Oh, and the SDK examples are written in C++ / Win32 DLL's
The RAW 'format' differs with each camera manufacturer - I think there's a move afoot to standardize it, but don't hold your breath.
Cheers,
-Red
The madman is not the man who has lost his reason; the madman is the man who has lost everything except his reason.
--G.K. Chesterton
|
|
|
|
|
Hi , thanks for replying
hi from my understanding, pls correct me if im wrong, still quite green in these areas.
whats make a bitmap really a bitmap is becos it contains headers and information which is appended to the image file. this will be the same case as jpg etc.
In the case of a raw file, it only contains the image itself with out any headers and information. it is the only original format without any appending is actually done.
raw -> bmp
raw -> jpg
It is different from the raw format from cameras etc, the manufactuer has their own priperty way to handle their images before converting to bitmaps/jpg
the outcome will be the same as what photoshop can do , open a .bmp file and save as .raw file
i have try experimenting on Devil.net image conversion but it cant work as what i wanted, the bmp file is 256kb but after conversion it is 1 mb.
pls help
|
|
|
|
|
Oh, that kind of raw file.
You need the image data to be uncompressed, and it is in a bmp file. So, the easiest way is converting a bmp file to a raw file by removing the header so that only the image data is left. The bmp image has to be a 24 bit image, though.
Go to wotsit.org[^] and download the spec for the bmp format, to get the size of the header.
---
b { font-weight: normal; }
|
|
|
|
|
hi to all,
i have a treeview with some nodes with checkboxes
when the user check or uncheck a parent node, i want to check or uncheck all the child nodes (child nodes are maybe checked or unchecked)
can someone post some code sample
best regards and thanks in advance
fady
|
|
|
|
|
Hi!
You can solve this task by using a simple recursive function:
void CheckChildNodes(TreeNode parent, bool checked)
{
parent.Checked = checked;
foreach (TreeNode nd in parent.Nodes)
CheckChildNodes(nd, checked);
} Regards,
mav
|
|
|
|
|
|
since my project is a forms app written in C# this seems like the spot for this.
i have installed the directx sdk 2005, i have the microsoft namespaces in my c:\\windows\assembly folder, but when i try to include one of these namespaces my compiler generates an error saying that namespace Microsoft.DirectX doesn't exist. The only microsoft namespaces are microsoft.win32 and 2 other which i can't remember right now.
so i've installed the sdk, allowe it to add references to the .net framework but i ca't use the namespaces
i would like to add these namespaces to my project but don't know what to do any help guy's?
m$: It is normal for your screen to go blank and for your computer to restart itself several times
|
|
|
|
|
In your project, did you add references to the Managed DirectX .DLL's?
I think th filenames all start with Microsoft.DirectX.xxxx.dll?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 9:12 Friday 6th January, 2006
|
|
|
|
|
i would like to romove or hide title bar from the window form. how can i acheive this functionality.
Amit Grover
CDAC R&D
|
|
|
|
|
Hi Amit,
just clear the text property of the form and change the FormBorderStyle to Single/Resizable..
Regards,
Pramod
|
|
|
|
|
Hi everybody,
I am developing a library for my company and encounter a problem. In my code, I need to know and enumerate through all the derived classes of a base class. Are there any way to get the derived classes of a base class by using reflection in C#?
Hope your replies, thanks.
Lan hue sau ai lan hue heo
Lan hue sau doi trong heo ngoai tuoi
|
|
|
|
|
You can iterate over every type in an assembly and check IsAssignableFrom(yourBaseType)
|
|
|
|