很久很久。。。以前写的一个测试程序,主要是通过ABAP与HTML交互,编写JavaScript实现二维码及动态屏幕实现。

1.ABAP界面效果 

2.实现代码

*&---------------------------------------------------------------------*
*& Report ZRICO_CHTML
*&
*&---------------------------------------------------------------------*
*& Dynamic screen edit by rico
*&实例程序名:SAPHTML_EVENTS_DEMO
*&---------------------------------------------------------------------* report ycf_htmlviewer. types : begin of y_html,
dataset() type c,
end of y_html. data: e_data type y_html,
ts_data type standard table of y_html,
e_user type usr03,
ok_code type sy-ucomm,
w_uname type char20,
w_url type char255,
p_tabnm like dd03l-tabname,
o_tabnm like dd03l-tabname,
bdstr type string,
p_barcd type c,
r_p1 type c value 'X',
r_p2 type c. data : ref_cont type ref to cl_gui_custom_container,
ref_html type ref to cl_gui_html_viewer. data: html_control type ref to cl_gui_html_viewer,
my_container type ref to cl_gui_custom_container,
prog_repid like sy-repid,
ui_flag type i, "#EC NEEDED
edurl(),
edframe(),
edaction(),
edgetdata(),
edpostdataline(),
myevent_tab type cntl_simple_events,
myevent type cntl_simple_event,
postdata_tab type cnht_post_data_tab,
edquery_table type cnht_query_table,
qtab type line of cnht_query_table. "#EC NEEDED data:begin of ddtb occurs ,
check type c,
tabname like dd03l-tabname,
fieldname like dd03l-fieldname,
rollname like dd03l-rollname,
keyflag like dd03l-keyflag,
position like dd03l-position,
datatype like dd03l-datatype,
leng like dd03l-leng,
ddtext like dd03t-ddtext,
value type string,
end of ddtb.
data:ldtb like line of ddtb. data:cuscontainer_con type ref to cl_gui_custom_container,
alv_grid_con type ref to cl_gui_alv_grid,
ls_vari_con type disvariant,
gt_fieldcat_con like lvc_s_fcat occurs with header line,
gs_layout_con type lvc_s_layo,
lt_excl_func type ui_functions,
g_repid like sy-repid,
ls_stable type lvc_s_stbl. data:cuscontainer_mx type ref to cl_gui_custom_container,
alv_grid_mx type ref to cl_gui_alv_grid,
ls_vari_mx type disvariant,
gt_fieldcat_mx like lvc_s_fcat occurs with header line,
gs_layout_mx type lvc_s_layo. *----------------------------------------------------------------------*
* CLASS cl_myevent_handler DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class cl_myevent_handler definition. public section.
methods: on_sapevent
for event sapevent of cl_gui_html_viewer
importing action frame getdata postdata query_table. endclass. "cl_myevent_handler DEFINITION
data: evt_receiver type ref to cl_myevent_handler. "class define
class lcl_event_receiver definition deferred. *----------------------------------------------------------------------*
* CLASS lcl_event_receiver DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_event_receiver definition.
public section.
methods:
handle_double_click
for event double_click of cl_gui_alv_grid
importing e_row e_column es_row_no.
endclass. "lcl_event_receiver DEFINITION data event_receiver type ref to lcl_event_receiver. *----------------------------------------------------------------------*
* class lcl_event_receiver implementation
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_event_receiver implementation.
method: handle_double_click.
perform vp_double_clk using e_row
e_column
es_row_no.
endmethod. "handle_double_click
endclass. "lcl_event_receiver implementation data:gr_event_handler type ref to lcl_event_receiver. *----------------------------------------------------------------------*
* CLASS cl_myevent_handler IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class cl_myevent_handler implementation. method on_sapevent. clear edaction.
clear edframe.
clear edgetdata.
clear edpostdataline. edaction = action.
edframe = frame.
edgetdata = getdata.
postdata_tab = postdata.
if not postdata_tab is initial.
read table postdata_tab index into edpostdataline.
endif.
edquery_table = query_table. case action.
* WHEN 'SHOW_FRAMESET'.
* PERFORM load_frame_set.
when 'submit_form_as_post_method'.
clear:bdstr.
loop at ddtb into ldtb.
read table edquery_table into qtab with key name = ldtb-fieldname .
if sy-subrc = .
ldtb-value = qtab-value.
concatenate bdstr ldtb-ddtext ldtb-value into bdstr separated by space.
endif.
modify ddtb from ldtb.
clear:ldtb,qtab.
endloop.
when others.
endcase.
endmethod. "on_sapevent endclass. "cl_myevent_handler IMPLEMENTATION data:user_id type usr01-bname. initialization.
g_repid = sy-repid.
ls_stable-row = 'X'.
ls_stable-col = 'X'. start-of-selection. perform f_get_username. call screen .
*&---------------------------------------------------------------------*
*& Module STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
* PBO for 9000
*----------------------------------------------------------------------*
module status_9000 output.
set pf-status 'STATUS'. perform f_genearte_html. perform html_container. perform tab_container. endmodule. " STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
* PAI for screen 9000
*----------------------------------------------------------------------*
module user_command_9000 input. case ok_code.
when ''.
perform initial_data.
when 'BACK'.
leave to screen .
when others.
endcase. endmodule. " USER_COMMAND_9000 INPUT *&---------------------------------------------------------------------*
*& Form initial_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
form initial_data.
if o_tabnm <> p_tabnm.
select * into corresponding fields of table ddtb
from dd03l
where tabname = p_tabnm
and comptype <> 'S'. sort ddtb by position. loop at ddtb.
if ddtb-rollname = ''.
select single ddtext into ddtb-ddtext from dd03t where tabname = ddtb-tabname and ddlanguage = sy-langu and fieldname = ddtb-fieldname.
else.
select single ddtext into ddtb-ddtext from dd04t where rollname = ddtb-rollname and ddlanguage = sy-langu.
endif.
if ddtb-fieldname = 'MANDT'.
delete ddtb.
else.
modify ddtb.
endif.
clear:ddtb.
endloop.
o_tabnm = p_tabnm.
endif.
endform. "initial_data
*&---------------------------------------------------------------------*
*& Form F_GENEARTE_HTML
*&---------------------------------------------------------------------*
* HTML code
*----------------------------------------------------------------------* form f_genearte_html . clear:e_data.
free ts_data. concatenate '<html><head> Dear:' sy-uname into e_data-dataset separated by space.
append e_data to ts_data. if r_p1 = 'X'.
e_data-dataset = '<br><img src="SAPLOGO.GIF" align=middle></br>'.
elseif r_p2 = 'X'.
e_data-dataset = '<br><img src="SAP_AG.GIF" align=middle></br>'.
endif.
append e_data to ts_data. e_data-dataset = '</head><body><meta http-equiv="Content-Type" content="text/html; charset=gb2312" />'.
append e_data to ts_data.
e_data-dataset = '<style type="text/css">'.
append e_data to ts_data.
e_data-dataset = '.div-c{ width:200px; margin:0px;line-hight:10px;}'.
append e_data to ts_data.
e_data-dataset = '.div-a{ float:left; width:50px; border:1px solid #999; height:60px;margin:20px;line-hight:10px;}'.
append e_data to ts_data.
e_data-dataset = '.div-b{ float:right; width:120px; border:1px solid #999; height:60px;margin:20px;line-hight:10px;}'.
append e_data to ts_data.
e_data-dataset = '</style>'.
append e_data to ts_data.
"e_data-dataset = '<br><span style="font-size:500px">字体</span></br>'. append e_data to ts_data. e_data-dataset = '<br><h3>Dynamic QR-CODE:'.
append e_data to ts_data. *********************************************************************************************
******* 以下为二维码生成
*********************************************************************************************
if p_barcd = 'X'.
e_data-dataset = '<script type="text/javascript" src="http://static.hdslb.com/js/jquery.min.js""></script>'.
append e_data to ts_data.
e_data-dataset = '<script type="text/javascript" src="http://static.hdslb.com/js/jquery.qrcode.min.js"></script>'.
append e_data to ts_data.
e_data-dataset = '<div id="code"></div>'.
append e_data to ts_data.
"unicode中文 由UTF-16转换为UTF-8
e_data-dataset = '<script type="text/javascript">'.
append e_data to ts_data.
e_data-dataset = 'function utf16to8(str) {'.
append e_data to ts_data.
e_data-dataset = 'var out, i, len, c;'.
append e_data to ts_data.
e_data-dataset = 'out = "";'.
append e_data to ts_data.
e_data-dataset = 'len = str.length;'.
append e_data to ts_data.
e_data-dataset = 'for(i = 0; i < len; i++) {'.
append e_data to ts_data.
e_data-dataset = 'c = str.charCodeAt(i);'.
append e_data to ts_data.
e_data-dataset = 'if ((c >= 0x0001) && (c <= 0x007F)) {'.
append e_data to ts_data.
e_data-dataset = 'out += str.charAt(i);'.
append e_data to ts_data.
e_data-dataset = '} else if (c > 0x07FF) {'.
append e_data to ts_data.
e_data-dataset = 'out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));'.
append e_data to ts_data.
e_data-dataset = 'out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));'.
append e_data to ts_data.
e_data-dataset = 'out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));'.
append e_data to ts_data.
e_data-dataset = '} else {'.
append e_data to ts_data.
e_data-dataset = 'out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));'.
append e_data to ts_data.
e_data-dataset = 'out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));'.
append e_data to ts_data.
e_data-dataset = '}'.
append e_data to ts_data.
e_data-dataset = '}'.
append e_data to ts_data.
e_data-dataset = 'return out;'.
append e_data to ts_data.
e_data-dataset = '}'.
append e_data to ts_data.
e_data-dataset = '</script>'.
append e_data to ts_data. "e_data-dataset = '<script>$("#code").qrcode("http://www.helloweba.com");</script>'. append e_data to ts_data. "//任意字符串
e_data-dataset = '<script>$("#code").qrcode({ '.
append e_data to ts_data.
e_data-dataset = ' render: "table", '.
append e_data to ts_data.
e_data-dataset = ' width: 100, '.
append e_data to ts_data.
e_data-dataset = ' height:100, '.
append e_data to ts_data.
concatenate ' text: utf16to8("' bdstr '") ' into e_data-dataset.
append e_data to ts_data.
e_data-dataset = '}); </script>'.
append e_data to ts_data.
endif.
e_data-dataset = '</h3><br>'.
append e_data to ts_data. *********************************************************************************************
******* 以下为动态字段
*********************************************************************************************
concatenate 'Below is the dynamic fields from the data structure:' p_tabnm into e_data-dataset separated by space.
append e_data to ts_data. e_data-dataset = '<form method=post action="sapevent:submit_form_as_post_method">'.
append e_data to ts_data.
loop at ddtb where check = 'X'.
concatenate '<div class="div-c"><p><font size="2" color="blue">' ddtb-ddtext '</p></div>' into e_data-dataset.
append e_data to ts_data.
concatenate '<div class="div-c"><p><font size="2" color="blue"><input type="text" name="' ddtb-fieldname '" value="' ddtb-value '" maxlength="' ddtb-leng '"></p></div>' into e_data-dataset.
append e_data to ts_data.
endloop.
* e_data-dataset = '<label for="meeting">日期:</label><input type="date" name="user_date" />'.
* append e_data to ts_data.
e_data-dataset = '<br><input type=submit value="submit input using post method"></br></form>'.
append e_data to ts_data. *********************************************************************************************
******* 以下为打印部分
*********************************************************************************************
* e_data-dataset = '<script type="text/javascript" src="jquery-1.4.2.min.js"></script>'.
* append e_data to ts_data.
* e_data-dataset = '<script type="text/javascript" src="jquery.PrintArea.js"></script>'.
* append e_data to ts_data.
* e_data-dataset = '<script>'.
* append e_data to ts_data.
* e_data-dataset = '$(document).ready(function(){'.
* append e_data to ts_data.
* e_data-dataset = '$("input#biuuu_button").click(function(){'.
* append e_data to ts_data.
* e_data-dataset = '$("div#myPrintArea").printArea();'.
* append e_data to ts_data.
* e_data-dataset = '});'.
* append e_data to ts_data.
* e_data-dataset = '});'.
* append e_data to ts_data.
* e_data-dataset = '</script> '.
* append e_data to ts_data.
* e_data-dataset = '<input id="biuuu_button" type="button" value="打印"></input> '.
* append e_data to ts_data.
* e_data-dataset = '<div id="myPrintArea">.....文本打印部分.....</div>'.
* append e_data to ts_data. e_data-dataset = '<input id="btnPrint" type="button" value="打印" onclick="javascript:window.print();"/>'.
append e_data to ts_data.
e_data-dataset = '<input id="btnPrint" type="button" value="打印预览" onclick=preview(1) />'.
append e_data to ts_data.
e_data-dataset = '<style type="text/css" media=print>'.
append e_data to ts_data.
e_data-dataset = '.noprint{display : none }'.
append e_data to ts_data.
e_data-dataset = '</style>'.
append e_data to ts_data.
e_data-dataset = '<p class="noprint">不需要打印的地方</p> '.
append e_data to ts_data.
e_data-dataset = '<script>'.
append e_data to ts_data.
e_data-dataset = 'function preview(oper)'.
append e_data to ts_data.
e_data-dataset = '{'.
append e_data to ts_data.
e_data-dataset = 'if (oper < 10) '.
append e_data to ts_data.
e_data-dataset = '{'.
append e_data to ts_data.
e_data-dataset = 'bdhtml=window.document.body.innerHTML;'.
append e_data to ts_data. "//获取当前页的html代码
e_data-dataset = 'sprnstr="<!--startprint"+oper+"-->";'.
append e_data to ts_data. "//设置打印开始区域
e_data-dataset = 'eprnstr="<!--endprint"+oper+"-->";'.
append e_data to ts_data. "//设置打印结束区域
e_data-dataset = 'prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+18);'.
append e_data to ts_data. "//从开始代码向后取html
e_data-dataset = 'prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); '.
append e_data to ts_data. "//从结束代码向前取html
e_data-dataset = 'window.document.body.innerHTML=prnhtml;'.
append e_data to ts_data.
e_data-dataset = 'window.print(); '.
append e_data to ts_data.
e_data-dataset = 'window.document.body.innerHTML=bdhtml; '.
append e_data to ts_data.
e_data-dataset = '} else {'.
append e_data to ts_data.
e_data-dataset = 'window.print(); '.
append e_data to ts_data.
e_data-dataset = '}'.
append e_data to ts_data.
e_data-dataset = '}'.
append e_data to ts_data.
e_data-dataset = '</script>'.
append e_data to ts_data.
e_data-dataset = '<p>XXXXX</p>'.
append e_data to ts_data.
e_data-dataset = '<!--startprint1-->要打印的内容<!--endprint1--> '.
append e_data to ts_data. e_data-dataset = '</body></html>'.
append e_data to ts_data. endform. " F_GENEARTE_HTML
*&---------------------------------------------------------------------*
*& Form F_GET_USERNAME
*&---------------------------------------------------------------------*
* To get User name from Tcode
*----------------------------------------------------------------------*
form f_get_username . call function 'SUSR_USER_ADDRESS_READ'
exporting
user_name = user_id
importing
user_usr03 = e_user
exceptions
user_address_not_found =
others = . if sy-subrc = . concatenate e_user-name1
e_user-name2
into w_uname
separated by space. endif. endform. " F_GET_USERNAME
*&---------------------------------------------------------------------*
*& Module EXIT INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module exit input.
leave to screen .
endmodule. " EXIT INPUT *&---------------------------------------------------------------------*
*& Form tab_container
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
form tab_container.
clear:gt_fieldcat_con,gs_layout_con.
refresh:gt_fieldcat_con. if cuscontainer_con is initial.
create object cuscontainer_con
exporting
container_name = 'TBCON'
exceptions
cntl_error =
cntl_system_error =
create_error =
lifetime_error =
lifetime_dynpro_dynpro_link =
others = . create object alv_grid_con "定义alv及所在容器
exporting
i_parent = cuscontainer_con
exceptions
error_cntl_create =
error_cntl_init =
error_cntl_link =
error_dp_create =
others = . create object gr_event_handler.
set handler gr_event_handler->handle_double_click for alv_grid_con.
endif. if gt_fieldcat_con[] is initial.
perform get_fieldcat using:
"'TABNAME' 'T' '' '表名',
'FIELDNAME' 'T' '' '字段名',
'VALUE' 'T' '' '值',
'DDTEXT' 'T' '' '描述',
'KEYFLAG' 'T' '' 'KEY'.
* 'POSITION' 'T' '' '序号',
* 'DATATYPE' 'T' '' '数据类型',
* 'LENG' 'T' '' '长度'. gs_layout_con-zebra = 'X'.
gs_layout_con-cwidth_opt = 'X'.
gs_layout_con-stylefname = 'FIELD_STYLE'.
gs_layout_con-no_toolbar = 'X'.
gs_layout_con-box_fname = 'CHECK'.
endif. call method alv_grid_con->set_table_for_first_display " 显示alv
exporting
is_layout = gs_layout_con
is_variant = ls_vari_con
i_save = 'A'
it_toolbar_excluding = lt_excl_func
changing
it_fieldcatalog = gt_fieldcat_con[]
it_outtab = ddtb[]
exceptions
invalid_parameter_combination =
program_error =
too_many_lines =
others = . endform. "tab_container *&---------------------------------------------------------------------*
*& Form get_fieldcat
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->ZD text
* -->ZDBZ text
* -->ZDET text
* -->ZDMS text
*----------------------------------------------------------------------*
form get_fieldcat using zd zdbz zdet zdms.
if zdbz = 'T'.
gt_fieldcat_con-fieldname = zd.
gt_fieldcat_con-reptext = zdms.
gt_fieldcat_con-checkbox = zdet.
append gt_fieldcat_con.
clear:gt_fieldcat_con.
elseif zdbz = 'M'.
gt_fieldcat_mx-fieldname = zd.
gt_fieldcat_mx-reptext = zdms.
gt_fieldcat_mx-checkbox = zdet.
gt_fieldcat_mx-edit = zdet.
if zd = 'ZFDTX' or zd = 'ZFLNM'.
gt_fieldcat_mx-edit = 'X'.
elseif zd = 'ZDFLG'.
gt_fieldcat_mx-checkbox = 'X'.
endif.
append gt_fieldcat_mx.
clear:gt_fieldcat_mx.
endif.
endform. "get_fieldcat_con *&---------------------------------------------------------------------*
*& Form vp_double_clk
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->E_ROW text
* -->E_COLUMN text
* -->ES_ROW_NO text
*----------------------------------------------------------------------*
form vp_double_clk using e_row type lvc_s_row
e_column type lvc_s_col
es_row_no type lvc_s_roid.
read table ddtb index es_row_no-row_id.
if ddtb-check = 'X'.
ddtb-check = ''.
else.
ddtb-check = 'X'.
endif.
modify ddtb index es_row_no-row_id transporting check. perform f_genearte_html. perform html_container. endform. "vp_double_clk *&---------------------------------------------------------------------*
*& Form html_container
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
form html_container. if not ref_html is initial.
"call method ref_html->free.
clear:w_url.
"free ref_html.
"free ref_cont.
endif. if ref_cont is initial.
create object ref_cont
exporting
container_name = 'HTMLCONT'
exceptions
cntl_error =
cntl_system_error =
create_error =
lifetime_error =
lifetime_dynpro_dynpro_link =
others = .
if sy-subrc <> .
endif.
endif. if ref_html is initial. ui_flag = cl_gui_html_viewer=>uiflag_no3dborder.
" + cl_gui_html_viewer=>uiflag_noiemenu. create object ref_html
exporting
parent = ref_cont
saphtmlp = 'X'
uiflag = ui_flag
lifetime = cl_gui_html_viewer=>lifetime_dynpro
exceptions
cntl_error =
cntl_install_error =
dp_install_error =
dp_error =
others = .
if sy-subrc <> .
endif. myevent-eventid = ref_html->m_id_sapevent.
myevent-appl_event = 'X'.
append myevent to myevent_tab.
call method ref_html->set_registered_events
exporting
events = myevent_tab. create object evt_receiver. set handler evt_receiver->on_sapevent for ref_html. endif. call method ref_html->load_mime_object
exporting
object_id = 'HTMLCNTL_TESTHTM2_SAPLOGO'
object_url = 'SAPLOGO.GIF'
exceptions
others = . call method ref_html->load_mime_object
exporting
object_id = 'HTMLCNTL_TESTHTM2_SAP_AG'
object_url = 'SAP_AG.GIF'
exceptions
others = . call method ref_html->load_data
exporting
type = 'text'
subtype = 'html'
importing
assigned_url = w_url
changing
data_table = ts_data
exceptions
dp_invalid_parameter =
dp_error_general =
cntl_error =
others = .
if sy-subrc <> .
endif. call method ref_html->show_url
exporting
url = w_url
exceptions
cntl_error =
cnht_error_not_allowed =
cnht_error_parameter =
dp_error_general =
others = .
if sy-subrc <> .
endif. * call method ref_html->do_refresh
* exceptions cntl_error = 1.
*
* call method cl_gui_cfw=>dispatch.
endform. "html_container

