Simulating Key Press c#

后端 未结 8 1335
青春惊慌失措
青春惊慌失措 2020-11-22 05:48

I want to simulate F5 key press in my c# program, When IE is open I want to be able refresh my website automatically.

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 05:58

    Instead of forcing an F5 keypress when you're just trying to get the page to postback, you can call a postback based on a JS event (even mousemove or timer_tick if you want it to fire all the time). Use the code at http://weblogs.asp.net/mnolton/archive/2003/06/04/8260.aspx as a reference.

提交回复
热议问题