|
I think you'll need to create file objects in the directory, writing the bytes to those files. Files can be created using the File.Create static method.
|
|
|
|
|
You can only write on the server, not the client, and ASP.NET is not allowed access to the file system above the root of the web app. So, you have to write to locations underneath the root of your website.
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 )
|
|
|
|
|
In C# how would you do this? Can you?
I am working in C++/CLI with Windows Forms. No one in the C++/CLI forum was aware of a way to tell where the mouse is pointing when the helpprovider event is called.
I want to have my compiled html help point to a topic specific to where the mouse is pointing (like as a menu item) but I can't seem to determine which control the mouse is hovering over.
My C++/CLI code is below.
private: System::Void FrmMain_HelpRequested(System::Object^ sender, System::Windows::Forms::HelpEventArgs^ hlpevent)
{
Point pt = this->PointToClient(hlpevent->MousePos);
Control^ requestingControl = dynamic_cast(sender);
Control ^ctrl = this->pt;GetChildAtPoint(pt);
Control ^ctrl2 = this->pt;ActiveControl;
Point ptMI = this->menuMainForm->PointToClient(hlpevent->MousePos);
Control ^ctrlMI = this->menuMainForm->GetChildAtPoint(ptMI);
Point ptMenuHelp = this->miHelp->DropDown->PointToClient(hlpevent->MousePos);
Control ^ctrlMenuHelp = this->miHelp->DropDown->GetChildAtPoint(ptMenuHelp);
if( File::Exists(this->pt;helpProvider->HelpNamespace ) == true)
{
Help::ShowHelp(this, this->helpProvider->HelpNamespace);
}
}
ctrl is the form itself and crtl2 is the last active mdichild in my application.
requestingControl returns the form (same as ctrl)and not the item the mouse is over.
ctrlMI and ctrlMenuHelp are undefined.
Hope someone can help
Programmer
Glenn Earl Graham
Austin, TX
modified on Monday, January 07, 2008 4:03:51 PM
|
|
|
|
|
Hi Glenn
I tried out a few things and here's what I came up with.
If you've got a MenuStrip (e.g. File, Edit, View, etc.) and you're trying to see if the mouse is over a particular menu item (e.g. the File->Exit), you can do it like this:
Point localPoint = fileMenuItem.DropDown.PointToClient(hlpevent.MousePos);
if(exitMenuItem == fileMenuItem.DropDown.GetItemAt(localPoint)) Does this help?
|
|
|
|
|
Wow. Thanks. I updated my code. I tried it but I got an undefined for the control.
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
I'm not sure I understand. You got null back for the control returned?
|
|
|
|
|
Wouldn't MouseEnter / MouseLeave or whatever work?
|
|
|
|
|
If you wanted an event for every menuitem. I was hoping there was a cleaner way.
PIEBALDconsult wrote: Wouldn't MouseEnter / MouseLeave or whatever work?
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
Hi,
I have not used it myself, but the way I understand MSDN on Control.HelpRequested event
you should add an event to every Control for which you want to provide help; then in
the HelpRequested event handler the sender parameter points to the Control that currently
needs to show help.
|
|
|
|
|
For the menu dropdown items there is no event for the helpprovider. There is for the file menu itself but it does not tell you which menu item you are currently looking at.
Luc Pattyn wrote: I have not used it myself, but the way I understand MSDN on Control.HelpRequested event
you should add an event to every Control for which you want to provide help; then in
the HelpRequested event handler the sender parameter points to the Control that currently
needs to show help.
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
OK, I see the problem now: MenuItem is not a Control. However MainMenu and ContextMenu
are, so you could enumerate their menu items recursively to find the one that is currently
selected (MenuItem.Selected property). Not sure what will happen when you move the
mouse up or down, selecting another menu item.
|
|
|
|
|
Thank You very much. It works like a champ! Here is my final code (c++/CLI).
for each ( ToolStripMenuItem ^tmpMS in this->menuMainForm->Items )
{
for each ( ToolStripItem ^tmpCntl in tmpMS->DropDownItems )
{
if (tmpCntl)
{
if ( tmpCntl->Selected )
String ^tmpCntlName = tmpCntl->Name;
OpenHelpForMenuItem(tmpCntlName);
}
}
}
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
hi.. how do i browse a word document and get the data inside to my richtextBox ?
|
|
|
|
|
You'll either need to use the Word interop COM object (requires Word to be installed on the machine running your software), or use a 3rd party tool that parses Word documents to get the text data out or coverts it to RTF.
|
|
|
|
|
if i want to use the Word interop COM object .. what should i do.. thanks
|
|
|
|
|
|
Hi all,
How could i trim the calender control (Cla.selecteddate) to only dat
when i click the control it comes with time .But i only want the date only.Like '2008-01-10' not like 2008-01001 12:00:00Am'
Thank you!
|
|
|
|
|
Use the ToShortDateString or ToLongDateString methods.
Standards are great! Everybody should have one!
|
|
|
|
|
I don't know what a Cla.selecteddate is, but if you're use a DateTimePicker you can set a CustomFormat.
|
|
|
|
|
Thank you.
Its like ..........
I have a calender control called Cal
datetime date=Cal.selecteDate;
Then date becomes like '2008-01-01 12:00:00Am' how ever i want it like
'2008-10-01' date only.
Thanks
|
|
|
|
|
Ohhhh... I see now. A DateTime will always contain both a date and a time.
Your "calender control" should be able to display only the parts you want to display.
|
|
|
|
|
I want to incorporate the speech training UI (SAPI 5.1) into an application so that users don't have to navigate to it via the control panel.
I've tried finding C# code-snippets/examples of the DisplayUI method of the IspRecognizer interface and have so far been unsuccessful (googled and CP).
Any help or pointers would be gratefully accepted.
Regards
Guy Thiebaut
You always pass failure on the way to success.
|
|
|
|
|
Ok - I've figured out how to do this in VB.
Noooooooooooooooooo I hear you say - well trust me I feel the shame
I feel soooo dirty I'm going to have to have a long shower to clean myself
Note the Microsoft.Speech.Object Library reference needs to be added to the project first.
<br />
Imports SpeechLib<br />
Imports Speech<br />
<br />
Public WithEvents RC As SpSharedRecoContext<br />
Public myGrammar As ISpeechRecoGrammar<br />
<br />
RC = New SpSharedRecoContext<br />
<br />
myGrammar = RC.CreateGrammar<br />
myGrammar.DictationSetState(SpeechRuleState.SGDSActive)<br />
<br />
Dim theRecognizer As ISpeechRecognizer<br />
theRecognizer = RC.Recognizer<br />
<br />
theRecognizer.DisplayUI(Me.Handle.ToInt64, "Speech Training", SpeechStringConstants.SpeechUserTraining, vbNullString)<br />
Apologies for posting this filth VB code on the C# forum
You always pass failure on the way to success.
modified on Monday, January 07, 2008 4:22:30 PM
|
|
|
|
|
Hi,Can anybody help me out how to configure the PPPOE settings in windows vista OS using C# .I have to provide username ,password and connection name values though my code without displaying the internet connetion window interface to the users.
Thanks
|
|
|
|
|
Hi All :
I want to make a progress par when it's moving it's move to right and left , any idea to make it ???
Thanks
|
|
|
|