|
hi
i have one array in one function .
that array i want send other function.
how can i send that array
plz modify the code i am new to programming.
in runtime iam getting that array .
DoSomething(new string[] { "A text line.", "Another line." });
Hi,
Thanks, if u think it's good.
otherwise sorry.
|
|
|
|
|
premkamalg wrote: DoSomething(new string[] { "A text line.", "Another line." });
this is just a different way to declare and initialize a string.
you could reach the same thing this way:
string[] strArr = new string[2];
string[0] = "a text line";
string[1] = "another line";
DoSomething(strArr);
clear now?
|
|
|
|
|
Hi all,
I have the following problem.
i send a sms to multiple cellnumbers by building a variable like so:
string _SmsTo = "http://sms.co.za/eapi/sub/send_sms/2/2.0?username=Whatever&password=BlahBlah&source_Id=1&message=Hi+Ma&msisdn=" + Convert.ToString(_SmsToNumber);
Now Here is the problem...
right after the "&msisdn=" part i allow the user to insert the numbers.... i store it in the Variable "_SmsToNumber", each number separated by a comma.
but now the variable "_SmsToNumber" gets very long... More than 2048 character long. Then when i run the url, it gives me a error... "System.Net.WebException: The Remote server returned an error:(414) Request URl to large."
Now: is there a way to say... if(_SmsToNumber.Length > 2000) then take only the first few numbers and then take only the first few numbers and send and then take another few numbers and send until all numbers a sent?
Sorry i know the questions might have some holes in it but i struggled to put into words what i am looking for.
Thank you in advance...
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison(*
|
|
|
|
|
I do not know what you are doing but here I am trying to provide steps that are required.
String tempSmsNumber= "";<br />
while(_SmsToNumber.Length >0)<br />
{<br />
<br />
if (_SmsToNumber.Length > 2000)<br />
{<br />
tempSmsNumber =
_SmsToNumber =
}<br />
else<br />
{<br />
tempSmsNumber = SmsToNumber <br />
}<br />
}<br />
<br />
<br />
}
|
|
|
|
|
thank you.
I'll try and put this to use.
Enjoy ur day.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Have you considered the variable length of the message parameter (&message=Hi+Ma), and how this is going to affect the remaining length available to append the phone numbers?
The fundamental problem is the limit on the length of a URI (GET), look to see whether this service supports POST, where you will not have a limit.
|
|
|
|
|
What do you mean POST...
Is it possible to just throw a url out there and not care about a response? Because if it is, that might be one option... if that is what you mean by POST?
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
ps...
I am using the following, if this might help...
HttpWebRequest Request;
StreamReader ResponseReader;
Request = ((HttpWebRequest)(WebRequest.Create(_SmsTo)));
ResponseReader = new StreamReader(Request.GetResponse().GetResponseStream());
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Ha, You were spot on....
i went on the sms providers help files and i came up with this...
"Please remember to URL-encode all parameters passed! Don't reinvent the wheel - rather use one of the countless libraries available. GET requests are allowed, but we strongly recommend using POST requests, especially if submitting a message to a large number of recipients (there can be limits on the size of GET requests)."
BUT how do i use the POST request in C#? and wat does it mean?
Thank You in advance...
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
hello,
I have the values m and n
and according to tham I want to create a graph.
how can I do this in C#?
p.s
I alreday have a the zedGraph component
|
|
|
|
|
Take a bitmap, draw on it and then show it in a picture box.
Bitmap bmp = new Bitmap(500, 500);
int y;
for(int x=0; x<100; x++)
{
y = m * x + n;
bmp.SetPixel(x, y, Color.Black);
}
myPictureBox.Image = bmp;
____________________________________
There is no proof for this sentence.
|
|
|
|
|
I took a look at the ZedGraph component and the article has all of the documentation in it to show how to graph your values.
RTFM
|
|
|
|
|
Hi, I have managed to create an xml file using c# and I can save it to the server no problem but I need to give the client the option of saving it where ever they want to put it so im just wondering if anyone has an idea of how to give the client the option of saving the xml file. Thanks in advance
Tim
|
|
|
|
|
Hi,
Can i know how your client is accessing the file?
Means what type of application is yours??????????
<marquee>nishu
|
|
|
|
|
Hello
Your question is a bit strange:
1- Your subject title is the name of the class you can use to do the task. What's your question?
2- You mentioned you are saving a file over a server? What about security?
Regards
|
|
|
|
|
at the moment the file is created in the asp.net/c# app by clicking a button and the xml file is saved to the root of the application
so i need to use a filedialog to give the client the option to save the file
as for security i have no experience of security so im afraid there is none for now anyway
|
|
|
|
|
Well, It'd be better if you show a treeview with the folders you want the user to be restricted to only, or make a textbox to write the relative path of the file to save. also you might want to check and validate the input in these fields before really creating the file on your server. Showing the entire folder tree of your server is like showing a "Hack me" dialog box!!
I aurge you to revise your security permissions, and other issues before allowing users to access and modify file system on your server.
Regards
|
|
|
|
|
ok thank you for your help
i have found one way of doin it
private void SaveFileToDesktop(string fileName, string fullFilePath, string fileContentType)
{
//*** check if the file exists
if (File.Exists(fullFilePath))
{
//*** create new file and get length
FileInfo iFile = new FileInfo(fullFilePath);
long fileLength = iFile.Length;
//***
Response.Clear();
Response.ContentType = fileContentType;
Response.AddHeader("Content-Length", fileLength.ToString());
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.WriteFile(fullFilePath);
Response.End();
}
}
but i will also take alook at the security side of things and advice about where to start learning about security
|
|
|
|
|
Hi
i want to put a rounded png image on the button.and button look no longer.
i also set the style of button to flat but it display a border how can i transaprent the border
|
|
|
|
|
For God's sake, stop reposting your question over and over again!! This could be what? The tenth time you post the same question about rounded buttons?!! You've taken about a dozen answers in your older threads and now we are all ignoring you because of this very rude reposting!!
Regards
|
|
|
|
|
Hi,
I have a small question.
Suppose i have this code:
while(condition)
{
try
{
if(condition)
{
break;
}
}
catch(exception)
{
//code
}
}
Where would i be if the break statement is executed?
Im trying to get out the while statement. Im just not sure where the break statement would take me.
Thanks in advance!
|
|
|
|
|
According to MSDN the "break statement terminates the closest enclosing loop or switch statement in which it appears. Control is passed to the statement that follows the terminated statement, if any." So control is passed to the statement following your while-loop. Take a look at the MSDN topic[^]; they have an example similar to yours using a for-loop instead of the while-loop
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
hi everyone, i think im in a real trouble, i was developing an application in c# for almost one month and 2 weeks ago i made several backups of the project folder, and now i just cant find it!! whenever i open my project i keep on getting the older versions i made as a back up but not my latest updates on that project!! please help me
|
|
|
|
|
Hi,
If you remember the folders name, try the search function of windows.
|
|
|
|