|
pubududilena wrote: using C#.Net?
The HttpWebRequest class provides support for the properties and methods defined in WebRequest
and for additional properties and methods that enable the user to interact directly with servers using HTTP.
Do not use the HttpWebRequest constructor. Use the System.Net.WebRequest.Create method to initialize
new HttpWebRequest objects. If the scheme for the Uniform Resource Identifier (URI) is http:
Create returns an HttpWebRequest object.
http://msdn2.microsoft.com/en-gb/library/system.net.httpwebrequest.aspx[^]
led mike
|
|
|
|
|
Hi,
Thanks for reply.
Suppose that in the response ,there are many javascript functions.So after the javacript row ,I can not see response completely.I think that JavaScripts are not working when I request like this.So can you kindly tell me is there a way to execute javascripts and get complete response?.
For Ex:-
In a Tag there is JavaSripts like this:-
buildAvailabilities(startcity,endcity);..
This is not execute in the response page.
Thanks in advance.
|
|
|
|
|
pubududilena wrote: This is not execute in the response page.
Umm yes because the browser executes it and you have no browser in this case. It seems you might have counted on some "magic" occurring when you planed your technical solution. Magic is not a part of software solutions. You really should do some investigating into these technologies for the purpose of understanding them before you embark on a project like this.
led mike
|
|
|
|
|
Can you help me, I have had to decompile some code as they have lost the code and the programmer who created the code is no longer with the company.
Not sure how the code look like before it was compiled and i have not done any work on Anonymous Methods, which i belive it was.
Can someone help me?
<br />
public class UpdateController<br />
{<br />
[CompilerGenerated]<br />
private void <BeginUpdating>b__0()<br />
{<br />
this._updating--;<br />
}<br />
<br />
public IDisposable BeginUpdating()<br />
{<br />
this._updating++;<br />
return new DisposeHelper(new DisposeHelper.DisposeDelegate(this.<BeginUpdating>b__0));<br />
}<br />
<br />
public bool NotUpdating<br />
{<br />
get<br />
{<br />
return (this._updating == 0);<br />
}<br />
}<br />
<br />
<br />
private int _updating;<br />
}<br />
<br />
public class DisposeHelper : IDisposable<br />
{<br />
public DisposeHelper(DisposeDelegate dispose)<br />
{<br />
this._dispose = dispose;<br />
}<br />
<br />
public void Dispose()<br />
{<br />
this._dispose();<br />
}<br />
<br />
<br />
private DisposeDelegate _dispose;<br />
<br />
<br />
public delegate void DisposeDelegate();<br />
<br />
}<br />
Thanks...........
|
|
|
|
|
Yes, it is anonymous methods, but what is your question? You can easily run this through the debugger and be able to trace the fairly simple process.
|
|
|
|
|
i cant get the code to compile?
|
|
|
|
|
What errors do you get?
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Are you using .NET Framework 2.0?
|
|
|
|
|
I'm using .net 2.0 and VS 2005.
When i try and build the code i get the gfollowing errors
Error 1 Invalid token '<' in class, struct, or interface member declaration C:\C# Code\UpdateController.cs 9 22 test
Error 2 Invalid token '>' in class, struct, or interface member declaration C:\C# Code\UpdateController.cs 9 36 test
Error 3 Class, struct, or interface method must have a return type C:\C# Code\UpdateController.cs 9 37 test
Error 4 Identifier expected C:\C# Code\UpdateController.cs 17 77 test
Hope this helps
|
|
|
|
|
|
Hi,
I want to know about the stringbuilder and its use. Can it be used to read a text file line by line for further processing. Right now i m using array to read the whole contents of a text file and then processing it line by line using the array index. Is it possible by using stringbuilder. It is required to process each line in the text file seperately.
Thanx in advnace
|
|
|
|
|
stringbuilder can be used where string concatenation occurs.
|
|
|
|
|
The StringBuilder class has nothing to do with reading a file in. It is there strictly to allow a faster, more efficient method of concatenating strings.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
In code below I convert string to stream and now I have problem.
The value of stremReader.Readline() is never null. What I do wrong?
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(stringToPrint);<br />
MemoryStream stream = new MemoryStream(bytes);<br />
<br />
StreamReader strReader = new StreamReader(stream);<br />
while (currentLine < linesPerPage)<br />
{<br />
lineText = strReader.ReadLine();<br />
if (lineText == null)
break;<br />
<br />
.... more code<br />
thanks
|
|
|
|
|
I would suggest using the StreamReader[^] class:
StringReader sr = new StringReader(stringToPrint);
....
|
|
|
|
|
I think you mean in stringToPrint is path to file, but it isn't. In stringToPrint is text converted from StringBuilder variable and contains more lines.
I just solve problem with the suggest from second reply.
Thanks for your effort.
|
|
|
|
|
I was just providing a suggestion as to prevent needless overhead for reading the string.
Grats on solving the problem.
|
|
|
|
|
try a loop like this :
Do While strReader.Peek() >= 0
Console.WriteLine(strReader.ReadLine())
Loop
|
|
|
|
|
|
Hey guys,
I'm facing a small problem. I have a desktop app made in C# and it workss perfectly fine on my screen resolution but when i deploy on my client's OS all the controls look wierd due to the higher/lower resolution. What can I do about this. I have heard of a library called Klib or something but its paid -
Is there a free alternative. I dont want the controls on my form getting resized, just the spacing would be affected. Any way around this?
Thanks in advance!
|
|
|
|
|
If it's just the spacing you want affecting, check out the anchor property on your form.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello,
I have just finished a card game on C#. I faced some problems while doing the setup.
1. The "Images" folder that i used to take cards pictures from is no more there after doing the setup so when i run the .exe it gives me an exception error.
2. How can i change the icon for the game from the setup ?
3. how can i create a shortcut for the .exe on the desktop from the setup ?
Thanks in Advance.
Jad
|
|
|
|
|
hey,
I have a very simple problem, which I fear has a very complicated solution.
I have a form containing a treeview, consisting of several thousand nodes, and a textbox. I want the treeview to filter it's contents based on a filter string in the textbox. Here comes the tricky part: I want the treeview filter process to run simultaneously with the normal gui thread, such that the user can see the filtering of the treeview happen as he fills the textbox. Due to the large number of nodes in the treeview the call "treeView1.Nodes.Add(..);" which adds the new nodes to the treeview is very slow, and this will effect the responsiveness of the textbox where the user will experience delays as he fills the textbox.
Normally I would put the treeview filtering code in a separate thread, however .NET doesn't allow gui code that updates gui components to run in separate threads, so I'm kind of stuck.
Any ideas?
regards
Jimmy
|
|
|
|
|
You should create a delegate that is modying the form and invoke it in the treeview filtering thread like this m_form.invoke(delegate)
|
|
|
|
|
thank you for the fast response!
Calling Invoke doesn't solve the problem I think, when I call Invoke the process of updating the treeview is transfered to the main gui thread, and thus the delay still happens.
|
|
|
|