WebBrowserで別ドメインのフレーム内のデータをコントロールするには

| コメント(18) | トラックバック(0)
引き続きWeb巡回ツールネタ

あるフレームのページを制御しようとしたら「アクセスが拒否されました」とエラーになる。
なんで、、、と思ったら本体とフレームでドメインが違ってた。

簡単にいうとこんな感じ
■アクセス先ページ
http://www.aaaaa.com
■フレームのページ
http://acount.aaaaa.com

ログイン部分のパーツだけフレームになっていて違うサブドメインになっていた。
ド○コムめ。。。

仕方ないので別ドメインのコントロールの仕方、、、をぐぐってみると
WebBrowserにIInternetHostSecurityManager.GetSecurityIdを実装すればいいらしい。
そしてその方法は・・・

かなり小難しいことをしないといけないようで見てて頭が痛くなってきた。
なので1発でやるのはあきらめて以下のような方法で対応

1.フレーム含むページを読み込み フレームのURLを取得する
2.取得したフレームのURLへアクセスする
3.やりたい処理をする


この方法思いついてから5分で実装完了。

こういう風に正面から当たるの難しい場合は迂回路探すのもプログラマーにとって重要な能力ですよね。
迂回路ないときはあきらめて進みますが(笑)

トラックバック(0)

トラックバックURL: http://blog.romaji.net/mt4/mt_cgi/mt-tb.cgi/84

コメント(18)

This web site may be a walk-through for all of the content you wished concerning this and did not know who must. Glimpse here, and you should definitely discover it.

hiya everyone, I had been just checkin out this blog i really enjoy the foundation want to know ,, and get absolutely nothing to do, therefore, if anyone want to a great enjoyable convo about this, please visit my site on yahoo, i'm called jessica meautle

I recently needed to generate a quick comment in order to express gratitude to you for all those wonderful pointers you are posting at this site. My own time consuming internet investigation has right at the end of the day been rewarded with top quality approaches to tell my guests. I'd personally say that many people website visitors really are endowed to happens to a fantastic network with lots of marvellous people who have useful hints. I'm quite privileged to get used your webpages and search toward really more fabulous minutes reading here. Many thanks for many things.

Whats up, I just hopped over for your website online by way of StumbleUpon. No longer something I would normally learn, but I liked your emotions none the less. Thank you for making one thing value reading.

Good points?I'd note that as anyone who in point of fact doesn't write on blogs much (in fact, this can be my first post), I don't think the term 'lurker' could be very turning into to a non-posting reader. It's now not your fault in the least , however possibly the blogosphere may get a hold of a greater, non-creepy name for the 90% of us that enjoy studying the content .

Good points?I might note that as anyone who in reality doesn't write on blogs a lot (in reality, this can be my first post), I don't suppose the time period 'lurker' may be very turning into to a non-posting reader. It's no longer your fault the least bit , however possibly the blogosphere could come up with a greater, non-creepy name for the 90% people that revel in studying the content .

One of the leading advantages of choosing acai berries as being a weight reduction aid is that it can boost your energy levels significantly. These benefits however can just come to you, the use of the purest available kind of acai fruit.

What a lovely day for a 3995117! SCK was here

I’m impressed, I must say. Really rarely do I encounter a blog that’s both educative and entertaining, and let me tell you, you have hit the nail on the head. Your idea is outstanding; the issue is something that not enough people are speaking intelligently about. I am very happy that I stumbled across this in my search for something relating to this.

Today, while I was at work, my cousin stole my iphone and tested to see if it can survive a twenty five foot drop, just so she can be a youtube sensation. My iPad is now destroyed and she has 83 views. I know this is entirely off topic but I had to share it with someone!

That is definitely some inspirational stuff. Couldn't know that opinions could be this varied. Thank you all of the enthusiasm to consider such information here.

Keep up the good piece of work, I read few articles on this site and I believe that your web blog is rattling interesting and contains sets of fantastic info.

I got good info from your blog

If you're still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you'll know which is right for you.

A real wonderful document. You definitely put a new spin on the topic that’s been revealed for several years. Great job!

If you're still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you'll know which is right for you.

Apple now has Rhapsody as an app, which is a great start, but it is currently hampered by the inability to store locally on your iPod, and has a dismal 64kbps bit rate. If this changes, then it will somewhat negate this advantage for the Zune, but the 10 songs per month will still be a big plus in Zune Pass' favor.

you could have an awesome blog right here! would you wish to make some invite posts on my weblog?

コメントする

2011年9月

        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30