|
you'll have to try again I'm afraid, if you want a double backslash, either give four, or use '@'; three backslashes is no good.
I prefer the '@' approach, as that takes and shows the string as intended.
|
|
|
|
|
Yep that's what I did. Just before you fixed my "code" the second time
I guess I'm better of just fooling around.
I used to think....
Finally I realized it's no good.
|
|
|
|
|
looking great now.
|
|
|
|
|
See this[^].it might be helpful.
|
|
|
|
|
what about setting your connection string in web inf instead of code
|
|
|
|
|
|
Try mapping virtual path to physical path using Server object. For example where you are doing
string pathName = "\\td47vc\\public\\Joe\\ASP\\Test";
instead do it something like
string pathName = Server.MapPath("~/Joe/Asp/Test.csv");
Where you need to make sure you are passing correct virtual path to MapPath call. You need to specify it relative to your application root.
I Web Development Free Lancer
Share your experience with others
Check my Blog...
|
|
|
|
|
Hi friends & seniors,
i have a Vc++ dll in which i return a struct of LOGFONT menbers
<pre> struct xyzStruct
{
LOGFONT a;
}
extern "c" __dllspec ... xyzStruct a()
</pre>
this data is populated in vc++ dll and passed to a C# form
in the C# side i have created
<pre>[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
public class LOGFONT
{
public int lfHeight = 0;
public int lfWidth = 0;
public int lfEscapement = 0;
public int lfOrientation = 0;
public int lfWeight = 0;
public byte lfItalic = 0;
public byte lfUnderline = 0;
public byte lfStrikeOut = 0;
public byte lfCharSet = 0;
public byte lfOutPrecision = 0;
public byte lfClipPrecision = 0;
public byte lfQuality = 0;
public byte lfPitchAndFamily = 0;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=32)]
public string lfFaceName = string.Empty;
}
</pre>
then i make pinvoke to the DLL
<pre>
[StructLayout(LayoutKind.Sequential)]
public class xyzStruct
{
public lOGFONT a;
}
[dllImport ("Dll name")]
public static extern xyzStruct a();
</pre>
i get error "methods signature is not pinvoke comaptible"
i try using int in struct in both dll and form everything works fine.
thanks in advance
Regards
Samir
|
|
|
|
|
Make your method in the C++ library return a pointer to a LOGFONT instead, import the method in C# with IntPtr as return type and use Marshal.PtrToStructure to get the structure in C#.
|
|
|
|
|
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.
|
|
|
|