AFAIK, ';' tells the modem to return to return to command mode after the phone was dialed. How this may help? I tried it, but still there is no sound :( Thanks for your advice.
Evgeni57
Posts
-
Dialing modem -
Dialing modemI tried, but there is still now voice :(
-
Dialing modemtried to put 3 seconds sleep between each command, but it still dials withut the sound.
-
Dialing modemthis is the code:
serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1\_DataReceiver); serialPort1.Open(); string answer; serialPort1.Write("ATM2\\r"); answer = serialPort1.ReadLine(); //answer = "\\r" serialPort1.Write("ATL3\\r"); answer = serialPort1.ReadLine(); //answer = "OK\\r" serialPort1.Write("ATDT" + phone + "\\r"); answer = serialPort1.ReadLine(); //answer = "\\r" serialPort1.Write("ATH\\r"); answer = serialPort1.ReadLine(); //answer = "OK\\r" serialPort1.Close();
'answer's' value are commented. thanks.
-
Dialing modemI used ATDT as well - no sound :(
-
Dialing modemHi, I'm trying to dial phone number and using SerialPort control for this, which is initialized with my USB modem.
SerialPort serialPort1 = new SerialPort("COM5", 115200, Parity.None, 8, StopBits.One);
serialPort1.Open();
serialPort1.Write("ATDmyphone\r");
serialPort1.Write("ATH\r");
serialPort1.Close();everything works except 1 thing - there is no sound from the modem. I tried to use ATM2 and ATL3 commands before I start to dial - but there was still no sound. But when I create dial-up network connection, and dial from its dialer - there is a sound. What am I missing here? thanks!
-
Modem issueHi all... I have a ThinkPad, T400 laptop with windows 7 professional 64 bit on it, which has built-in modem - ThinkPad Modem Adapter, which is attached to COM3. Everything worked very well until I plugged some external modem (via USB), which was detected perfectly by windows, and attached to COM5. After I plugged the external modem sound from both of the modems disappeared. I've searched in any place I could think about where to change modem's volume, tried to configure it with ATL[0-2] command, removed USB modem, removed internal modem, installed it once again - nothing, there is no sound. It does works, it dials the phone numbers, but without any single sound, and sound is what I need most of all! Any ideas how can I fix it? thanks in advance!
-
Phones validator.I have a list of phone numbers, some of them are valid and some of them aren't. I have to write a simple program, which will check which phone number is valid and which isn't. I thought to use SerialPort for this, but how can I disconnect directly after the first beep (before somebody answers the phone) or after I got message from the carrier that the phone number isn't valid? Or may be there is some other way to solve it? Thanks in advance
-
Scanning IE8 memory.Hi all. I need to get non-persistent cookie from IE8 process. I use ReadProcessMemory API. Since the key never changes there is no problem to locate it in the memory using simple scaning. But it appears that coockie's value doesn't comes after the key in the memory. Is there any way to locate the cookie's value while only the key known? thatnks.
-
Getting cookies from IE process. [modified]Hi all, I need to get cookies which currently in use with one of my browsers (IE8), but IE doesn't log it into cookie text file. I'm looking for cookies in "C:\Users\username\AppData\Roaming\Microsoft\Windows\Cookies" folder in username@hostname[i].txt file. And in "C:\Users\username\AppData\Roaming\Microsoft\Windows\Cookies\Low" folder. How I can do it? Reading of non-persistent cookies is what I actualy need. Is there any way to do it? thanks!
modified on Sunday, June 6, 2010 3:01 AM
-
Json -> java objectHi There is no problem to convert JSON which looks like this:
"{\"response\": {\"Code\":200, \"Text\":\"Ok\", \"Id\":\"123\"}}
to the following object:public class JsonCL
{
private int Code;
private String Text;
private int Id;setters; getters;
}
But what about the JSON, which contains arrays of data, and nested arrays? For example:
{\"response\": {\"Code\":200, \"Text\":\"Ok\", \"Id\":\"123\", \"data\":{\"groups\": [{\"key1\":\"value1\", \"nestedData\":[{\"key1\":\"value1\", \"key2\":\"value2\", \"key3\":\"value3\"},{\"key1\":\"value4\", \"key2\":\"value5\", \"key3\":\"value6\"}]},{\"key1\":\"value2\", \"nestedData\": [{\"key1\":\"value7\", \"key2\":\"value8\", \"key3\":\"value9\"},{\"key1\":\"value10\", \"key2\":\"value11\", \"key3\":\"value12\"}]}]}}}
How can I convert such JSON into java object? Thanks! -
inserting byte array into mysql DBHi, I'm new in Java and have the following task to do: I have some data stored in gzip byte array and I have to insert it into MySQL database. I'm using DBCP (Apache Tomcat 6.0.20) not JDBC. I tried the following code:
PreparedStatement pstmt =(PreparedStatement)con.prepareStatement("insert into test_tb (id, data, compressed_data) values(?, ?, ?)");
pstmt.setString(1, cl.getOwner());
pstmt.setString(2, "");
pstmt.setBytes(3, cl.getCompressedData());
int i = pstmt.executeUpdate();but this didn't work because of Cast Exception - java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement cannot be cast to com.mysql.jdbc.PreparedStatement What is the right way to do it? Thanks.
-
HttpWebRequest exception handlingI have some function, which makes HttpWebRequest and returns response (string). Everything works fine except cases when it gets 502 status - Bad Gateway. In this case try-catch block:
try
{
m_Rresponse = (HttpWebResponse)m_HttpWebRequest.GetResponse();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
if (m_Rresponse.StatusCode == HttpStatusCode.BadGateway || m_Rresponse.StatusCode == HttpStatusCode.GatewayTimeout ||
m_Rresponse.StatusCode == HttpStatusCode.InternalServerError || m_Rresponse.StatusCode == HttpStatusCode.ServiceUnavailable)
{
Console.WriteLine("Sleeping 10 seconds...");
Thread.Sleep(10000);
}
}The question is why In case of BadGatway "Sleeping 10 seconds..." never printed? Thanks
-
C# and MySQLWell, I tried it but it didn't work. Here is a part of my code, can you tell me, please, what I did wrong?
MySqlConnection connection = new MySqlConnection(MyConString); MySqlCommand command = connection.CreateCommand(); try { connection.Open(); Console.WriteLine("Connected to DB"); } catch (Exception e) { Console.WriteLine("Failed to connect to DB"); return; } command.CommandText = "truncate table test\_tb"; command.ExecuteNonQuery(); connection.Close(); StreamReader sr = new StreamReader("somefile.txt", Encoding.GetEncoding(1251)); string line, query; string\[\] data; byte\[\] temp = new byte\[10000\]; int j = 0; while ((line = sr.ReadLine()) != null && j < 10) { data = line.Split('~'); query = "insert into test\_tb (name, id) values(N'" + data\[2\] + "'," + j.ToString() + ")"; /\*Some parsing was done here, data\[2\] contains 1251 encoded string\*/ temp = ASCIIEncoding.GetEncoding(1251).GetBytes(query); command.CommandText = ASCIIEncoding.GetEncoding(1251).GetString(temp); connection.Open(); command.ExecuteNonQuery(); connection.Close(); ++j; }
The column in table os varchar(1000) type, with windows-1251 encoding thanks a lot.
-
C# and MySQLHi all. I have some issue with data encoding. I have a txt file, which was open like this: StreamWriter m_ComissionShopWriter = new StreamWriter(Directory.GetCurrentDirectory() + "\\logs\\1.txt", false, Encoding.GetEncoding(1251)); then I user WriteLine method to put there some data, which was taken from some stream: sr = new StreamReader(stream, Encoding.GetEncoding(1251)); After, I try to load it into table, which has the following collumn: varchar(100) cp1251_general_ci Insertion goes great! But when I run select query on it, I got some junk data instead of readable, 1251 encoded, data. What is wrong, and how can I fix it? Thanks!
-
Append cookies in httpwebrequestHi, When I do request from web browser my cookies look like this:
Cookies/Login:
CLIENT_WIDTH_DIR=1276
CLIENT_WIDTH_DIR=250
CLIENT_WIDTH=250
MAIN_WIDTH_DIR=1066
MAIN_WIDTH_DIR=60
MAIN_WIDTH=60
PHPSESSID=cb49a7c6928e0cdd1892f2bdc0322173But when I use the following code:
myHttpWebRequest.Headers.Add(HttpRequestHeader.Cookie, "CLIENT_WIDTH_DIR=1276");
myHttpWebRequest.Headers.Add(HttpRequestHeader.Cookie, "CLIENT_WIDTH_DIR=250");
myHttpWebRequest.Headers.Add(HttpRequestHeader.Cookie, "CLIENT_WIDTH=250");
myHttpWebRequest.Headers.Add(HttpRequestHeader.Cookie, "MAIN_WIDTH_DIR=1066");
myHttpWebRequest.Headers.Add(HttpRequestHeader.Cookie, "MAIN_WIDTH_DIR=60");
myHttpWebRequest.Headers.Add(HttpRequestHeader.Cookie, "MAIN_WIDTH=60");
myHttpWebRequest.Headers.Add(HttpRequestHeader.Cookie, "PHPSESSID=cb49a7c6928e0cdd1892f2bdc0322173");the cookies look like:
CLIENT_WIDTH_DIR
1276,CLIENT_WIDTH_DIR=250,CLIENT_WIDTH=250,MAIN_WIDTH_DIR=1066,MAIN_WIDTH_DIR=60,MAIN_WIDTH=60,PHPSESSID=cb49a7c6928e0cdd1892f2bdc03221732 lines, broken, instead of 7 and, of course, session id is wrong and nothing works. How I can set the cookies right? Thanks.
-
C# and JavaScript. [modified]Still no ideas :)?
-
C# and JavaScript. [modified]Hi all, Sometime ago I wrote some automation tool to get content of some site. Everything worked fine untill one day... My C# code creted url string and made http hit. I used HttpRequest and Response. Request looked like http://somesite.con/param1=a¶m2=b¶m3=c Now, there was a change in the site and it always makes redirect to the url that looks like: http://somesite.con/param1=a¶m2=b¶m3=c&rnd=AbCdEfG1. With the fiddler I saw that actially web browser makes 2 hits: 1. The old one. 2. The new one. Now the response of the first hit contains some JS code that generates this random code (AbCdEfG1), concatinates it to the main url and makes redirect. As far as I understand I need to execute this JS from C#. It's may be done in the several ways and seems not too complex to do. But then I need to or: a. get back this random value from JS. b. allow to JS to make redirection, but need to get back the response. I prefer the b. because code that generates this random value always different (code generation or something). The code of JS is something like that:
html>
<head>
<title></title>
</head><script type="text/javascript"> function redirect() { var redirectLoc = window.location.href; if (redirectLoc.indexOf ('?')>-1) redirectLoc +="&"; else redirectLoc+="?"; redirectLoc = redirectLoc.replace (/rnd=\[0-9a-zA-Z\]+&/,""); window.location = redirectLoc+'rnd='+f1(); } </script>
<script type="text/javascript">
function sbbpWvum()
{
nCc = typeof "zCa";
return String.fromCharCode(nCc.charCodeAt(4)^37);
}
function f1()
{
return sbbpWvum();
}Any one can help with this isue? Thanks.
modified on Friday, August 14, 2009 10:04 AM
-
Playing flv files [modified]100%. I've played it with FLV video player.
-
Playing flv files [modified]I have the following code:
string name = "c:\\\\1.flv"; axShockwaveFlash1.Movie = name; axShockwaveFlash1.Play();
And there is no playback. But when I try playing some swf file - everything is OK. What am I misising? Thanks.
modified on Thursday, May 14, 2009 12:32 AM