时间换算ifelse语句的应用教程.docx
《时间换算ifelse语句的应用教程.docx》由会员分享,可在线阅读,更多相关《时间换算ifelse语句的应用教程.docx(43页珍藏版)》请在冰点文库上搜索。
时间换算ifelse语句的应用教程
Git代码托管API文档大全(120+)JS在线编辑演示二维码
为所有资源查找重写当前线程的CurrentUICulture属性,
方法是使用此强类型资源类。
internalclassResources
{
privatestaticglobal:
:
System.Resources.ResourceManagerresourceMan;
privatestaticglobal:
:
System.Globalization.CultureInforesourceCulture;
6[C#]JZ.Project19小时前嘟嘟嘟嘟丶药
24[C#]基于C#的黄金数据接口调用代码实例1天前app接口[global:
:
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance","CA1811:
AvoidUncalledPrivateCode")]
internalResources()
{
}
开源中国-程序员在线工具:
更多»
相关的代码(397)
53[C#]sql注入之关键字过滤2天前HJCui
返回此类使用的、缓存的ResourceManager实例。
[global:
:
System.ComponentModel.EditorBrowsableAttribute(global:
:
System.ComponentModel.EditorBrowsableState.Advanced)]
internalstaticglobal:
:
System.Resources.ResourceManagerResourceManager
{
get
{
if((resourceMan==null))
{
global:
:
System.Resources.ResourceManagertemp=newglobal:
:
System.Resources.ResourceManager("ExcelToDB_Form.Properties.Resources",typeof(Resources).Assembly);
resourceMan=temp;
}
returnresourceMan;
}
}[文件]TableDataPanel.java~7KB
packagecom.yisin.cf.form;
importjava.awt.Color;
importjava.awt.Dimension;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjava.util.List;
importjava.util.Map;
importjava.util.Vector;
53[C#]基于C#的重仓股基金接口调用代码实例1周前php接口开发
importjavax.swing.BorderFactory;
importjavax.swing.JButton;
importjavax.swing.JLabel;
importjavax.swing.JScrollPane;
importjavax.swing.JTable;
importjavax.swing.JTextArea;
importjavax.swing.UIManager;
importjavax.swing.plaf.InsetsUIResource;
importjavax.swing.table.DefaultTableCellRenderer;
importjavax.swing.table.DefaultTableModel;
56[C#]基于C#的货币汇率接口调用代码实例2周前app接口开发
importcom.yisin.cf.db.DBHelper;
importcom.yisin.cf.util.SQLFormatter;
publicclassTableDataPanelextendsBasePanel{
privateStringsql="";
privateStringtableName="";
privateintwidth=900,height=600;
publicTableDataPanel(intwidth,intheight){
this.width=width;
this.height=height;
initCommpant();
}
publicvoidviewTableData(StringtableName){
if(tableName!
=null){
this.tableName=tableName;
sql="select*from"+tableName+"limit0,1000";
//执行SQL
excuteSql();
}else{
sql="";
}
sqlArea.setText(sql);
}
publicJTextAreasqlArea;
publicJTextAreainfoArea;
publicJTabledataTable;
publicDefaultTableModelmodel=null;
publicJButtonexcuteBtn;
publicJButtonformatBtn;
publicJScrollPanetabJsp;
publicJScrollPaneinfoJsp;
[代码][GoogleGo]代码
packagemain
import(
"io/ioutil"
"net/http"
"net/"
"fmt"
"encoding/json"
)
//----------------------------------
//黄金数据调用示例代码-聚合数据
//在线接口文档:
www/docs/29
//----------------------------------
constAPPKEY="*******************"//您申请的APPKEY
funcmain(){
//1.上海黄金交易所
Request1()
//2.上海期货交易所
Request2()
//3.银行账户黄金
Request3()
}
//1.上海黄金交易所
funcRequest1(){
//请求地址
juhe/finance/gold/shgold"
//初始化参数
param:
=.Values{}
//配置请求参数,方法内部已处理encode问题,中文参数可以直接传参
param.Set("key",APPKEY)//APPKey
param.Set("v","")//JSON格式版本(0或1)默认为0
//发送请求
data,err:
=Get(juhe,param)
iferr!
=nil{
fmt.Errorf("请求失败,错误信息:
\r\n%v",err)
}else{
varnetReturnmap[string]interface{}
json.Unmarshal(data,&netReturn)
ifnetReturn["error_code"].(float64)==0{
fmt.Printf("接口返回result字段是:
\r\n%v",netReturn["result"])
}
}
}
//2.上海期货交易所
funcRequest2(){
//请求地址
juhe/finance/gold/shfuture"
//初始化参数
param:
=.Values{}
//配置请求参数,方法内部已处理encode问题,中文参数可以直接传参
param.Set("key",APPKEY)//APPKey
param.Set("v","")//JSON格式版本(0或1)默认为0
//发送请求
data,err:
=Get(juhe,param)
iferr!
=nil{
fmt.Errorf("请求失败,错误信息:
\r\n%v",err)
}else{
varnetReturnmap[string]interface{}
json.Unmarshal(data,&netReturn)
ifnetReturn["error_code"].(float64)==0{
fmt.Printf("接口返回result字段是:
\r\n%v",netReturn["result"])
}
}
}
//3.银行账户黄金
funcRequest3(){
//请求地址
juhe/finance/gold/bankgold"
//初始化参数
param:
=.Values{}
//配置请求参数,方法内部已处理encode问题,中文参数可以直接传参
param.Set("key",APPKEY)//APPKey
//发送请求
data,err:
=Get(juhe,param)
iferr!
=nil{
fmt.Errorf("请求失败,错误信息:
\r\n%v",err)
}else{
varnetReturnmap[string]interface{}
json.Unmarshal(data,&netReturn)
ifnetReturn["error_code"].(float64)==0{
fmt.Printf("接口返回result字段是:
\r\n%v",netReturn["result"])
}
}
}
//get网络请求
funcGet(apistring,params.Values)(rs[]byte,errerror){
var*.
err=.Parse(api)
iferr!
=nil{
fmt.Printf("解析错误:
\r\n%v",err)
returnnil,err
}
//如果参数中有中文参数,这个方法会进行Encode
.RawQuery=params.Encode()
resp,err:
=http.Get(.String())
iferr!
=nil{
fmt.Println("err:
",err)
returnnil,err
}
deferresp.Body.Close()
returnioutil.ReadAll(resp.Body)
}
//post网络请求,params是.Values类型
funcPost(apistring,params.Values)(rs[]byte,errerror){
resp,err:
=http.PostForm(api,params)
iferr!
=nil{
returnnil,err
}
deferresp.Body.Close()
returnioutil.ReadAll(resp.Body)
}
代码描述:
基于GO的黄金数据接口调用代码实例
关联数据:
黄金数据
[代码][C#]代码
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Net;
usingSystem.IO;
usingXfrog.Net;
usingSystem.Diagnostics;
usingSystem.Web;
//----------------------------------
//黄金数据调用示例代码-聚合数据
//在线接口文档:
www/docs/29
//代码中JsonObject类下载地址:
/download/gcm3206021155665/7458439
//----------------------------------
namespaceConsoleAPI
{
classProgram
{
staticvoidMain(string[]args)
{
stringappkey="*******************";//配置您申请的appkey
//1.上海黄金交易所
string1="web:
8080/finance/gold/shgold";
varparameters1=newDictionary();
parameters1.Add("key",appkey);//你申请的key
parameters1.Add("v","");//JSON格式版本(0或1)默认为0
stringresult1=sendPost(1,parameters1,"get");
JsonObjectnewObj1=newJsonObject(result1);
StringerrorCode1=newObj1["error_code"].Value;
if(errorCode1=="0")
{
Debug.WriteLine("成功");
Debug.WriteLine(newObj1);
}
else
{
//Debug.WriteLine("失败");
Debug.WriteLine(newObj1["error_code"].Value+":
"+newObj1["reason"].Value);
}
//2.上海期货交易所
string2="web:
8080/finance/gold/shfuture";
varparameters2=newDictionary();
parameters2.Add("key",appkey);//你申请的key
parameters2.Add("v","");//JSON格式版本(0或1)默认为0
stringresult2=sendPost(2,parameters2,"get");
JsonObjectnewObj2=newJsonObject(result2);
StringerrorCode2=newObj2["error_code"].Value;
if(errorCode2=="0")
{
Debug.WriteLine("成功");
Debug.WriteLine(newObj2);
}
else
{
//Debug.WriteLine("失败");
Debug.WriteLine(newObj2["error_code"].Value+":
"+newObj2["reason"].Value);
}
//3.银行账户黄金
string3="web:
8080/finance/gold/bankgold";
varparameters3=newDictionary();
parameters3.Add("key",appkey);//你申请的key
stringresult3=sendPost(3,parameters3,"get");
JsonObjectnewObj3=newJsonObject(result3);
StringerrorCode3=newObj3["error_code"].Value;
if(errorCode3=="0")
{
Debug.WriteLine("成功");
Debug.WriteLine(newObj3);
}
else
{
//Debug.WriteLine("失败");
Debug.WriteLine(newObj3["error_code"].Value+":
"+newObj3["reason"].Value);
}
}
///
///Http(GET/POST)
///
///请求
///请求参数
///请求方法
///响应内容
staticstringsendPost(string,IDictionaryparameters,stringmethod)
{
if(method.ToLower()=="post")
{
HttpWebRequestreq=null;
HttpWebResponsersp=null;
System.IO.StreamreqStream=null;
try
{
req=(HttpWebRequest)WebRequest.Create();
req.Method=method;
req.KeepAlive=false;
req.ProtocolVersion=HttpVersion.Version10;
req.Timeout=5000;
req.ContentType="application/x-www-form-encoded;charset=utf-8";
byte[]postData=Encoding.UTF8.GetBytes(BuildQuery(parameters,"utf8"));
reqStream=req.GetRequestStream();
reqStream.Write(postData,0,postData.Length);
rsp=(HttpWebResponse)req.GetResponse();
Encodingencoding=Encoding.GetEncoding(rsp.CharacterSet);
returnGetResponseAsString(rsp,encoding);
}
catch(Exceptionex)
{
returnex.Message;
}
finally
{
if(reqStream!
=null)reqStream.Close();
if(rsp!
=null)rsp.Close();
}
}
else
{
//创建请求
HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create(+"?
"+BuildQuery(parameters,"utf8"));
//GET请求
request.Method="GET";
request.ReadWriteTimeout=5000;
request.ContentType="text/html;charset=UTF-8";
HttpWebResponseresponse=(HttpWebResponse)request.GetResponse();
StreammyResponseStream=response.GetResponseStream();
StreamReadermyStreamReader=newStreamReader(myResponseStream,Encoding.GetEncoding("utf-8"));
//返回内容
stringretString=myStreamReader.ReadToEnd();
returnretString;
}
}
///
///组装普通文本请求参数。
///
///Key-Value形式请求参数字典
///编码后的请求数据
staticstringBuildQuery(IDictionaryparameters,stringencode)
{
StringBuilderpostData=newStringBuilder();
boolhasParam=false;
IEnumerator>dem=parameters.GetEnumerator();
while(dem.MoveNext())
{
stringname=dem.Current.Key;
stringvalue=dem.Current.Value;
//忽略参数名或参数值为空的参数
if(!
string.IsNullOrEmpty(name))//&&!
string.IsNullOrEmpty(value)
{
if(hasParam)
{
postData.Append("&");
}
postData.Append(name);
postData.Append("=");
if(encode=="gb2312")
{
postData.Append(HttpUtility.Encode(value,Encoding.GetEncoding("gb2312")));
}
elseif(encode=="utf8")
{
postData.Append(HttpUtility.Encode(value,Encoding.UTF8));
}
else
{
postData.Append(value);
}
hasParam=true;
}
}
returnpostData.ToString();
}
///
///把响应流转换为文本。
///
///