csharp: Oracle Stored Procedure DAL using ODP.NET

来源:http://www.cnblogs.com/geovindu/archive/2016/09/21/5892017.html
-Advertisement-
Play Games

paging : http://www.codeproject.com/Articles/44858/Custom-Paging-GridView-in-ASP-NET-Oracle http://dba-oracle.com/t_display_oracle_stored_procedures.h ...


paging : http://www.codeproject.com/Articles/44858/Custom-Paging-GridView-in-ASP-NET-Oracle

 http://dba-oracle.com/t_display_oracle_stored_procedures.htm

oracle database metadata 

https://oracle-base.com/articles/9i/dbms_metadata

https://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_metada.htm#BGBHHHBG

https://docs.oracle.com/cd/B19306_01/appdev.102/b14294/metadata.htm

 

https://sqlmetadata.codeplex.com/

 

 

 

---top 5  適應於 Oracle,Sql server,DB2
select * from (select dense_rank() over (order by BookKindID) as dr,b.* from BookKindList b) x where dr<=5;

--分頁 Oracle
select * from   
(select t1.*,rownum rn from (select * from BookKindList) t1 where rownum<=12)  
where rn>=8;

--分頁 適應於 Oracle,Sql server,DB2

select * from (select row_number() over (order by BookKindID) as rn,b.* from BookKindList b) x where rn between 1 and 5;
  
select * from (select row_number() over (order by BookKindID) as rn,b.* from BookKindList b) x where rn between 6 and 10;

  

Oracle sql: 

--書分類目錄kind 
-- Geovin Du 
create table BookKindList
(
	BookKindID INT   PRIMARY KEY,
	BookKindName nvarchar2(500) not null,
	BookKindParent INT  null,
	BookKindCode varchar(100)   ---編號
);
--序列創建
 
drop SEQUENCE BookKindList_SEQ;

CREATE SEQUENCE BookKindList_SEQ
INCREMENT BY 1     -- 每次加幾個
START WITH 1     -- 從1開始計數
NOMAXVALUE        -- 不設置最大值
NOCYCLE            -- 一直累加,不迴圈
NOCACHE;           --設置緩存cache個序列,如果系統down掉了或者其它情況將會導致序列不連續,也可以設置為---------NOCACHE

--自增長觸發器  
drop trigger BookKindList_ID_AUTO;


 create or replace trigger BookKindList_ID_AUTO
  before insert on BookKindList   --BookKindList 是表名
  for each row
declare
  nextid number;
begin
  IF :new.BookKindID IS NULL or :new.BookKindID=0 THEN --BookKindID是列名
    select BookKindList_SEQ.Nextval --BookKindList_SEQ正是剛纔創建的
    into nextid
    from dual;
    :new.BookKindID:=nextid;
  end if;
end;    

-- 添加
drop PROCEDURE proc_Insert_BookKindList;

CREATE OR REPLACE PROCEDURE proc_Insert_BookKindList
(
temTypeName nvarchar2,
temParent number
)
AS
ncount number;
begin
--SELECT COUNT (*) INTO ncount FROM BookKindList fm1 where  EXISTS (SELECT BookKindName from BookKindList fm2 where  fm2.BookKindName=temTypeName);--判斷是否存
SELECT count(*) INTO ncount FROM BookKindList where BookKindName=temTypeName;
if ncount<=0 then
begin
INSERT INTO BookKindList (BookKindName,BookKindParent) VALUES(temTypeName,temParent);
commit;
end;
else
begin
  SELECT BookKindID INTO ncount FROM BookKindList where BookKindName=temTypeName;
  dbms_output.put_line('存在相同的記錄,添加不成功!'||ncount);
end;
end if;
Exception
    When others then
      dbms_output.put_line('存在問題,添加不成功!'||ncount);
       Rollback;
end proc_Insert_BookKindList;
 
--測試 oracle 11g 塗聚文 20150526
exec proc_Insert_BookKindList ('油彩畫',3);
 
drop PROCEDURE proc_Insert_BookKindOut;

drop PROCEDURE procInsertBookKindOut;
 -- 添加有返回值
