|
It does work apparently.... I know that default for enabledecompression is true. That means, if you get a compressed response client will decompress it. But when you actually set it to true right after Webservice class initialization, it somehow(behind the scenes) adds compression attribute to the header of the request....To conclude enabling "decompression" serves double duty: 1) requests compression and 2) enables decompression amazing
|
|
|
|
|
mishakogan wrote: amazing
and undocumented! You might want to be concerned about future compatibility.
|
|
|
|
|
By this code i get the output downloaded to a browser....
Process p = new Process();
p.StartInfo.FileName = "iexplore.exe";
p.StartInfo.Arguments = rptUrl.appURL;
p.Start();
i want to write same output to a folder...How can i do?.
My below code is not working....how can i fix?.
WebClient user = new WebClient();
user.DownloadFile("rptUrl.appURL","c:\\storeData.txt";);
|
|
|
|
|
It seems as there's an extra semicolon on the second line, in the code that doesn't work (since this smiley came with: )
This is what it should look like:
user.DownloadFile("rptUrl.appURL","c:\\storeData.txt");
Try if that works.
Virtual1ty
--
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
can anyone give the code tat fullfills the "auto suggest for textbox" task.
i have employee database . when i type something in text box i must get employee details containing that word or character to a list box.
i must get the employee from employee database onlyy
plz some 1 help me
THanx In advance
|
|
|
|
|
Try looking at the TextBox Documentation. Maybe the three properties that start with the words "AutoComplete" might be helpful.
|
|
|
|
|
I have a c# application which can be launched in different modes. Multiple instances of this application can be launched provied no other instance of the application is running with the same mode. e.g.
My c# application can work in two different modes say
1. abc
2. xyz
What I want is when I try to launch my application in "abc" mode, before launching the application, it should check whether any other instance of the application with "abc" mode is running or not. If instance with "abc" mode is running then running instance will be returned else new instance with mode "abc" will be launched.
There is mechanism in my application through which I can set the mode prior launching the application. As of now, I don't have any idea on how to implement this requirement. I'm seeking some ideas and suggestions on how I can implement such requirement.
Thanks
Krunal C
|
|
|
|
|
|
mike,
Thanks for your reply.
I viewed the article you have given prior posting my question. But the article only mentions how to prohibit multiple launching of the application. In my case I have to check the mode of the application prior allowing or prohibiting my application. So I'm confused how I can store application mode related information and how I can validate this information prior launching my application.
Hope now my question is more clear.
|
|
|
|
|
KrunalC wrote: I viewed the article you have given prior posting my question.
Yes sorry, that was not helpful, try looking at the System.Threading.Mutex class. I have not proven it but I suspect it could be used to fulfill your requirements.
|
|
|
|
|
Mutex class can help you. If the mode of your application cannot be changed by the user while it is running, then you can create one mutex for "abc" mode and another one for "xyz" mode. For an example of using mutex class to restrict multiple instances have a look at Making the application single-instance section at Window tray minimizer[^]
|
|
|
|
|
Are the multiple instances of the application to be launched on the same system or networked computers?
How many different operating modes are allowed? Two? More than two?
Phil
|
|
|
|
|
Pbraun,
Thanks for your response.
Instances to be launched on the same system only. I have two different operating modes in which my application works. Pls revert with your idea or questions if any.
regards,
Krunal C
|
|
|
|
|
hi .
i create an application that in save operation , save with *.ddi extension.
when a file with this extension (*.ddi) click in windows , want to run my application and show it.
such as *.pdf files that when a user click it Acrobat reader run and show it.
tanks.
|
|
|
|
|
|
Use the FileAssociation class from the link Mentalis[^]
*jaans
|
|
|
|
|
You'll want to change the Main() method of Program.cs to Main(string[] args) , and pass them along to your main Form constructor. And of course your main Form will need another constructor that accepts a string array. In that constructor you can look at the string array for file names, and do with them as you please.
To register the file association, you can do that manually, or if you have an install project you can set up file associations there too.
|
|
|
|
|
How to break For Loop.........in C#
Regards,
KK
|
|
|
|
|
You just said it. Use break. Something like this:
<br />
for (int i = 0; i < 5; i++)<br />
{<br />
<br />
if (i==3)<br />
{<br />
break;<br />
}<br />
}<br />
|
|
|
|
|
Can I point out here that it is generally a bad idea to break out of a loop. This normally means that there is a problem with the design.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have a listbox on a form that displays data from a registry key of value multistring. This listbox is filled when the form loads by this code:
RegistryKey getItems = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\RegKey_test");
if (getItems.GetValue("Items") != null)
{
string[] itemName = (string[])getItems.GetValue("Items");
for (int i = 0; i < itemName.Length; i++)
{
listBox1.Items.Add(getItems.GetValue("Items", itemName));
}
}
This works fine. But when I want to set the listbox items to the registry with the following code, an error occurs:
if (getItems.GetValue("Items") != null)
{ Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\RegKey_test", "Items", listBox1.Items.ToString(), RegistryValueKind.MultiString); }
I no that something is wrong with this line of code but I am not sure what it is. Can anyone advise me where I am going wrong please?
Lucy
|
|
|
|
|
What error are you getting? Is it an exception? What I don't like is
listBox1.Items.ToString() as listBox1.Items returns ObjectCollection and when you convert it to string you will get name of the type and not the items of listbox.
|
|
|
|
|
I didnt think that part was right. The error it returns is:
The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted.
If I just leave it as listBox1.Items the same error occurs.
|
|
|
|
|
I guess you are getting ArgumentException aren't you?
According to MSDN: "If the type of the specified value does not match the specified valueKind, and the data cannot be converted, ArgumentException is thrown"
If you have a look at definition of RegistryValueKind.MultiString it says: "Specifies an array of null-terminated strings, terminated by two null characters. This value is equivalent to the Win32 API registry data type REG_MULTI_SZ." In reality listbox.Items.ToString() retuns just a string while listbox.Items retuns ObjectCollection which is incompatible too. That's why you are getting the exception.
What are you trying to achieve?
|
|
|
|
|
Yes I am getting an ArgumentException.
I have a form with a listbox. When the form loads, each string in the multistring registry key is put into the listbox as an item. The user can then edit these items as well as removing and adding items. The items then need to be set as values back in the multistring registry key by the click of a button. Does that make sense?
|
|
|
|