|
pankaj.indore wrote: Now I want to add one more shortcut that will open my home page...
Create a internet shortcut file which navigates to your home page and add this to start menu
|
|
|
|
|
Thx for your reply,
For that I have to creat an new exe that will navigates to home page.
I don't want to create any more exe's.
Is their any method to directly navigate the page...?
Regards
Pankaj Joshi
|
|
|
|
|
I am not talking about exe. A single file, internet url shortcut, clicking on the file will open up the specified website
|
|
|
|
|
Hello sir,
It's working thx a lot.
Regards
Pankaj Joshi
|
|
|
|
|
Hi Pankaj
Please check my post !!!!
|
|
|
|
|
Hi Pankaj,
Use This one, I have done the same thing few times ago.. now it will help you.
Call Function
urlShortcutToDesktop("My Home Page ", myurl);
Function Defination
private void urlShortcutToDesktop(string linkName, string linkUrl)
{
string deskDir = Environment.GetFolderPathEnvironment.SpecialFolder.DesktopDirectory);
using (StreamWriter writer = new StreamWriter(deskDir + "\\" + linkName + ".url"))
{
writer.WriteLine("[InternetShortcut]");
writer.WriteLine("URL=" + linkUrl);
writer.WriteLine("IconIndex=0");
FileStream fs = new FileStream("C:\\Internet.ico", FileMode.Create);
Resource1.Internet.Save(fs);
fs.Close();
string icon = "C:\\Internet.ico";
writer.WriteLine("IconFile=" + icon);
writer.Flush();
}
}
internet.ico store in a Resource file, as Internet. AS i used Resource1.Internet.Save(fs); U can use this icon in ur own way also
Let me know when done.
|
|
|
|
|
Thx for your reply sir,
But I am querious where to write this code and how it works...?
I am asking to ad an web page short cut with my application like
Start>Programs>ABC Corp>
1. Application
2. Help file
3. Uninstall application
4. Home page
Please reply
Regards
Pankaj Joshi
|
|
|
|
|
ok, then create a simple internet shorcut file with your home page id and store it into Program menu path [ While Creating Setup ]
In Setup project.....
There is s Sesction "User's Program Menu" where you can put this link also with all others stuff.
Good luck !!!!
|
|
|
|
|
Abhijit Jana wrote: private void urlShortcutToDesktop(string linkName, string linkUrl)
{
string deskDir = Environment.GetFolderPathEnvironment.SpecialFolder.DesktopDirectory);
using (StreamWriter writer = new StreamWriter(deskDir + "\\" + linkName + ".url"))
{
writer.WriteLine("[InternetShortcut]");
writer.WriteLine("URL=" + linkUrl);
writer.WriteLine("IconIndex=0");
FileStream fs = new FileStream("C:\\Internet.ico", FileMode.Create);
Resource1.Internet.Save(fs);
fs.Close();
string icon = "C:\\Internet.ico";
writer.WriteLine("IconFile=" + icon);
writer.Flush();
}
}
WHY all these when we have an easy option for creating internet shortcut
|
|
|
|
|
can you please inform me how we can create shortcut?
Thanks in advance.
|
|
|
|
|
Because i have a problem when view in IE and Firefox. The result view in firefox don't give me what i need like i view in IE.By some experiment,i think it's about and .
Do firefox have a problem with <iframe> ?
Can i remove <!DOCTYPE> tag ?
another question..
Can i use javascript(outside tag <html>) to decide whic DOCTYPE version to use?
Thank =)
-- modified at 23:08 Tuesday 23rd October, 2007
|
|
|
|
|
bug_aonz wrote: Do firefox have a problem with <iframe> ?
No it don't have any problem with firefox. Only thing is you need to make sure whatever you have written is up to w3c standards.
bug_aonz wrote: Can i remove tag ?
You can remove Doctype. It will correct the display problem. Previously browsers used to ignore this tag and render whatever it understood from the HTML elements. But now the scenario got changed, and page will be rendered depending on the Doctype, I mean changing doctype can change the design. But removing won't make any problem.
|
|
|
|
|
bug_aonz wrote: The result view in firefox don't give me what i need like i view in IE.
With almost complete certainty, the page is rendered correctly in Firefox and incorrectly in IE. You have built your page to rely on rendering bugs in IE, which makes it look different in all other browsers that doesn't have the same bugs.
bug_aonz wrote: Do firefox have a problem with ? </blockquote>
Not at all.
<blockquote class="FQ"><div class="FQA">bug_aonz wrote:</div>Can i remove <!DOCTYPE> tag ?</blockquote>
Removing the doctype make the browser display the page in quirks mode. For Firefox this doesn't cause much problems, but in IE it makes a huge difference, as it makes the browser work more or less like IE version 4.0, complete with the box model error and everything.
<blockquote class="FQ"><div class="FQA">bug_aonz wrote:</div>Can i use javascript(outside tag <html>) to decide whic DOCTYPE version to use?</blockquote>
No. The doctype tag has to be the first thing in the page, otherwise it's ignored, and the browser is thrown into quirks mode.
<div class="ForumSig"><small><small>---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams</small></small></div>
|
|
|
|
|
I create an XML document using the following:
XmlDocument doc = new XmlDocument();
doc.LoadXml(WeatherProxy.NDFDgen(dlatitude, dlongitude, gov.weather.www.productType.timeseries, System.DateTime.Now, System.DateTime.Now.AddDays(7) ,WeatherParameters));
doc.Save("../../forecast.xml");
Everything works great and the data requests are very flexible. WeatherParameters contains about 20 different bools for parameters.
The xml file is loaded with DATA!
Anyway, the nodes for the specific data like daily high temp for example are matched with time-span key-layout nodes. I need to match these keys that tell the datetime with the proper parameters. The data can contain many variable keys and parameters.
I need some ideas for grouping and manipulating this data so I can write a class, struct, array... whatever to organize it. Here's a snippet of the xml doc.
<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p3h-n19-12
<start-valid-time>2007-10-22T14:00:00-04:00
<start-valid-time>2007-10-22T17:00:00-04:00
<start-valid-time>2007-10-22T20:00:00-04:00
<start-valid-time>2007-10-22T23:00:00-04:00
<start-valid-time>2007-10-23T02:00:00-04:00
<start-valid-time>2007-10-23T05:00:00-04:00
<start-valid-time>2007-10-23T08:00:00-04:00
<start-valid-time>2007-10-23T11:00:00-04:00
<start-valid-time>2007-10-23T14:00:00-04:00
<start-valid-time>2007-10-23T17:00:00-04:00
<start-valid-time>2007-10-23T20:00:00-04:00
<start-valid-time>2007-10-23T23:00:00-04:00
<start-valid-time>2007-10-24T02:00:00-04:00
<start-valid-time>2007-10-24T05:00:00-04:00
<start-valid-time>2007-10-24T08:00:00-04:00
<start-valid-time>2007-10-24T11:00:00-04:00
<start-valid-time>2007-10-24T14:00:00-04:00
<start-valid-time>2007-10-24T17:00:00-04:00
<start-valid-time>2007-10-24T20:00:00-04:00
<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p12h-n9-13
<start-valid-time>2007-10-22T20:00:00-04:00
<start-valid-time>2007-10-23T08:00:00-04:00
<start-valid-time>2007-10-23T20:00:00-04:00
<start-valid-time>2007-10-24T08:00:00-04:00
<start-valid-time>2007-10-24T20:00:00-04:00
<start-valid-time>2007-10-25T08:00:00-04:00
<start-valid-time>2007-10-25T20:00:00-04:00
<start-valid-time>2007-10-26T08:00:00-04:00
<start-valid-time>2007-10-26T20:00:00-04:00
<parameters applicable-location="point1">
<temperature type="maximum" units="Fahrenheit" time-layout="k-p24h-n7-1">
<name>Daily Maximum Temperature
<value>81
<value>83
<value>70
<value>77
<value>77
<value>78
<value>76
<temperature type="minimum" units="Fahrenheit" time-layout="k-p24h-n6-2">
<name>Daily Minimum Temperature
<value>68
<value>60
<value>58
<value>59
<value>57
<value>56
layout-key and time-layout must be matched. I hope someone has dealt with something similar and can help.
Thanks
Ken
|
|
|
|
|
Ummm... what? Are there XML tags that aren't showing up? Should you have clicked "Ignore HTML tags in this message (good for code snippets)" ?
|
|
|
|
|
Yeah I checked the little box and still it wont show the tags...
I try it here again maybe this will work
<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p3h-n19-12</layout-key>
<start-valid-time>2007-10-22T14:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-22T17:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-22T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-22T23:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T02:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T05:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T11:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T14:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T17:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T23:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T02:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T05:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T11:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T14:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T17:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T20:00:00-04:00</start-valid-time>
</time-layout>
<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p12h-n9-13</layout-key>
<start-valid-time>2007-10-22T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-25T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-25T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-26T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-26T20:00:00-04:00</start-valid-time>
</time-layout>
<parameters applicable-location="point1">
<temperature type="maximum" units="Fahrenheit" time-layout="k-p24h-n7-1">
<name>Daily Maximum Temperature</name>
<value>81</value>
<value>83</value>
<value>70</value>
<value>77</value>
<value>77</value>
<value>78</value>
<value>76</value>
</temperature>
<temperature type="minimum" units="Fahrenheit" time-layout="k-p24h-n6-2">
<name>Daily Minimum Temperature</name>
<value>68</value>
<value>60</value>
<value>58</value>
<value>59</value>
<value>57</value>
<value>56</value>
</temperature>
I love programming!
|
|
|
|
|
Well that looks better. But I don't see how the elements relate. Looks like there's plenty of documentation on their site though.
|
|
|
|
|
The elements relate through the layout keys. You match each data element within a node to the corresponding key-layout. I already figured out how to match these suckers. I am having trouble coming up with a plan to load the data so that I can sort each data item with the time frame it matches. I came up with some ideas last night but when I change something in the request like the number of days or something it throws everything off.
I thought about a class where the code holds for one day...but some of the time spans are like 8:00am to 2:00pm and others are from 6:00am to 8:00pm and such. Those suckers dont match.
I'll eventually figure out a scheme to load this data and sort it usefully. Ive just been stuck on this for a day or so and that doesnt usually happen any more. Maybe I'm getting too old for this stuff. lol
Thanks for your help.
I love programming!
|
|
|
|
|
Hello people!
Im making a little game with SDL.NET. And because I want to spread my game, I ship all the dll's, now my folder is filled with dll's, and it is not looking neat. Is there a way to combine them ( resource for example ) and use them ? Or put them in a folder called "depencies" for example ?
All .NET dll's can I combine with Netz, so that is not a problem, the unmanged dlls are .
Good night!
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Text;
namespace ColinAngusMackay.NumbersInWords
public class English
{
public static string NumberToEnglish(int number)
{
// Special case for zero
if (number == 0)
return "zero";
// Special case for int.MinValue.
if (number == int.MinValue)
return "negative two billion one hundred and forty seven million " +
"four hundred and eighty three thousand six hundred and forty eight";
// set up possible prefix for negative numbers
string prefix = "";
if (number < 0)
prefix = "negative ";
int absNumber = Math.Abs(number);
return string.Concat(prefix,
TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven(absNumber));
}
private static string TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven(int number)
{
if (number < 1000000000)
return TranslateOneToNineHundredAndNintyNineMillionNineHundredAndNintyNineThousandNineHundredAndNintyNine(number);
int billions = number / 1000000000;
string result = string.Concat(TranslateOneToNineteen(billions), " billion");
int remainder = number % 1000000000;
if (remainder == 0)
return result;
if (remainder < 100)
return string.Concat(result, " and ", TranslateOneToNinetyNine(remainder));
return string.Concat(result, " ",
TranslateOneToNineHundredAndNintyNineMillionNineHundredAndNintyNineThousandNineHundredAndNintyNine(remainder));
}
private static string TranslateOneToNineHundredAndNintyNineMillionNineHundredAndNintyNineThousandNineHundredAndNintyNine(int number)
{
if (number < 1000000)
return TranslateOneToNineHundredAndNinetyNineThousandNineHundredAndNinetyNine(number);
int millions = number / 1000000;
string result = string.Concat(TranslateOneToNineHundredAndNinetyNine(millions),
" million");
int remainder = number % 1000000;
if (remainder == 0)
return result;
if (remainder < 100)
return string.Concat(result, " and ",
TranslateOneToNinetyNine(remainder));
return string.Concat(result, " ",
TranslateOneToNineHundredAndNinetyNineThousandNineHundredAndNinetyNine(remainder));
}
private static string TranslateOneToNineHundredAndNinetyNineThousandNineHundredAndNinetyNine(int number)
{
if (number < 1000)
return TranslateOneToNineHundredAndNinetyNine(number);
int thousands = number / 1000;
string result = string.Concat(TranslateOneToNineHundredAndNinetyNine(thousands),
" thousand");
int remainder = number % 1000;
if (remainder == 0)
return result;
if (remainder < 100)
return string.Concat(result, " and ",
TranslateOneToNinetyNine(remainder));
return string.Concat(result, " ",
TranslateOneToNineHundredAndNinetyNine(remainder));
}
private static string TranslateOneToNineHundredAndNinetyNine(int number)
{
if (number < 100)
return TranslateOneToNinetyNine(number);
int hundreds = number / 100;
string result = string.Concat(TranslateOneToNineteen(hundreds),
" hundred");
int remainder = number % 100;
if (remainder == 0)
return result;
return string.Concat(result, " and ", TranslateOneToNinetyNine(remainder));
}
private static string TranslateOneToNinetyNine(int number)
{
if (number < 20)
return TranslateOneToNineteen(number);
int units = number % 10;
int tens = number / 10;
string result = "";
switch (tens)
{
case 2:
result = "twenty";
break;
case 3:
result = "thirty";
break;
case 4:
result = "forty";
break;
case 5:
result = "fifty";
break;
case 6:
result = "sixty";
break;
case 7:
result = "seventy";
break;
case 8:
result = "eighty";
break;
default:
result = "ninety";
break;
}
if (units != 0)
result = string.Concat(result, " ", TranslateOneToNineteen(units));
return result;
}
private static string TranslateOneToNineteen(int number)
{
switch (number)
{
case 1:
return "one";
case 2:
return "two";
case 3:
return "three";
case 4:
return "four";
case 5:
return "five";
case 6:
return "six";
case 7:
return "seven";
case 8:
return "eight";
case 9:
return "nine";
case 10:
return "ten";
case 11:
return "eleven";
case 12:
return "twelve";
case 13:
return "thirteen";
case 14:
return "fourteen";
case 15:
return "fifteen";
case 16:
return "sixteen";
case 17:
return "seventeen";
case 18:
return "eighteen";
default:
return "nineteen";
}
}
}
}
***the program want to convert the numbers in to characters
-- modified at 18:18 Tuesday 23rd October, 2007
|
|
|
|
|
The subject line is supposed to be a short description, not a complete sentence.
When posting code, use the pre tag to preserve the formatting.
When posting code, keep it short.
What error are you talking about? Do you get an error message?
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Guffa wrote: Do you get an error message?
one? how about a few dozen, including complaints about missing breaks...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
to start your namespace is there but a class within it comes before the opeing "{" bracket and the ending one is already there.
IE you have
namespace mynamespace
class myclass
{
}
}
when you should have
namespace mynamespace
{
class myclass
{
}
}
second there isn't a static void Main(string[] args) { } function and this appears to be a console application (not using widows form classes) and only one class, then your class requires a Main function for the windows entry point into your code
after adding
static void Main(string[] args)
{
Console.WriteLine(NumberToEnglish(10002));
}
worked for me. if you have issues then you can put a break where you call it then step though it with the debugger it is easy to spot
Run it with [F5] with a break at the start of the call of convert then step-into it with [F11] then step through with [F10] looking at the auto, till you see an error. Break before the error then reset with [Shift]+[F5] then [F5] and [F5] again to goto the new break. Press [F11] to step into the code area where your error was repeat till you see the mistake.
also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven() " is a very good choice for a function name
-- modified at 18:50 Tuesday 23rd October, 2007
|
|
|
|
|
Thanks for the material....
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Truely, a "coding horror" if I ever saw one!
|
|
|
|