CREATE OR REPLACE PROCEDURE proc_Insert_BookKindOut --添加返回ID
(
temTypeName nvarchar2,
temParent int,
temId out int  
)
AS
ncount number;
reid number;
begin
--SELECT COUNT (*) INTO ncount FROM BookKindList fm1 where  EXISTS (SELECT BookKindName from BookKindList fm2 where  fm2.BookKindName=temTypeName);--判斷是否存
SELECT count(*) INTO ncount FROM BookKindList where BookKindName=temTypeName;
if ncount<=0 then
begin
--INSERT INTO BookKindList (BookKindID,BookKindName,BookKindParent) VALUES(BookKindList_SEQ.nextval,temTypeName,temParent);
INSERT INTO BookKindList (BookKindName,BookKindParent) VALUES(temTypeName,temParent);
select BookKindList_SEQ.currval into reid from dual;
temId:=reid;
dbms_output.put_line('添加成功!'||temId);
commit;
end;
else
begin
  SELECT BookKindID INTO ncount FROM BookKindList where BookKindName=temTypeName;
  dbms_output.put_line('存在相同的記錄,添加不成功!'||ncount);
  temId:=0;
end;
end if;
Exception
    When others then
    begin
      dbms_output.put_line('存在問題,添加不成功!'||ncount);
      temId:=0;
       Rollback;
    end;
end proc_Insert_BookKindOut;

--測試 oracle 11g 塗聚文 20150526
declare
mid  number:=0;
nam  nvarchar2(100):='黑白畫';
par  number:=3;
begin
--proc_Insert_BookKindOut(nam in nvarchar2,par in int,mid in out int);
proc_Insert_BookKindOut(nam,par ,mid);
if mid>0 then
dbms_output.put_line('添加成功!輸出參數:'||mid);
else
dbms_output.put_line('存在相同的記錄,添加不成功!輸出參數:'||mid);
end if;
end;

--修改
CREATE OR REPLACE PROCEDURE procUpdateBookKindList (
p_id IN INT,--BookKindList.BookKindID%TYPE,   
p_name IN nvarchar2,--BookKindList.BookKindName%TYPE,  
p_parent IN INT,--BookKindList.BookKindParent%TYPE,
p_code IN varchar--BookKindList.BookKindCode%TYPE
)  
IS
ncount number;  
BEGIN  
SELECT count(*) INTO ncount FROM BookKindList where BookKindName=p_name;
if ncount<=0 then
begin
UPDATE BookKindList SET BookKindName=p_name,BookKindParent=p_parent,BookKindCode=p_code WHERE BookKindID=p_id;  
COMMIT; 
end;
else
begin
  SELECT BookKindID INTO ncount FROM BookKindList where BookKindName=p_name;
  dbms_output.put_line('存在相同的記錄,修改不成功!'||ncount); 
end; 
end if;
END procUpdateBookKindList;  

--測試
begin
procUpdateBookKindList(8,'哲學',1,'Geovin Du'); 
end;


--刪除
CREATE OR REPLACE PROCEDURE procDeleteBookKindList(p_BookKindID IN BookKindList.BookKindID%TYPE)
IS
BEGIN

  DELETE BookKindList where BookKindID = p_BookKindID;
  COMMIT;
END;

---一條記錄
--創建包:
create or replace package pack_BookKindId is 
       type cur_BookKindId is ref cursor;  
end pack_BookKindId; 

--創建存儲過程
create or replace procedure procSelectBookKindList
(p_id in int,p_cur out pack_BookKindId.cur_BookKindId) 
is   
       v_sql varchar2(400);
begin  

       if p_id = 0 then   --0 查詢所有
          open p_cur for select * from BookKindList; 
       else   
          v_sql := 'select * from BookKindList where BookKindID =: p_id';  
          open p_cur for v_sql using p_id;   
       end if;  
end procSelectBookKindList;

--創建包以游標的形式返回BookKindList表的所有記錄結果集

drop package pkg_Select_BookKindListAll;

drop procedure proc_Select_BookKindListAll;


create or replace package pkgSelectBookKindListAll is
-- Author  : geovindu
  type mycur is ref cursor;  
  procedure procSelectBookKindListAll(cur_return out mycur);
end pkgSelectBookKindListAll;

create or replace package body pkgSelectBookKindListAll is
  -- Function and procedure implementations
 procedure procSelectBookKindListAll(cur_return out mycur)
  is    
  begin
   open cur_return for select * from BookKindList;
    
  end procSelectBookKindListAll;

end pkgSelectBookKindListAll;


