|
amiraf123 wrote: so the problem is with the WebBroser contorl.
any suggestions ?
I'd suggest that it's not the webbrowser-control. See working example below;
[STAThread()]
static void Main()
{
using (var f = new Form())
using (var wb = new WebBrowser())
{
wb.Dock = DockStyle.Fill;
f.Controls.Add(wb);
wb.Navigate("http://www.google.com?q=test");
f.ShowDialog();
}
}
That passes arguments, simply using the "navigate" methods. Is there a COM-control on your HTML-page? Does the user have permission to execute untrusted JavaScript? Any exceptions thrown? Who/which API is used to draw the map? Does it work from a webserver (like 127.0.0.1), as opposed trying to navigate to a local file?
|
|
|
|
|
Hi,
i m using : webBrowser1.Navigate("E:/map.htm?long1=12&lat=12");
the map is drawing by google maps API
again: if i paste this link (E:/map.htm?long1=12&lat=12) into my chrome browser its work perfect!
but when using the webbrowser contor i got nothing.
this is local file.
this is realy crazy , i just cant find the reason for this problem.
|
|
|
|
|
amiraf123 wrote: again: if i paste this link (E:/map.htm?long1=12&lat=12) into my chrome browser its work perfect!
That's hardly the same; the WebBrowser is based on IE, not on Chrome. If you want to use Chrome as a control, you'll have to download the Awesomium component.
The WebBrowser control would also adhere to the security-settings of IE - check whether JavaScript is enabled.
|
|
|
|
|
Hi Eddy,
I solved the problem by uploading the map.htm file to free web server.
It seems like the problem was becouse the i tried to Navigate to the file on my local machine.
So now the Navigate method is path is to the file on the server.
Thanks !
|
|
|
|
|
I am new to WCF REST service and Bing Map APIs...
Can anyone please tell me where to start... I got the Bing Map key... Where do I (which namespace) find the Bing Map APIs (Routes API etc) and add to my project reference?
Thanks.
|
|
|
|
|
Don't repost. It's a weekend - have a little patience!
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
|
Richard,
Thanks for the links... I read those links... But they don't explain which namespace or dill file I have to reference etc... I just need a quick tutorial how to use the BIng Maps Route APIs ... Thanks
|
|
|
|
|
Vijay Kanda wrote: I just need a quick tutorial how to use the BIng Maps Route APIs I am afraid that you will have to look for it yourself. This site exists to help people with specific technical problems, but we do not have the time (or in my case the skills) to provide tutorials on every subject in the IT field.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I am creating a REST Service project (just for learning purpose) and using Bing Map... This is what I want to accomplish...I am sending my current location (Latitude and longitude) to the service and I want to find out all the nearest Mac Donalds (for example) within 1 mile range from my current location and the distance and the time it will take me to get each Mac Donalds... I know there are BING MAP APIs which I can use to accomplish ...
But I never used BING map or rest service before... so can anyone please tell me the Bing Map method/API names which take latitude and longitude as argument and retrun the info that I mentioned above.
Thanks.
|
|
|
|
|
Have a look at Sacha Barber's his zombie article covers most of what you are after.
You can find the article here on CP. I would post a link but I'm writing this on a phone
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Simon,
Thanks... really appreciate it... I could not find the article which you mentioned... please let me know the url when you have a chance...
Thanks again.
|
|
|
|
|
|
Guys,
Create a console application. Select the project name in the solution explorer and Alt-Enter or right-click the properties and select the Application tab. Change the Target Framework to say 3.5 or something else other than 2.0. Paste this line into the Main method:
Console.WriteLine("Version=" + Assembly.GetExecutingAssembly().ImageRuntimeVersion);
and run it. I was sort of expecting to see it display the target framework I selected. Instead it displays v.2.0.50727 even though my target framework was set to 3.5. Obviously, I've misunderstood that line of code. Does anyone know what I can do to get the target version I selected? I don't want to do anything as a result of getting it so I just want to display it.
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
Odd. I pasted your code into my app, and it gave me
Version=v4.0.30319 Which is what I would expect for a V4.0 C# app.
Are you sure you compiled and ran the right version?
Have you tried a full rebuild?
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
OG, I did indeed a clean and a full rebuild. Eddy Vluggen's reply after yours might well be the thing that decides what gets returned. I'll rebuild it in VS2012 and see what pops out of the woodwork as my VS2008 only lists upto 3.5.
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
PHS241 wrote: Instead it displays v.2.0.50727 even though my target framework was set to 3.5.
.NET 2.0 would report the 2.0 framework, but 3.0 and 3.5 are "extensions" to the 2.0 runtime. 4.0 has a new runtime again, so that will report back version 4.
--edit;
There's a distinction between the target-framework, and the supported runtime. If it's a desktop-application, than you'll have an app.config file in there, and an "appname.exe.config" file in your Debug folder.
See MSDN[^].
modified 8-Dec-12 11:40am.
|
|
|
|
|
Thanks Eddy. I'll research the config setting in more detail.
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
for (int i = 0; i < 5; i++)
{
i = int.Parse(Console.ReadLine());
}
Console.Write(i);
Console.ReadKey();
how to get console to print all of the numbers entered (5 numbers)? when i debug this it says that the name 'i' does not exist in current context.
|
|
|
|
|
Put the console.write and console.readkey INSIDE the for next loop. Move the } down 2 lines.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i've tried that, it just writes the numbers straight after the entering, i want it to write all 5 AFTER i've entered the fifth number.
|
|
|
|
|
And that make no sense at all, you would have to put the numbers into a container (array/List<>) and then loop through the container and print them!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
problem in this code is that 'i' is only defined for 'for loop ' to make it run u have to define i before for loop
ex:
int i = new int();
for (i = 0; i < 5; i++)
{
i = int.Parse(Console.ReadLine());
}
Console.Write(i);
Console.ReadKey();
it will not give any error but don't give u the result u want it should be like this..
static void Main(string[] args)
{
int i = new int();
int []arry=new int[5];
for (i = 0; i < 5; i++)
{
arry[i] = int.Parse(Console.ReadLine());
}
for (i = 0; i < 5; i++)
{
Console.Write(arry[i]+"\n");
}
Console.ReadKey();
}
|
|
|
|
|
ok, I thought I could do it without the arrays, but thanks anyway
|
|
|
|
|
Just to add to what the others have said - you don't want to do it like that anyway!
for (int i = 0; i < 5; i++)
{
i = int.Parse(Console.ReadLine());
}
Since i is both the loop control variable and the place you store the value the user entered, if the user enters 4 or above as his first number, it will exit the loop immediately.
You need to separate these two functions into two variables, as well as using an array or List<int>
BTW: It is considered a bad idea to use "magic numbers" such as "5" in your code - when you move to an array, it is too easy to later change one and not the other, causing your application to fail, or crash:
int[] inp = new int[5];
for (int i = 0; i < 5; i++)
{
inp[i] = int.Parse(Console.ReadLine());
}
would be better as:
const int elements = 5;
int[] inp = new int[elements];
for (int i = 0; i < elements; i++)
{
inp[i] = int.Parse(Console.ReadLine());
} That way, you only have to change the number of elements in a single place, and it all works perfectly.
And as a final thing, if your user enters an alphabetic character instead of a digit, your program will crash. You should always check your user input - they do enter rubbish quite often!
[edit]Typos - OriginalGriff[/edit]
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|