ABAP-BarCode-1-HTML二维码打印及动态屏幕实现的更多相关文章

  1. 使用Spire.Barcode程序库生成二维码

    使用Spire.Barcode程序库生成二维码 某天浏览网页发现了一个二维码的程序库.它的描述说他可以扫描二维码图像.我很感兴趣,想试试他是不是会有用.所以我就用了些方法扫描二维码图像来测试一下.结果 ...

  2. FastReport二维码打印存在的问题

    FastReport二维码打印存在的问题 (2018-05-21 09:28:38) 转载▼ 标签: delphi 分类: Delphi10.2 FastReport本身支持二维码,实际应用中遇到这样 ...

  3. java生成二维码打印到浏览器

    java生成二维码打印到浏览器   解决方法: pom.xml的依赖两个jar包: <!-- https://mvnrepository.com/artifact/com.google.zxin ...

  4. smartforms 二维码打印

    1. 安装TBarCode_SAPwin软件 1) 下载Barcode软件  下载TBarCode_SAPwin 软件.(如需生成SAP"字符控制序列"则需一并下载TBarCode ...

  5. 使用jQuery的插件qrcode生成二维码(静态+动态生成)及常见问题解决方法

    一.简介 1.说明 qrcode其实是通过使用jQuery实现图形渲染,画图,支持canvas(HTML5)和table两种方式,您可以到https://github.com/jeromeetienn ...

  6. 为微信二维码添加gif动态背景

    环境准备 来源: https://github.com/sylnsfar/qrcode/blob/master/README-cn.md#%E5%8A%A8%E6%80%81gif%E4%BA%8C% ...

  7. Java二维码打印

    http://blog.csdn.net/OnePersonTZ/article/details/66560513

  8. 基于Metronic的Bootstrap开发框架经验总结(14)--条码和二维码的生成及打印处理

    在很多项目里面,对条形码和二维码的生成和打印也是一种很常见的操作,在Web项目里面,我们可以利用JS生成条形码和二维码的组件有很多.本文引入两个比较广泛使用的JS组件,用来处理条形码和二维码的生成处理 ...

  9. 安卓四核PDA手持PDA智能POS机 打印二维码 分享

    很多项目都会用到 类似的要求  移动手持终端 通过程序 可以生成条码或二维码 打印出小票或标签纸 下面直接上代码 希望对大家有点用处 private void print(){ csys.setTex ...

随机推荐

  1. 【MVC】VS常用技巧

    1,在VS2010中,选中指定的代码段,可以拖拽到工具箱中,形成标签,以后还想书写类似的代码,双击鼠标即可. 2,在VS2012中,可以在注释上标注//TODO:我是注释 这样,注释就会出现在任务列表 ...

  2. nyoj 素数距离

    素数距离问题 时间限制:3000 ms  |  内存限制:65535 KB 难度:2   描述 现在给出你一些数,要求你写出一个程序,输出这些整数相邻最近的素数,并输出其相距长度.如果左右有等距离长度 ...

  3. java成员内部类

    java成员内部类依赖于外部类而存在,故创建内部类需要首先创建其关联的外部类. public class Test { public static void main(String args[]) { ...

  4. Django 配置总结

    配置 app urls 项目下的urls.py from django.conf.urls import url,include urlpatterns = [ url(r'^BookApp/', i ...

  5. sql having 函数 按匿名字段作为条件进行查询

    今天写sql 遇到一个问题 SELECT a.*, count(b.id) AS nums FROM a LEFT JOIN b ON a.id=b.a_id WHERE nums>1 这时候会 ...

  6. bzoj2763 飞行路线

    Description Alice和Bob现在要乘飞机旅行,他们选择了一家相对便宜的航空公司.该航空公司一共在n个城市设有业务,设这些城市分别标记为0到n-1,一共有m种航线,每种航线连接两个城市,并 ...

  7. vs2017 编译JRTPLIB

    一. JRTPLIB简介 RTP 是目前解决流媒体实时传输问题的最好办法,而JRTPLIB是一个用C++语言实现的RTP库,它完全遵循RFC 1889设计,目前已经可以运行在Windows.Linux ...

  8. [C#]反射遍历对象属性

    /// <summary> /// C#反射遍历对象属性 /// </summary> /// <typeparam name="T">对象类型 ...

  9. RouterOS 设定NAT loopback (Hairpin NAT)回流

    In the below network topology a web server behind a router is on private IP address space, and the r ...

  10. Oracle jdk 历史版本官方下载地址及下载方法

    Oracle jdk 历史版本官方下载地址及下载方法 原文转载至:http://blog.csdn.net/chwshuang/article/details/54925950 平时要新装一个系统环境 ...