|
Hello all,
I'm trying to make a "public" webbrowser (for an internet kiosk).
My Webbrowser works quite good, but I have a problem : I didn't find the way to block windows "calls" to other applications...
For example : if a user click on a "mailto:" hyperlink, my webbrowser will call outlook express application !
I don't want user to be able to use another application ! Is that possible ?
I was thinking on catching a special windows message (WM_ActivateApp ??)... but don't think it's the better way.
If someone as any idea, don't hesitate to answer this message.
Thank you for your help
Ric
|
|
|
|
|
Look at navigating event of the web browser control.
this.WebBrowser1.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler( this.WebBrowser1_Navigating );
The event get sent two parameters; normally named sender and e
(object sender, WebBrowserNavigatingEventArgs e)
e has some properties and methods. Two of the properties are "Url" and "Cancel".
If you set Cancel to true then it prevents navagation. So you can do something like the following:
if(e.Url.ToString().ToLower().StartsWith("mailto:"))
{
e.Cancel = true;
}
|
|
|
|
|
Thanks ! I'm going to try it now
|
|
|
|
|
Welcome to The Quiz Program!
You can be quizzed on any of the following operators:
1) % (modulus, or 'remainder')
2) * (multiplication)
3) / (integer division)
4) / % (integer division & modulus in a combined challenge!
Type the number of the operator that you wish to be quizzed on: 1
I will ask you to tell me the result of
A % B
What is the smallest value of A: 0
What is the largest value of A: 100
What is the smallest value of B: 40
What is the largest value of B: 50
How many times do you wish to be quizzed:
3
Ok, we're ready to go!
What is the result of 92 % 44? 4
4 is correct!
What is the result of 92 % 48? 4
Good try, but no: 92 % 48 = 44
What is the result of 18 % 47? 47
Good try, but no: 18 % 47 = 18
Thank you for using this program - have a nice day!
Press the 'Return' key to exit
Here's my code I'm stuck have no idea what to do next.
class Program
{
class DoLoop
{
public static void Main()
{
string myChoice;
do
{
// Print A Menu
Console.WriteLine("Welcome to The Quiz Program!\n You can be quizzed on any of the following operators:");
Console.WriteLine("1) % (modulus, or 'remainder')");
Console.WriteLine("2 (multiplication)");
Console.WriteLine("3 - (integer division)");
Console.WriteLine("4 - integer division & modulus in a combined challenge!)");
Console.WriteLine("Choice (1,2,3,or 4): ");
// Retrieve the user's choice
myChoice = Console.ReadLine();
// Make a decision based on the user's choice
switch(myChoice)
{
case "1":
Console.WriteLine("I will ask you to to tell me the result of\n A % B");
break;
|
|
|
|
|
1. Enter a loop for the appropriate number of iterations
2. Post the question
3. Get the user's input
4. Compare user input to the correct result
5. Display either correct or incorrect
6. Restart the loop Glad I could help,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
OK, you're off to a start. Look up the Random class for info on generating random numbers, then read up on for/next loops for your main loop. Ask your teacher or check your course books for more info.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Why do you have 500 "Console.WriteLine" ?? Well not quite 500 but jeze, you still have quite a few!
Use a single string,
You seem to be in a class/new to programming so I'll help you with these:
1) No need to call write line 100 time unless you need to
2) The char '\n' is bad to use in .NET unlike some other other language's the new line char '\n' doesn't get converted by the compiler to the system's correct new line format. So there is a class called "Environment" which contains a "NewLine" property (the correct way to do a '\n' in .NET) which will decode to the correct new line string.
Console.WriteLine("Welcome to The Quiz Program!{0}"
+ " You can be quizzed on any of the following operators:{0}"
+ "\t1) %\t(modulus, or 'remainder'){0}"
+ "\t2) *\t(multiplication){0}"
+ "\t3) /\t(integer division){0}"
+ "\t4) /%\t(integer division & modulus in a combined challenge!)"
+ "{0}{0}Choice (1,2,3,or 4):", Environment.NewLine);
|
|
|
|
|
Hello...
I'm using toolStripTextBox and I want to detect "Leave" from this toolStripTextBox.
Somehow, it's nor working.
I attach an event "Leave" and try to write in that toolStripTextBox and just
click another control. The event is not working...
Anybody has the same problem ?
|
|
|
|
|
Try toolStripTextBox.TextBox.Leave event.
|
|
|
|
|
It's not working...
Any other ideas ?
|
|
|
|
|
I just setup an event for myToolStripTextBox.Leave and it fires correctly. If it's not working for you, please post some code.
|
|
|
|
|
try to put the textbox under dropdown menu in toolstrip. it doesn't work anymore...
anyway, thanks for the reply. I just use another event to update my data object.
|
|
|
|
|
Hi friends..
How to dock a form like visual studio solution explorer....
|
|
|
|
|
Did you try Form.Dock = ... ?
rotter
|
|
|
|
|
Hi friend..
I am working windows based MDI application... i tried Form.dock style but it is not effective.When mouse drag enter into the form means dock style is not working... can u have any idea..U have any sample code pls send me...
|
|
|
|
|
I think you didn't mean "Dock" but "Pin/Unpin"
I have no idea on how to do this.
rotter
|
|
|
|
|
It's not possible with out-of-the-box controls. Either you need to write the logic to handle this yourself, or use an existing control like Divelement's SandDock[^].
|
|
|
|
|
Hello all:
Can anybody explain me please how can I make .dll file???
Thanks in advance.
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|
|
|
Hello :
Thanks a lot....
The way of Professional softwares start in two:
Simple codes and develop it.
Simple but effective ideas.
|
|
|
|
|
I have .Net 2.0 MSI. I installed this on Vista. To access few functionalities of the application installed, i check if the logged in account is an administrator as below:
WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal;
_IsAuthorized = principal.IsInRole(WindowsBuiltInRole.Administrator) || principal.IsInRole(WindowsBuiltInRole.PowerUser);
This function detects the logged in account as administrator only for the user account with which i logged in to install the MSI.
For other computer administrator accounts it does not recognize.
How do i resolve this issue on Vista? Is there any other way to know if the logged in account is an administrator?
|
|
|
|
|
Hi everyone.
I recently started an online software business. I'd like for my customers to be able to purchase my software (via PayPal) and after the purchase, be directed to a link where they can download the software.
I'd prefer one that had a blind link (one where you could not get to from anywhere else). I'm sure there are sites that offer such services, but I'm having a tough time finding any.
I already have the payment transaction setup through PayPal, but I don't know how to handle the downloading of the software.
Any suggestions?
Thanks.
|
|
|
|
|
One way to do this would be to generate a unique, time-limited url for download by a specific customer. The link would expire after the software has been downloaded and/or "n" units of time after that event or after the customer has made the purchase.
/ravi
|
|
|
|
|
I'm decent at programming applications, but pretty ignorant when it comes to web programming. How do you do what you said?
|
|
|
|
|
Create a database table, such as:
CustomerDownloads
id unidentifier
ordertime datetime default(GetDate())
downloaded bit default(0)
When creating the link for them to download your software, generate a new guid to include in the link. Enter this guid as the id in the table. When the user wants to download the software, use the guid to lookup the order, check the time or downloaded flag as necessary.
Simplistic, but thats the gist of it.
only two letters away from being an asset
|
|
|
|