|
Hello,
string oldtest = "test";
object o = oldtest;
string newtest = o as string;
Would not be possible with an value type!
All the best,
Martin
|
|
|
|
|
Moreover strings have some interesting features.
string s1="Hi";
string s2="Hi";
Both s1 and s2 will point to same location.
Again if you say s2="Bye", memory is allocated of "Bye" and s2 will point to the new location.
Try to search on mutable and immutable properties of string.
That will give you a clear idea of strings..
Regards,
Arun Kumar.A
|
|
|
|
|
Tahnks a lot..ur reply(short and sweet) helped me a lot..
|
|
|
|
|
Hi,
Im trying to print out an image, but if it doesnt fit onto one page, i cut it up and place what evers left onto the next page.
Bitmap tempImage = new Bitmap(image, tempSize);<br />
RectangleF origRects = new RectangleF(0, 0, image.Width, image.Height);<br />
e.Graphics.DrawImage(tempImage, tempRect, origRects, GraphicsUnit.Pixel);<br />
<br />
if (tempImage.Height >= e.MarginBounds.Bottom)<br />
{<br />
int newHieght = tempImage.Height - e.MarginBounds.Bottom;<br />
<br />
tempRect = new RectangleF(0, newHieght, tempRect.Width, newHieght);<br />
tempSize = new Size((int)tempRect.Width, (int)tempRect.Height);<br />
<br />
e.HasMorePages = true;<br />
return;<br />
}<br />
<br />
e.HasMorePages = false;
The problem is that i draw the first page fine, but the second page, the image is the correct height, but instead of drawing the bottom half, it draws the top half of the image and cuts of what should be drawn.
Obviously, the cords are wrong, but what do i need to change?
regards,
Gareth.
|
|
|
|
|
Have you looked at Graphics.TranslateTransform ?
|
|
|
|
|
Hi friends,
why we are not using new keyword with string..
|
|
|
|
|
When creating new strings, you use the new keyword. Example:
string s1 = new String('-', 42);
When assigning a string literal, you are not really creating a new string object, just using a string object that already exists as a constant in the code. Example:
string s2 = "Hello world!"
When creating a new string by using a method that returns a string, the creation is done in the method, so you don't use the new keyword. Example:
string s3 = s2.ToLower();
When creating a new string by concatenating other strings, you are really using the String.Concat method. The + operator is shorthand for calling String.Concat. Example:
string s4 = s2 + s3;
string s5 = String.Concat(s2, s3);
---
single minded; short sighted; long gone;
|
|
|
|
|
Same reason we aren't using the new keyword with int, double, etc.: the value is often specified in-line; the new keyword would be unnecessary cruft.
Under the hood, of course, we are allocating a new string.
|
|
|
|
|
Hi,
Presumably this is a common enough problem, but I can't seem to find a neat way of doing it!
The problem is I need to convert a .doc file to a .pdf, on the server side - so I can't automate Word to do it (yes I'm aware it can be done with Office2007, which I have, but this app will have to be left unattended - this is not the designed use for Word).
Does anyone know of any open source tools that would be able to do this?
Thanks
What if the Hokey Kokey IS what it's all about?
|
|
|
|
|
Hi friends,
As System.Int32 is a struct(value type) while Object is a class..and its been said that Object is a base class for dot net classes..well its true bcoz even integer object shows all the properties and methods of object class..Now my Question is that whether stuct(System.Int32 here) can inherit any Class(object here)...?though its been clearly said that structs can not be inherited.
Reply Soon..Plz
|
|
|
|
|
Yes, System.Int32 is a struct. If you treat it as an object:
object o = 5;
An operation known as boxing occurs: new memory is allocated to hold an object, and the value of the integer is copied from the stack to the heap.
Search this site for articles on value and reference types for more info.
|
|
|
|
|
Hi all,
i am using clickonce Deployment method to update my windows application,
i have created a update buttion and when this update buttion is clicked the code written inside buttion will check update version and intemates the user.
BUT WHEN I IMPLEMENT ABOVE in my actual application its not at all installing,
wat could be the solution?
please help me
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Prashanth, are you receiving an error? Can you give error details, or alternately, show us the code that's failing?
|
|
|
|
|
if (ApplicationDeployment.IsNetworkDeployed)
{
// Get a reference to the current deployment
ApplicationDeployment current =
ApplicationDeployment.CurrentDeployment;
// Hook up async event handlers
// Check for updates asynchronously
current.CheckForUpdateAsync();
//if i found updated version i am updating clients software
}
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Ok - that doesn't actually download any updates; that just checks if there is an update and notifies you via the ApplicationDeployment.CheckForUpdateCompleted .
Can you tell me what's happening: is an error occurring? Is any of the event handlers being fired? Do you ever call ApplicationDeployment.UpdateAsync() method?
|
|
|
|
|
Try this:
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment.CurrentDeployment.Update();
}
|
|
|
|
|
Prashanth, please post here on the forums instead of emailing me. Posting on the forums allows other people to see the solution, helping others as well as yourself.
ClickOnce is a solid technology -- don't abandon it just because you had some problems getting it working right. It's going to be a lot of work to do your own deployment technology.
If you're absolutely set on doing your own, I cannot help; I've never attempted such a task.
|
|
|
|
|
Prashanth, have you read this article[^]? It covers every step on how to do application updates using ClickOnce.
|
|
|
|
|
thnx alot mr. Judah Himango
i have tried AGAIN click once for some sample applictions and its working fine
but when it comes to my actual application its giving error
APplication Has encountered a serious problem and need to close....
i think this is because i have used normal MSI Setup method and now wants to install the same using CLICK once
does doing like this will effect,
is it so
thnx alot for all ur respnose and reply
Have a nice time
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Then the problem appears to be with your application, not ClickOnce. Attach a debugger to your process or add some unhandled exception handling (e.g. Application.ThreadException event) and see what code is failing.
p.s. If your app needs to first install some prerequisites, you can accomplish this using ClickOnce bootstrapping. There's a free tool you can use to generate an MSI installer bootstrapper for your ClickOnce application: ClickOnce MSI Bootstrapper[^].
|
|
|
|
|
Hi,
I hope someone can help me, I'm new at this forum too I've writed a trainer for WinMine (Windows Minesweeper). This is the code I now have:
Buffertje = new byte[6];
Buffertje[0] = System.Convert.ToByte(0x90);
Buffertje[1] = System.Convert.ToByte(0x90);
Buffertje[2] = System.Convert.ToByte(0x90);
Buffertje[3] = System.Convert.ToByte(0x90);
Buffertje[4] = System.Convert.ToByte(0x90);
Buffertje[5] = System.Convert.ToByte(0x90);
WriteProc("winmine", Buffertje, 0x1002FF5);
public bool WriteProc(string Proc, byte[] Bytebuffer, int Address)
{
bool Success = WriteProcessMemory(InitProc( Proc ), Address, Bytebuffer, Bytebuffer.Length, 0)
return Success;
}
The programme freezes the time of WinMine to 1 now! So in fact, it's working. But now I'm trying to change the code to let it also work for Windows Pinball. The address of the score in Pinball is 0x011CAEBA, but my problem is my var "Buffertje". I don't get what does 0x90 means? I know it is an OpCode, but don't know how to change those opcodes..
Can someone help me?
|
|
|
|
|
|
Hi,
How can i limit/set the network bandwidth in Socket Programming.
If I am connected with 100 Mbps network. But i want to use 50 Mbps.
How can i set that in Socket Programming.
Thanks
Sakthi.
|
|
|
|
|
You can't. You'll have to write your own packet driver for the network stack. This is something you'd have to use C++ for.
|
|
|
|
|
hi Dave,
Please give me some idea to Proceed
Thanks
Sakthi.
|
|
|
|
|