|
Sonu - when you are working off an article, your best bet is to post the question on that forum as the chances of the author happening to wander by and notice your question are slim. That's the place you are most likely to get an answer.
There's no need to double post. Please remove your other post on this issue.
|
|
|
|
|
I am now trying to get the frames from the document.
IHTMLDocument2 document=null;
int lngMsg = RegisterWindowMessage("WM_HTML_GETOBJECT");
int SMTO_ABORTIFHUNG = 0x2;
int lRes;
HWND windowhandle=functofindbrowserwindow();
SendMessageTimeout(windowhandle, lngMsg, 0, 0, SMTO_ABORTIFHUNG, 1000, out lRes);
if (!(bool)(lRes == 0))
{
int hr = ObjectFromLresult(lRes, ref IID_IHTMLDocument, 0, ref document);
if ((bool)(document == null))
{
}
else
{
FramesCollection fc=document.frames;
}
}
How do i get the frames from the document?
|
|
|
|
|
Reposting in this board as it is more .NET than C# specific
I have a problem, that is to mask data in certain format that is displayed in the browser
To solve the problem I came up with the following solution
1)Find all the browser window handles (class Internet Explorer_server)
2)Get the IHTMLDOCUMENT2 using the window handle
3)Use IHTMLDOCUMENT2::body::innerHTML to find the data I am looking for and modify it.
The code I have written below throws a COMException. [Could not set the innerHTML property. Invalid target element for this operation.]
//document is a IHTMLDOCUMENT2 obtained using the window handle and WM_HTML_GETOBJECT message
//pattern is StringBuilder initialized with a SSN pattern that I want to mask.
IHTMLElementCollection dome = document.all;
foreach (IHTMLElement dom in dome)
{
StringBuilder bf = new StringBuilder(dom.innerHTML);
if (bf.ToString().Contains(pattern.ToString()))
{
bf.Replace(pattern.ToString(), "***-**-****");
dom.innerHTML = bf.ToString(); //Exception occurs here
}
}
Why does this exception occur. How do I fix it so that the webpage contents will be altered.
I wrote another version of the code, it works, but not completely.
I found out that is because the webpage contains multiple frames and so it does not work. I does not work if the SSN number is inside a frame(or something like a frame which holds an embeded object).
StringBuilder bf = new StringBuilder(document.body.innerHTML);
if (bf.ToString().Contains(pattern.ToString()))
{
bf.Replace(pattern.ToString(), "***-**-****");
document.body.innerHTML = bf.ToString();
}
The first piece of code throws exceptions, the second one does not work if there are multiple frames.
What am I doing wrong in both the code above.
How do I go about achieving my solution. Is my approach correct, or is there a better way to do it.
Thanks and regards,
David
|
|
|
|
|
This question qualifies to be in the COM category than .NET.
Anyway, try setting the innerHTML of the frame window instead of the page body.
|
|
|
|
|
I have a C#/WPF app where all the logic is coded in the dialog boxes. Pretty much like an Access app in fact.
I'm re-architecturing it into a MVVM app.
Some of my business objects (of type Report) live in a (legacy) database and are created upon user interaction. Some others (of type ReportDefinition and ReportParameter) are from a pre-instantiated set of read-only objects. ReportDefinition objects are identified by a key.
In the Access-style app I could use XAML to create a resource dictionary indexed by the ReportDefinition key. It would be very easy to define the various ReportDefinition objects, along with their arrays of ReportParameters in XML. The objects would be readily accessible from my code.
How can I achieve a similar thing in the business layer of the new app ? I guess that I'm longing for a sort of XAML-sans-View. I can imagine options based on XmlSerializer but maybe I'm overlooking a very simple and elegant solution.
Any suggestions ?
|
|
|
|
|
According to Microsoft, "dotnetfx35.exe" (some 231 MB) is the complete installation package for .NET 3.5 SP1. However, when I start the .exe, the installer connects to the web and says to download some more 63 MB (actually, it downloaded some 30 MB according to the TaskManager). Then the installation really starts.
How can an installation of .NET 3.5 without connection to the web be achieved? Some computers of our customers do not have a connection to the web, and when a big number of computers is to be installed, such repeated downloads are quite bad.
Please note that here I started the install package of .NET directly, not an install package of our solutions. Consequently, the solution provided in http://social.msdn.microsoft.com/Forums/en-US/netfxsetup/thread/5fa32450-d052-4574-9cd6-b43ef9cfe269/[^] is not applicable.
|
|
|
|
|
Hey
I have the following Scenario:
<StackPanel Width="200" Height="100" Background="Yellow" Name="BigPanel">
<Canvas Width="80" Height="80" Background="Blue" Margin="10" Name="RectanglePanel" >
<Rectangle Canvas.Left="10" Canvas.Top="1" Height="50" Width="50" Fill="Black" Name="MyRectangle">
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Rectangle.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="MyRectangle"
Storyboard.TargetProperty="(Canvas.Left)"
From="10" To="-30" Duration="0:0:5"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</Canvas>
</StackPanel>
The Problem is when the rectangle left the Rectanglepanel that contains him (for example in the ContainerPanel) it is still visible, how can i make the rectangle be visible only in its parentpanel=rectanglepanel? is there a property or a way for that?
|
|
|
|
|
Defender-NF wrote: is there a property or a way for that?
Yep. ClipToBounds = "True"[^] on the canvas should do the trick.
|
|
|
|
|
|
|
Ajax is not a .NET technology, it's a JavaScript/web technology. You really need to ask this in one of those forums. Better still, have a search around with Bingle and pick one of the many thousands of excellent tutorials. Read it, try some examples, enjoy the journey of learning and discovery that awaits you.
|
|
|
|
|
|
She certainly does. JavaScript takes one look at this[^] beautiful face and writes itself. Of course, Bingle in this case refers to the gestalt Google Bing roles.
|
|
|
|
|
Search on the internet. You will get tons of samples and quickstarts.
Or start by reading a book on AJAX.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
|
I tried to Install .Net Framework 1.1 in the Windows Server 2003. But i always get this Message "The product you are trying to install has already been installed with your operating system. Use Windows Update to install the latest updates.". I can't see the .Net Framework 1.1 in the Control Panel Panel Add/Remove Programs. I can Install .Net Framework 2.0 or later only issue with 1.1. I need to Install 1.1.
|
|
|
|
|
That's because it's not in Add/Remove programs. It just comes built into the Server 2003 load and is installed by default.
All you have to do is look in C:\Windows\Microsoft.NET\Framework folder. See the folder v1.1.4322? That's .NET 1.1.
|
|
|
|
|
I can see .Net Framework 1.1 in that Folder "C:\Windows\Microsoft.NET\Framework". But i can't see this in the Virtual Directory. when we create a Virtual directory in IIS, there is one tab [ASP.Net ] to select the Frame works. i can't see that tab in the Virtual directory
|
|
|
|
|
You didn't mention ASP.NET or IIS in your original post. The ASP.NET portion of the .NET Framework 1.1 is disabled by default. Read this[^] to turn it on.
|
|
|
|
|
|
No problem. You're welcome!
|
|
|
|
|
Good Answer Below
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|
|
I will be upfront about this. I'm 24 now, and I haven't programmed anything since college about 3 or 4 years ago, and I want to get into programming on my own somehow. Back in college I programmed in Visual Basic, C(not C++), HTML, Unix...and I loved it! Programming always came naturally to me, I aced all my classes, could see potential errors before they happened as I programmed, and people always came to me to help them debug their code.
I felt good about that back then...but I always wanted to help people in the world ever since I was small. That's always been my dream. So since I couldn't "see how I could help people in the world with computers", I got in my mind that I wouldn't be able to help people with computer knowledge... So I ended up changing major from Computer Science to Health Sciences to go towards that dream.
I didn't do well in that field though, and had to leave college (lost my scholarships due to grades). So I started working. I was trying to save up money to go back to college...but the jobs I've been working just provide enough for bills...not to really get me back to school or support myself to the point I want to be at.
So lately I've been thinking back to how much I loved programming...and I want to get back into it somehow. Possibly learning on my own and developing some programs. But I really don't know where to start...and also I find that when I start programming again I feel a bit daunted by what I don't know anymore and I feel pretty lost. I have a ton of ideas flowing in my mind for programs to help people in the world, and my brain can figure out the pseudocode for some of them...but I just feel really daunted and discouraged at my inability right now...
So I'm reaching out for help from those out there who have more experience than I do. What advice would you give an aspiring programmer like myself? Where the heck should I start? What language should I use? What do you think I should do? Where do you think I should go? Any advice or suggestions would be good...I just want to do something more with my life than this...
|
|
|
|
|
Do you like making games? I've had some fun with XNA (a game development framework/environment/workflow/thingymabober). To use XNA, you must also know C#. You can learn both at once by reading Microsoft XNA Game Studio 4: Learn Programming Now! I haven't read it, but it is a beginner book that will teach you C# and how to make games with XNA. It is also relatively short, if you skip the section on Windows Phone 7 game development (XNA works on Windows Phone 7, XBox 360, and PC's). You might also want to read this game development tutorial. Later down the road, you may need a good XNA resources page. There are a million directions you could go, but the key is to just pick one. XNA gives you something fun to work with while you learn valuable skills, C# and the .Net Framework.
|
|
|
|
|
For future reference - posts such as this should be in the Lounge[^]. This forum is for questions related to the .NET framework
As you can tell from browsing around this site and others, there are many languages that would be useful. C++ is still widely used. .NET languages, especially C# are more and more widely sought after. Web Devs (at least where I live and work) are still predominantly PHP, although I'm sure elsewhere that may not be the case and many use ASP.NET.
I would strongly suggest reading some beginner C# tutorials, downloading Visual Studio Express (free) and get going. Once you have the fundementals sorted you will find your own path and what interests you so you will find your own goals/career to persue.
|
|
|
|