|
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.
|
|
|
|
|
What part of "you can't do that in C#" don't you understand?
|
|
|
|
|
Hi All,
How can i change the value of the hashtable at run time. The Value for the Hastable is already set. Now i have to replace with my Value. Please anyone help to solve this issue.
Regards,
A Jabeer Ali
|
|
|
|
|
Hello,
You have to remove the oldvalue over the key and add the new value!
All the best,
Martin
|
|
|
|
|
hi
i have 3 tables : t_books,t_sessions,t_titles that has master/details relation together :
t_books(bookID(PK),bookName) -> master
t_sessions(sessionID(PK),bookID(FK),sessionName) -> details
t_sessions(sessionID(PK),bookID(FK),sessionName) -> master
t_titles(titleID(pk),sessionID(fk),titleName,text,footerPage) -> details
when i search in these 3 tables, and create relation for these tables, the following error has shown me when i add dataRelation to my dataset :
These columns don't currently have unique values
my request is : how to search in 3 tables with relational data and show the result in treeView ?
thanks
|
|
|
|
|
I'm attempting to write a file to a removable drive. When the app gets to the point where it creates the StreamWriter, it's stops and tells me access to the *whatever*:\ drive denied. I have administrator rights, and have also given the app admin rights by "running as admin". Is there something I should be doing besides the usual to get this working? Is what I'm doing correct?
private void button1_Click(object sender, EventArgs e)
{
string usbDriveLetter = listBox1.SelectedItem.ToString();
string sPath = usbDriveLetter;
sPath = usbDriveLetter.ToString();
StreamWriter sw = new StreamWriter(sPath);
...and so on
Thank you for your input.
|
|
|
|
|
check!!may be your flash drive is write protected
|
|
|
|
|