%% 文件名为bank_app.erl -module(bank_app). %% 指定behaviour为application -behaviour(application). %% 导出application回调模块的函数 -export([start/2, stop/1]). %% 启动application时调用 start(_Type, _Args) -> ("Start ~p ...", [?MODULE]), {ok, self()}. %% 停止application时调用 stop(_State) -> ?I("Stop ~p!", [?MODULE]), ok.
application:load({application, bank, [{mod, {bank_app, []}}]}).
application:start(bank).
application:stop(bank).
application:unload(bank).
原文地址:http://blog.csdn.net/zhongruixian/article/details/42773499