小编Red*_*rmy的帖子

如何通过C#获取HTML页面源代码

我想保存在本地驱动器上完整的网页ASP .htmURL链接,但我没有成功。

public StreamReader Fn_DownloadWebPageComplete(string link_Pagesource)
{
     //--------- Download Complete ------------------
     //  using (WebClient client = new WebClient()) // WebClient class inherits IDisposable
     //   {

     //client
     //HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(link_Pagesource);

                    //webRequest.AllowAutoRedirect = true;
                    //var client1 = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(link_Pagesource);
                    //client1.CookieContainer = new System.Net.CookieContainer();


                 //   client.DownloadFile(link_Pagesource, @"D:\S1.htm");

              //  }
         //--------- Download Page Source ------------------
 HttpWebRequest URL_pageSource = (HttpWebRequest)WebRequest.Create("https://www.digikala.com");

                    URL_pageSource.Timeout = 360000;
                    //URL_pageSource.Timeout = 1000000;
                    URL_pageSource.ReadWriteTimeout = 360000;
                   // URL_pageSource.ReadWriteTimeout = 1000000;
                    URL_pageSource.AllowAutoRedirect = true;
                    URL_pageSource.MaximumAutomaticRedirections = 300; …
Run Code Online (Sandbox Code Playgroud)

c#

4
推荐指数
1
解决办法
8219
查看次数

如果值不为NULL,如何更新列

TBL_Log如果从C#输入的值不是,我想更新表的任何列NULL.这是我的存储过程:

Alter PROCEDURE [dbo].[SP_Update_User] 
(@User_id as int,@User_Names as nvarchar(max),@End as char(8),@Start as nvarchar(max) ,@Count as int)

AS
BEGIN


UPDATE [dbo].[TBL_Log]


     SET User_Names = @User_Names
      ,[Start] = @start
      ,[End] = @End
      ,[Count] = @Count
      where User_id = @User_id



END
Run Code Online (Sandbox Code Playgroud)

我试图做这项工作,但没有成功.

D1类代码:

public static DataSet Update_User(int @User_id, string @User_Names, string @End, string @Start, int @Count)
    {

        SqlConnection myConnection = new SqlConnection(strConecctionString);


        SqlDataAdapter sqlcmd = new SqlDataAdapter("SP_Update_UserData_Bot", myConnection);
        sqlcmd.SelectCommand.CommandType = CommandType.StoredProcedure;


        SqlParameter parameterID_category_ID = new SqlParameter("@User_id", SqlDbType.Int);
        parameterID_category_ID.Value = User_id; …
Run Code Online (Sandbox Code Playgroud)

sql t-sql sql-server null sql-update

1
推荐指数
1
解决办法
1566
查看次数

在这个例子中由sql删除字符串中的Dash的最佳功能?

我想在这个例子中创建感兴趣的删除仪表板(3-,2-)的功能:

柱:

1GBDDR3-1066-21
2GBDDR3-1066-21
3- 4GBDDR3-1066-414
1GBDDR3-1066-21
2-1GBDDR3-1066-21
Run Code Online (Sandbox Code Playgroud)

输出:

1GBDDR3-1066-21
2GBDDR3-1066-21
4GBDDR3-1066-414
1GBDDR3-1066-21
1GBDDR3-1066-21
Run Code Online (Sandbox Code Playgroud)

sql t-sql sql-server

1
推荐指数
1
解决办法
423
查看次数

标签 统计

sql ×2

sql-server ×2

t-sql ×2

c# ×1

null ×1

sql-update ×1