장비관리를 별도의 프로젝트로 분리 -
개별 프로젝트 참조를 위한 뼈대 생성 - 공용은 fcommon 으로 이 관
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
using System;
|
||||
//180917 chi makefilepath,MakeFTPPath 입력
|
||||
//180705 chi GetHexStringNoSpace 다시 추가 ,UrlPathEncode 추가
|
||||
// getDateValue 추가
|
||||
//180625 chi GetHexStringNoSpace 삭제(이것은 util.cs로 이동)
|
||||
//180614 chi Map 명령추가
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -13,6 +20,38 @@ namespace Project
|
||||
/// </summary>
|
||||
public static class MethodExtensions
|
||||
{
|
||||
public static string MakeFilePath(this string value,params string[] param)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
sb.Append(value.Replace("/", "\\"));
|
||||
foreach (var item in param)
|
||||
{
|
||||
if (sb.Length > 0 && sb.ToString().EndsWith("\\") == false) sb.Append("\\");
|
||||
sb.Append(item.Replace("/", "\\"));
|
||||
}
|
||||
var retval = sb.ToString().Replace("/", "\\").Replace("\\\\", "\\");
|
||||
return retval.ToString();
|
||||
}
|
||||
|
||||
|
||||
public static string MakeFTPPath(this string value, params string[] param)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
sb.Append(value.Replace("\\", "/"));
|
||||
foreach (var item in param)
|
||||
{
|
||||
if (sb.Length > 0 && sb.ToString().EndsWith("/") == false) sb.Append("/");
|
||||
sb.Append(item.Replace("\\", "/"));
|
||||
}
|
||||
var retval = sb.ToString().Replace("//", "/");
|
||||
return retval.ToString();
|
||||
}
|
||||
|
||||
|
||||
public static double map(this double x, int in_min, int in_max, int out_min, int out_max)
|
||||
{
|
||||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||
}
|
||||
|
||||
public static string Base64Encode(this string src)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user