|
is there any example in the site for such proxy ?
|
|
|
|
|
Not that I know of. Even though it's pretty straight forward as far as Sockets go, noone who asks about something like this seems to get through an entire project. If you want a functional example of the concept, just Google for "SpamBayes".
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Ill look for SpamBays, thank you.
Today i made a http proxy server,
made a server and client using winsock, the server is listening to specific port and when ie try to get out to the web the server accepts the call and sends it throgh its own client to the desired location.
then made changes in ie->tools->internet options->connections->lan setting and wrote the new proxy address i made.
The thing i need to figure/understand now is how to make a program which is not ie go through my proxy, bet its hard. you have any idea ?
thank you.
|
|
|
|
|
Hello gurus,
I'd like to know how can I convert 15 bits colors to 24 bits colors and vice versa?
Can anybody show me some code snipet to do that in both ways?
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
Multiply the colour components by 255/31.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
I have a client server application and i am writing messages from the client to the XML file. sometimes the files reaches 1GB. Operating such a large XML file creates lot of problems such as memory, time. there may be loss of data too.
please suggest me a method to operate my file with less memory?????
Thanks in advance...
Praveen Raghuvanshi
Software Engineer
|
|
|
|
|
XML is a bad choice handling large amounts of data.
Use XmlTextReader and XmlTextWriter for reading/writing XML files. Do not use XmlDocument (it stores the whole document in RAM). Use XML only for import/export of data, store it inside a normal binary database for normal usage.
|
|
|
|
|
If your XML file is getting that big, then there seems to be an architectural problem here. Have you considered using a database instead (much better suited to things like this).
Alternatively, you may want to consider SAX (Simple API for XML) which is an event based rather than tree based API. See http://saxdotnet.sourceforge.net/index.html[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I think you should consider to use the SAX approach. XmlDocument uses DOM and the whole document is loaded into the memory (as mentioned above).
The SAX approach takes parts of the document only, which may be your solution...
SAX is stream based and the stream is bi-directional. Which means you can write and read. It uses events. Unfortunately I can't help you about the .NET implementation of SAX. I don't know if there is any ...
You may search for the MSXML (Microsoft XML Core Services). I think this is available as COM object.
You also may want to see the following page : http://sourceforge.net/projects/saxdotnet[^]
Hope it helps.
P.S. if you find a solution to this problem - please drop us a line ...
|
|
|
|
|
I get a string in the following format from an Html file after calling a GetAttribute method:
file:///C:/Documents%20and%20Settings/azabobonin/My%20Documents/My%20Pictures/Einstein.jpg
How can I format that string to look normally:
C:\Documents and Settings\azabobonin\My Documents\My Pictures\Einstein.jpg
Is there a way of getting the string the way it is writen in the Html file, and not the way it returns from GetAttribute method?
Thank you
|
|
|
|
|
try the Replace function.
string test = "file:///C:/Documents%20and%20Settings/azabobonin/My%20Documents/My%20Pictures/Einstein.jpg";<br />
test = test.Replace("%20", " ");
hope this helps.
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
Use HttpUtility.UrlDecode and then replace the / with \.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I found the solution.
<br />
Uri uri = new Uri(element.GetAttribute("src"));<br />
string filePath = HttpUtility.UrlDecode(uri.AbsolutePath);<br />
Thank you.
|
|
|
|
|
I wanted to have milliseconds component being added to my DateTime object. It only returns dateTime till seconds. How can i get milliseconds.
DateTime currentDate = DateTime.Now // this statement returns time upto seconds
How can i get milliseconds?????
Thanks in advance
Praveen Raghuvanshi
Software Engineer,
|
|
|
|
|
Try:
DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss:ff");
hope this helps
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
V. wrote: DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss:ff");
That only goes to centiseconds.
|
|
|
|
|
you can go up until fraction 7 ( so "fffffff")
|
|
|
|
|
Thanks a lot.....
Praveen Raghuvanshi
Software Engineer
|
|
|
|
|
praveen raghuvanshi wrote: I wanted to have milliseconds component being added to my DateTime object. It only returns dateTime till seconds. How can i get milliseconds.
DateTime currentDate = DateTime.Now // this statement returns time upto seconds
How can i get milliseconds?????
The milliseconds component is in there. Is your question about storing to millisecond accuracy, or getting the current time to millisecond accuracy?
A DateTime object can store to milliseconds. e.g.
Console.WriteLine("Now: {0}", DateTime.Now.ToString("HH:mm:ss.fff");
|
|
|
|
|
Thanks for ur effort, i got my answer
Praveen Raghuvanshi
Software Engineer,
Wins Infotek Pvt. LTd.
Technopark, Trivandrum
India.
|
|
|
|
|
Hi,
Iam trying to verify a user account present in the local computer using DirectoryEntry.
The code is as given below:
public bool TestUserLoginInComputer(string userNamePath, string userPassword)
{
try
{
DirectoryEntry myUser = new DirectoryEntry(string.Format("WinNT://" + _machineName + "/" + userNamePath + ", user"),userNamePath, userPassword);
if (myUser != null)
{
mname = admin.Name;
mypath = admin.Path;
return true;
}
else
{ return false; }
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Iam getting an exception saying "Logon failure: unknown user name or bad password.". Even though I hav given correct username and password. I hav checked with several accounts, but same problem.
Please sumone cud help me out .
Thanks in advance.
Martin
|
|
|
|
|
Hi,
I get this error: ArgumentOutOfRangeException
In this line:
this.Invoke(new DelA(delegateA), new object[] { s });
This is the environment of this code:
void delegateA(string s)
{
if (this.InvokeRequired)
{
this.Invoke(new DelA(delegateA), new object[] { response });
}
}
I've tried a few things to fix this, but im running out of suggestions.
Any suggestions anyone?
Thanks in advance!
|
|
|
|
|
Hello,
Is "response" a string?
Does youre DelA have an string parameter too?
Martin
|
|
|
|
|
Hi,
Yes on both questions.
|
|
|
|
|
Hello,
Could you post the full code of youre method and the delegate?
Martin
|
|
|
|