|
I have tried diffrent urls.. like localhost, and the other PC that is right next to me..
and I don't have proxy settings..
they all hangs... -_-
|
|
|
|
|
Don't know then. I've tried your code slightly modified (below) and it works fine. Suspicion turns to the timer. If you call this just once from Main rather than repeatedly, does it work?
public static void Main(string[] args)
{
System.Net.WebRequest request = null;
System.Net.HttpWebResponse response = null;
request = System.Net.WebRequest.Create("http://news.bbc.co.uk");
WebProxy p = new WebProxy("...our proxy", true);
p.UseDefaultCredentials = true;
request.Proxy = p;
response = (System.Net.HttpWebResponse)request.GetResponse();
}
Regards,
Rob Philpott.
|
|
|
|
|
yes! it only works for 2times.
the third time... hangs.. -_-
sometimes it goes more then two times, but the result is the same eventually..
|
|
|
|
|
Then something isn't clearing up properly. Are you using a Windows Forms timer? I'm wondering if the Response stream needs to be disposed or something. Will have a play...
Regards,
Rob Philpott.
|
|
|
|
|
I've managed to reproduce it, it hangs on the second time. As I just eluded to, its because your response stream doesn't get disposed.
Stick this after you call GetResponse() and I think you'll be ok:
response.GetResponseStream().Dispose();
Regards,
Rob Philpott.
|
|
|
|
|
#define P 0x8408
main()
{
register unsigned int b, v;
register int i;
printf("typedef unsigned short u16;\n");
printf("static u16 fcstab[256] = {");
for (b = 0; ; ) {
if (b % 8 == 0)
printf("\n");
v = b;
for (i = 8; i--; )
v = v & 1 ? (v >> 1) ^ P : v >> 1;
printf("\t0x%04x", v & 0xFFFF);
if (++b == 256)
break;
printf(",");
}
printf("\n};\n");
}
===> C# ?!?
|
|
|
|
|
Actually, it would look pretty much the same, except that you would replace printf with Console.WriteLine
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
<code>
static int Main()
{
//C++ TO C# CONVERTER NOTE: 'register' variable declarations are not supported in C#:
//ORIGINAL LINE: register uint b, v;
uint b;
uint v;
//C++ TO C# CONVERTER NOTE: 'register' variable declarations are not supported in C#:
//ORIGINAL LINE: register int i;
int i;
Console.Write("typedef unsigned short u16;\n");
Console.Write("static u16 fcstab[256] = {");
for (b = 0;
{
if (b % 8 == 0)
Console.Write("\n");
v = b;
for (i = 8; i--;)
v = v & 1 ? (v >> 1) ^ DefineConstants.P : v >> 1;
Console.Write("\t0x{0:x4}", v & 0xFFFF);
if (++b == 256)
break;
Console.Write(",");
}
Console.Write("\n};\n");
}
internal sealed class DefineConstants
{
public const int P = 0x8408;
}
</code>
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++
|
|
|
|
|
Is there some sort of black magic to keep code snippets from being butchered here?
The 'code' tags don't appear to actually do anything and even though I un-selected 'auto-encode...', I still get the ridiculous emoticons...
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++
|
|
|
|
|
Hi all,
One of my server application I've log all information into text files, on my own pattern.
For ease of use I'm going to write an application to analyze the log. What I'm looking to do is, read the text file line-by-line and match some strings. Depends on that validation doing different process and display, may be on a UI.
Is that way is effective. Comments are really appreciate.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi,
you can use regular expressions to match the strings. For defining different processes depending on that validation I would suggest using the strategy pattern.
Should the logfile analysed only once? If not you have to find a mechanism so that you knwo which line you already read and which not.
Regards
Sebastian
|
|
|
|
|
Hi,
Thanks for commenting
Actually log file analyze only once. Later I want to compare two logs, say for socket and internal process something.
I've think about one thing. Read the whole file once and store all line in a collection framework. But I want to choose which is the best.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Wll reading the whole one file once and storing them in a collection will be very memory and time consuming I think. If this is not a problem for you then go on, but if it is... depending on the comparison you want to do I would try sth with reading line by line (without storing) etc.
|
|
|
|
|
Hi
I advance thanks for ur help.....i am developing send SMS from PC to Multiple recipients using C# application.shall you help me.Give me how to i proceed this project further,i am a Final year MCA Student...
Thankyou
G.Thenmozhi
|
|
|
|
|
I think there are no differences between one or multiple recipients.
For example, if you want to send it using mobile phones, which connected to PC, you must use class SerialPort, if the mobile phone is connected to serial port.
The AT command for sending SMS, you can find it, for example if you use Nokia phone, then find it in Nokia website. There is a PDF document about Nokia AT command.
|
|
|
|
|
oviyaa wrote: am a Final year MCA Student...
But you don't know how to use a search engine ?
There is no built in SMS support, so you need to find a library that supports it. Which makes your project a joke, all you will do is call some SDK that you didn't write. Choose something else. This time, not at random, but based on what you know how to do, and will make your teachers happy.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Thenmozhi,
We shaal help you , but can you tell us where are you stuck (any exception or bug ) or are you still to start , if that the case than you need to decide one way out of the following ways available.
There are few options to select from when it comes to sending an SMS to multiple user using your computer , i would list few of them
1) You can use SMS Gateways , there are many gateways (websites) available which allows to send sms at nominal rate , you need to go to this websites , register , buy credit , they provide you with set of function which you can use and send SMS , it is different for different providers ,for list of such providers you can google "SMS Gateways".
2) The second way is to connect your mobile phone to the computer and send SMS (you can connect you phone to computer using comm port ) when the SMS is send it is routed through your mobile , to send SMS using your phone you need to use AT command set. Your phone has a GSM modem in it (most of the phone have) this modem understand commands called as AT commands , using this command set you can send SMS through your phone from your PC , there are many controls available to do this stuff , but if you dont want to purchase it and write the code by our self you have to learn few AT commands (not very hard) and serial port programming (again it is not very hard ). Here is an example, also you can goolge "Sending SMS using GSM Modem" or "Sending SMS using AT command set" to get more info on this.
http://www.codeproject.com/KB/IP/Sending_SMS_using_Net.aspx[^]
3) There are GSM modem available in market , which comes with the software to send SMS to multiple recipient (please confirm this with the vendor before purchasing one) , this kind of device cost you in the range of 100$-200$ , and is easily available.
This is all for now , let me know if you require any further details.
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
if (SMSPort.IsOpen == true)
{
SMSPort.WriteLine("AT" + (char)(13));
SMSPort.ReadLine();
Delay(3000);
if (SMSPort.ReadLine().Contains("OK"))
{
SMSPort.WriteLine("AT+CMGS=" + strRPhNo + (char)(13));
Delay(2000);
SMSPort.WriteLine(" " + strALL + (char)(26));
do
{
Delay(100);
if (SMSPort.ReadLine().Contains("OK"))
{
SMSPort.WriteLine("ATQ0" + (char)(13));
return true;
}
}
while(iTmeOut<10) ;
SMSPort.WriteLine("ATQ0" + (char)(13));
strErrLog = "Message Not Send " + DateTime.Now;
return false;
}
else
{
SMSPort.WriteLine("ATQ0" + (char)(13));
strErrLog = "Modem not Reponding" + DateTime.Now;
return false;
}
}
else
{
strErrLog = "Port is Closed" + DateTime.Now;
return false;
}
}
this part of code may help
|
|
|
|
|
SMSPort = new SerialPort();
SMSPort.PortName = COMMPORT;
SMSPort.BaudRate = 4800;
SMSPort.Parity = Parity.Even;
SMSPort.DataBits = 7;
SMSPort.StopBits = StopBits.One;
SMSPort.Handshake = Handshake.RequestToSend;
SMSPort.DtrEnable = true;
SMSPort.RtsEnable = true;
SMSPort.NewLine = System.Environment.NewLine;
|
|
|
|
|
Hi Sir thankyou very much for ur reply... Now i download the sample project and work with them.I connect my mobile (Sony Ericsson w200) with PC via USB DataCable.Application shows perfect connection with PC and Mobile.But it won't send/receive any commands......I check commands (AT) with hyperterminal...It rise the following error
When i send AT commands as follows
AT
OK
ATE1
OK
AT+CMGF=1
+CMS: 303 ERROR
and also i check with application it throws following error message as,
"Phone Reports Generic Communication Error or Syntax Error"
I check with GSMComm Library means it throws following error
"Phone Reports Generic Communication Error or Syntax Error"
[GsmComm.GsmCommunication.CommException]
kindly guide me how to i proceed this project further....
Thankyou
|
|
|
|
|
How to i establish the connection with PC and GSM Mobile(Sony Ericsson W200) what are way to establish the connection with PC and Mobile.....
For that connection what are the requirements need? whether i install any specific drivers for my modem....
Guide Me
|
|
|
|
|
|
Hi
can any one send me the links of some samples on System.Drawing or on Pens, brushes, colors and fonts?
ravi vellanki
|
|
|
|
|
Microsoft have so much money, they can afford to run websites with documentation and so on. There's also a site called code project, it has tons of articles, you may have heard of it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
how to import excel sheet datas into sql server2005 using asp.net
|
|
|
|