|
Please Reformat your code to make it readability use Code-Block to Wrap your code.
|
|
|
|
|
hi
i make from my program an excel file (xls or csv)
i send `00123` and in the excel i see `123`
how i can send and see `00123`
thank's in advance
|
|
|
|
|
excel is treating (rightly) that data as a numeric, you need to tell excel it is a string by enclosing it in "" or prefixing it with a single quote ' (I think)
Or better yet change the display format of the cell in excel to pad with preceding zeros.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How to send sms from asp.net without gateway, is it possible?, if so how?
|
|
|
|
|
|
I believe you will be required to have your custom SMS server type thing. For example some custom piece of software running on some septate machine that could pick alerts from your online database after certain intervals and the flush them out in SMS form.
BTW you can also do another trick and that is if your mobile service providers support Email message using mobile phone number then you can simply trigger an Email with mobile number as to address while message content in subject of Email. This Email will be delivered as SMS.
I Web Development Free Lancer
Share your experience with others
Check my Blog...
|
|
|
|
|
May I ask why you do not want to use a gateway?
If it is cost I recommend reconsidering a gateway. I use Twilio (no affiliation) and my cost is USD 0.02 per message. You can literally be up and running in 15 minutes and all you'll have to do is add a few lines of code to your application.
I've seen a lot of people go the route of harvesting all the addresses of the free email-to-sms gateways that the carriers offers as a cheap way of not using an SMS gateway. That will work if you don't mind having absolutely no control over the quality of service or delivery.
Lastly, you can get a GSM modem and put it on the wireless network. This is great as a learning experience but if you intend for your application to ever be used in a production environment, count on at least two dedicated servers on a reliable network plus the costs of a couple of truly unlimited texting plans with a local carrier.
Seriously, have fun learning about all of these options but if you want to save time an learn from your elders find a gateway that meets your needs.
|
|
|
|
|
|
Hi Guys,
Actually, I have been started a Telnet client, but I face a problem on reading the stream.
First, I started my localhost machine Telnet service, and get a tcp connection with it as following.
TcpClient destenationHost = new TcpClient("127.0.0.1", 23); //
Then, I got the streaming to act with it as following:
NetworkStream streamData = destenationHost.GetStream(); //
After that, I Read network stream into a byte buffer.
byte[] bytes = new byte[destenationHost.ReceiveBufferSize]; //
Then, I Read the stream data.
streamData.Read(bytes, 0, (int)destenationHost.ReceiveBufferSize); //
finally, I Return the data received from the host to the console.
Console.WriteLine((Encoding.UTF8.GetString(bytes)); //
I could connect, But I got message like "??%?? ??:??'?? ??".
I tried the Unicode, ASCII, etc, but the result also not satisfied.
I tried also the following code, but it gives me number .
treamReader streamReader = new StreamReader(streamData); //
Console.WriteLine(streamReader.Read()); //
|
|
|
|
|
Do not post the same question in multiple place. You already posted this question in Q&A.
|
|
|
|
|
I really didn't have enough time to read the policy, and I needed how much as can people read the problem.
so I'm sorry for the duplication happened.
However what I did?, nobody answer my till now .
|
|
|
|
|
Yeah, Q&A was a bad idea.
|
|
|
|
|
You are Right, exactly if there is no answer .
|
|
|
|
|
Those may be protocol/handshaking characters. Read up on the Telnet protocol.
And have a look here[^].
|
|
|
|
|
Thank you for your help. Acctually, as you mentioned it might be containg a protocol header, because I got the stream binary and I found somthing like the TTL value.
|
|
|
|
|
1. Print the bytes as numbers. You can use those to determine what character set it is.
2. Get a telnet client from somewhere else, not one you wrote, and connect to the server so you have some idea what it is supposed to be sending to you.
|
|
|
|
|
Thank you for help. I realy got the Microsoft Telnet.exe and tryed to see what the expected result but it's not seems the same result that I got.
But Actually a new massage displayed to me when I tryed to connect my TP-Link router:
"?? "followed with a lot of empty lines,
then "??:;??username".
I enternet the username but no more happened.
when I used Microsoft Telnet.exe I found the username is the first required, that may means I recive somthing for the protocol header in the first and my sent massage not clear also to the server.
|
|
|
|
|
I humbly suggest you try it with my code and step through with the debugger.
|
|
|
|
|
I'm having trouble understanding, or rather some confussion with when to return error codes(User-Defined), true or false, when to throw an exception or handle as another path of logic. In some cases I may be making thing overly complex... I don't know.
For instance.. here is a code snippet where I'm I have a function that gets the correct WMI Namespace. If it returns a valid WMI Namespace, it continues on. In cases like this, is returning false the correct way to do this or should I be returning a user-defined error code? I understand the concept of the Try...Catch as well.. but it's what is supposed to be returned or thrown that makes me confused.
string correctNamespace = GetCorrectWmiNameSpace();
if (string.Equals(correctNamespace, string.Empty))
{
return false;
}
|
|
|
|
|
you choose how you define your methods. The convention in .NET is when they can't do what they are supposed to do, they throw an exception. As a result:
1. File.Exists() returns true or false, as the purpose of the method is to see whether the file exists; both true and false are valid results, both are to be expected, nothing is failing, so no exception.
2. File.Delete() either succeeds or throws an exception, as not deleting the file is considered a failure.
|
|
|
|
|
Luc Pattyn wrote: you choose how you define your methods.
Hi Luc, Thank you for your reply.
|
|
|
|
|
Excellent answer Luc
|
|
|
|
|
Thanks Dave. It took me quite some time to understand it myself, but that was long ago, and now it all seems so obvious...
|
|
|
|
|
This doesn't answer the question, but....
if ( correctNamespace.Length == 0 ) ...
|
|
|
|
|
hi
i have 2 dataset's in my C# program
dataset1 holds table A and dataset2 holds table B
i need to create excell (xls file - not csv file) with 2 sheets
one for table A and one for table B
how to do it in C# ?
thank's in advance
|
|
|
|