When I use the following in a webmethod:
string mysqlsPath = Server.MapPath("applog.txt");
            command.CommandText = "LOAD DATA LOCAL INFILE '" + mysqlsPath + "' INTO TABLE numbers FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'";
            command.ExecuteNonQuery();
            connection.Close();
I get Error LOAD DATA LOCAL INFILE ---> Could not find file 'c:\windows\system32\inetsrv\inetpubwwwrootwebservicesapplog.txt'
When looking开发者_如何学运维 at this error i noticed that after "inet" its dropping the "\" between the rest of the directories, what could be causing this and how can I fix it?
You'll need to escape the mysqlsPath variale first.
Something like this would do the trick
 mysqlsPath = mysqlsPath.Replace(@"\", @"\\");
This will convert the \ to \ so the c# won't remove it.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论