-- 測試包和存儲過程查詢表中所有內容
declare 
--定義游標類型的變數
cur_return pkgSelectBookKindListAll.mycur;
--定義行類型
pdtrow BookKindList%rowtype;
begin
  --執行存儲過程
  pkgSelectBookKindListAll.procSelectBookKindListAll(cur_return);
  --遍歷游標中的數據
       LOOP
         --取當前行數據存入pdtrow
           FETCH cur_return INTO pdtrow;
           --如果未獲取數據就結束迴圈
           EXIT WHEN cur_return%NOTFOUND;
           --輸出獲取到的數據
           DBMS_OUTPUT.PUT_LINE (pdtrow.BookKindID||','||pdtrow.BookKindName);
         END LOOP;
         CLOSE cur_return;
end;

  csharp code:

/// <summary>
    /// 20160918 塗聚文
    /// Geovin Du
    /// </summary>
    public class BookKindListDAL : IBookKindList
    {
        //private static string connectionString =@"DATA SOURCE=oracle11g;USER ID=geovin;password=geovindu;";
        ///<summary>
        /// 追加記錄
        ///</summary>
        ///<param name="BookKindListInfo"></param>
        ///<returns></returns>
        public int InsertBookKindList(BookKindListInfo bookKindList)
        {
            int ret = 0;
            try
            {
                OracleParameter[] par = new OracleParameter[]{
				new OracleParameter("temTypeName",OracleDbType.NVarchar2,1000),
				new OracleParameter("temParent",OracleDbType.Int32,4),
				};
                par[0].Value = bookKindList.BookKindName;
                par[0].Direction = ParameterDirection.Input;
                par[1].Value = bookKindList.BookKindParent;
                par[1].Direction = ParameterDirection.Input;
                ret = OracleHelper.ExecuteSql("proc_Insert_BookKindList", CommandType.StoredProcedure, par);
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            return ret;
        }
        /// <summary>
        /// 追加記錄返回
        /// </summary>
        /// <param name="authorList"></param>
        /// <param name="authorID"></param>
        /// <returns></returns>
        public int InsertBookKindOutput(BookKindListInfo bookKindList, out int bookKindLID)
        {
            bookKindLID = 0;
            int ret = 0;
            try
            {
                OracleParameter[] par = new OracleParameter[]{
				new OracleParameter("temTypeName",OracleDbType.NVarchar2,1000),
                new OracleParameter("temParent",OracleDbType.Int32,4),
                new OracleParameter("temId",OracleDbType.Int32,4),
				};
                par[0].Value = bookKindList.BookKindName;
                par[0].Direction = ParameterDirection.Input;
                par[1].Value = bookKindList.BookKindParent;
                par[1].Direction = ParameterDirection.Input;
                par[2].Direction = ParameterDirection.Output;
                ret = OracleHelper.ExecuteSql("proc_Insert_BookKindOut", CommandType.StoredProcedure, par);
                if (ret > 0)
                {
                    bookKindLID =int.Parse(par[2].Value.ToString());
                }
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            return ret;
        }
        ///<summary>
        ///修改記錄
        ///塗聚文 20160920
        ///</summary>
        ///<param name="BookKindListInfo"></param>
        ///<returns></returns>
        public int UpdateBookKindList(BookKindListInfo bookKindList)
        {
            int ret = 0;
            try
            {
                OracleParameter[] par = new OracleParameter[]{
				new OracleParameter("p_id",OracleDbType.Int32,4),
				new OracleParameter("p_name",OracleDbType.NVarchar2,1000),
				new OracleParameter("p_parent",OracleDbType.Int32,4),
                new OracleParameter("p_code",OracleDbType.Varchar2,1000),
				};
                par[0].Value = bookKindList.BookKindID;
                par[0].Direction = ParameterDirection.Input;
                par[1].Value = bookKindList.BookKindName;
                par[1].Direction = ParameterDirection.Input;
                par[2].Value = bookKindList.BookKindParent;
                par[2].Direction = ParameterDirection.Input;
                par[3].Value = bookKindList.BookKindCode;
                par[3].Direction = ParameterDirection.Input;
                ret = OracleHelper.ExecuteSql("procUpdateBookKindList", CommandType.StoredProcedure, par);
               // ret = 1;
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            return ret;
        }
        ///<summary>
        /// 刪除記錄
        ///</summary>
        ///<param name="bookKindIDInfo"></param>
        ///<returns></returns>
        public bool DeleteBookKindList(int bookKindID)
        {
            bool ret = false;
            try
            {
                OracleParameter par = new OracleParameter("p_BookKindID", bookKindID);
                par.Direction = ParameterDirection.Input;
                int temp = 0;
                temp = OracleHelper.ExecuteSql("procDeleteBookKindList", CommandType.StoredProcedure, par);
                if (temp != 0)
                {
                    ret = true;
                }
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            return ret;
        }
        ///<summary>
        /// 查詢記錄
        ///</summary>
        ///<param name="bookKindIDInfo"></param>
        ///<returns></returns>
        public BookKindListInfo SelectBookKindList(int bookKindID)
        {
            BookKindListInfo bookKindList = null;
            try
            {
                OracleParameter[] par = new OracleParameter[]{
                new OracleParameter("p_id",OracleDbType.Int32,4),
               new OracleParameter("p_cur",OracleDbType.RefCursor),               
            };
                par[0].Value = bookKindID;
                par[0].Direction = ParameterDirection.Input;
                par[1].Direction = ParameterDirection.Output;
                using (OracleDataReader reader = OracleHelper.GetReader("procSelectBookKindList", CommandType.StoredProcedure, par)) //proc_Select_BookKindList 提示名稱過長Oracle
                {
                    if (reader.Read())
                    {
                        bookKindList = new BookKindListInfo();
                        bookKindList.BookKindID = (!object.Equals(reader["BookKindID"], null)) ? (decimal)reader["BookKindID"] : 0;
                        bookKindList.BookKindName = (!object.Equals(reader["BookKindName"], null)) ? (string)reader["BookKindName"] : "";
                        bookKindList.BookKindParent = (!object.Equals(reader["BookKindParent"], null)) ? (decimal)reader["BookKindParent"] : 0;

                    }
                }
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            return bookKindList;
        }

        ///<summary>
        /// 查詢所有記錄
        ///</summary>
        ///<returns></returns>
        public List<BookKindListInfo> SelectBookKindListAll()
        {
            List<BookKindListInfo> list = new List<BookKindListInfo>();
            BookKindListInfo bookKindList = null;
            try
            {
                //定義參數,註意參數名必須與存儲過程定義時一致,且類型為OracleType.Cursor
                OracleParameter cur_set = new OracleParameter("cur_return", OracleDbType.RefCursor);
                //設置參數為輸出類型
                cur_set.Direction = ParameterDirection.Output;
                //
                //OracleHelper.ExecuteReader(connectionString, CommandType.StoredProcedure, "pkg_Select_BookKindListAll.proc_Select_BookKindListAll", cur_set)
                using (OracleDataReader reader = OracleHelper.GetReader("pkg_Select_BookKindListAll.proc_Select_BookKindListAll", CommandType.StoredProcedure, cur_set))
                {
                    while (reader.Read())
                    {
                        bookKindList = new BookKindListInfo();
                        string s = reader["BookKindID"].ToString();
                        bookKindList.BookKindID = (!object.Equals(reader["BookKindID"], null)) ? (decimal)reader["BookKindID"] : 0;
                        bookKindList.BookKindName = (!object.Equals(reader["BookKindName"], null)) ? (string)reader["BookKindName"] : "";
                        bookKindList.BookKindParent = (!object.Equals(reader["BookKindParent"], null)) ? (decimal)reader["BookKindParent"] : 0;
                        list.Add(bookKindList);

                    }
                }
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            return list;
        }
        ///<summary>
        /// 查詢所有記錄
        ///</summary>
        ///<returns></returns>
        public DataTable SelectBookKindListDataTableAll()
        {
            DataTable dt = new DataTable();
            try
            {
                //定義參數,註意參數名必須與存儲過程定義時一致,且類型為OracleType.Cursor
                OracleParameter cur_set = new OracleParameter("cur_return", OracleDbType.RefCursor);
                //設置參數為輸出類型
                cur_set.Direction = ParameterDirection.Output;
                //添加參數
                //comm.Parameters.Add(cur_set);
                using (DataTable reader = OracleHelper.GetTable("pkgSelectBookKindListAll.procSelectBookKindListAll", CommandType.StoredProcedure, cur_set))
                {
                    dt = reader;


                }
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            return dt;
        }


        /// <summary>
        /// 填充dataSet數據集-Oracle庫
        /// </summary>
        /// <param name="pindex">當前頁</param>
        /// <param name="psql">執行查詢的SQL語句</param>
        /// <param name="psize">每頁顯示的記錄數</param>
        /// <returns></returns>
        private bool gridbind(int pindex, string psql, int psize)
        {
            OracleConnection conn = new OracleConnection();
            OracleCommand cmd = new OracleCommand();
            OracleDataAdapter dr = new OracleDataAdapter();
            conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            cmd.Connection = conn;
            cmd.CommandType = CommandType.StoredProcedure;
            conn.Open();
            cmd.CommandText = "DotNet.DotNetPageRecordsCount";
            cmd.Parameters.Add("psqlcount", OracleDbType.Varchar2).Value = psql;
            cmd.Parameters.Add("prcount", OracleDbType.Int32).Direction = ParameterDirection.Output;

            cmd.ExecuteNonQuery();
            string PCount = cmd.Parameters["prcount"].Value.ToString();
            cmd.Parameters.Clear();
            cmd.CommandText = "DotNet.DotNetPagination";
            if (pindex != 0)
            {
                cmd.Parameters.Add("pindex", OracleDbType.Int32).Value = pindex - 1;
            }
            else
            {
                cmd.Parameters.Add("pindex", OracleDbType.Int32).Value = pindex;
            }
            cmd.Parameters.Add("psql", OracleDbType.Varchar2).Value = psql;
            cmd.Parameters.Add("psize", OracleDbType.Int32).Value = psize;
            cmd.Parameters.Add("v_cur", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("pcount", OracleDbType.Int32).Direction = ParameterDirection.Output;
            dr.SelectCommand = cmd;
            try
            {
                DataSet ds = new DataSet();
                dr.Fill(ds);
                //顯示頁碼條的狀態 
                //showStatus(Convert.ToInt32(cmd.Parameters["pindex"].Value + 1,
                //    Convert.ToInt32(cmd.Parameters["pcount"].Value),
                //    Convert.ToInt32(PCount));
                for (int i = 0; i < ds.Tables.Count; i++)
                { //把數據行為零的表刪除
                    if (ds.Tables[i].Rows.Count == 0)
                        ds.Tables.Remove(ds.Tables[i].TableName);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return false;
            }

            conn.Close();
            return true;
        }
    }

  


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 查到對應的用戶的活動連接: select * from pg_stat_activity where username="xxx"; 殺掉死鎖的連接: select pg_terminate_backend(pid) ...
  • Oracle資料庫用戶數據完整備份與恢復 1.1 PL/SQL->工具->導出用戶對象,選項如圖 常用的用戶對象包括: TABLE,SEQUENCE,VIEW,PACKAGE,TYPE,FUNCTION,PROCEDURE,PACKAGE BODY,TREGGER 1.2 PL/SQL->工具->導 ...
  • 先來描述下情況吧,首先有一批用戶之前批量錄入後預設的密碼為6個8然後進行MD5加密後進行存儲的,現在需要對其更改根據用戶身份證號後6位作為密碼。 1.首先發現我們sqlserver05以上的版本是自帶了MD5加密方法的,然後我們對其驗證其加密後的數據跟用.net自帶的MD5加密方法加密後是否相同。 ...
  • Redis是一個C實現的基於記憶體、可持久化的鍵值對資料庫,在分散式服務中常作為緩存服務。本篇將介紹在CentOS下如何從零開始安裝到配置啟動服務。 ...
  • sql函數 character函數 String 1.INITCAP 首字母大小 select initcap(address) address from student; select initcap('ni hao') from dual; --dual虛擬表 '數據' 列名-數據 2.LTRI ...
  • ACCESS數據的連接及語句執行操作,不難,久不用會生疏,每次都要找資料,乾脆自己整理下,記錄下來,需要的時候,直接查看,提高效率。也供初學者參考 1、連接字元串 public static string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Da ...
  • 身處MySQL這個圈子,能夠切身地感受到大家對MySQL 5.7的期待和熱情,似乎每個人都迫不及待的想要瞭解、學習和使用MySQL 5.7。那麼,我們不禁要問,MySQL 5.7到底做了哪些改進,引入了哪些新功能,性能又提升了多少,能夠讓大家翹首以盼,甚至歡呼雀躍呢? MySQL 5.7在諸多方面都 ...
  • Oracle day01 Oracle簡介及表的創建,增刪改查 安裝好之後,需要手動開啟的服務 : 右鍵我的電腦 管理 服務 OraclORCL 和 OracleListiner . 必須開啟. dos 底下輸入sqlplus啟動oracle,資料庫口令 : orcl 用戶名system密碼orcl ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...