C# 使用ResponseStream下载文件部分,实际下载的文件部分比我要下载的文件部分小,什么原因?

C# 使用response.GetResponseStream下载文件某一部分,实际下载的文件部分 比 我要下载的文件部分小,什么原因?我要下载文件前50000000字节,实际下载只有49,909,760字节,代码如下:

 class Program
    {
        public static void Main(string[] args)
        {
            PartDownload("http://192.168.1.104/jkbd.exe", @"C:\Users\WYQ\Desktop\Test\split\dt1.sp", 0, 50000000);
        }
        private static void PartDownload(string url, string filePath, Int64 start, Int64 end)
        {
            FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            request.AddRange("bytes", start, end);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream responseStream = response.GetResponseStream();
            CopyStream(responseStream, fs);
            responseStream.Close();
            response.Close();
            fs.Close();
        }
        public static void CopyStream(Stream inputStream, Stream outputStream, int bufferSize = 512*200)
        {
            BufferedStream bufferedInputStream = new BufferedStream(inputStream, bufferSize);
            BufferedStream bufferedOutputStream = new BufferedStream(outputStream, bufferSize);
            byte[] bs = new byte[bufferSize];
            int len = 0;
            while ((len = bufferedInputStream.Read(bs, 0, bufferSize)) != 0)
            {
                bufferedOutputStream.Write(bs, 0, len);
            }
        }
    }

下载结果:
图片说明
只有49,909,760字节,而我要下载文件前50000000字节。这个是什么原因导致的?

3个回答

一个文件在不同的计算机上显示有可能不同

qq_33530738
qq_33530738 刚刚将copystream中bufferedstream去掉,直接使用stream读写,就没有数据丢失
4 年多之前 回复
qq_33530738
qq_33530738 我是在同一台计算机上做的,服务器是我电脑windows8.1的iis8
4 年多之前 回复

我是在同一台计算机上做的,服务器是我电脑windows8.1的iis8

如果不影响打开或者使用 这些差距可以忽略了
因为上传文件与下载文件是以字节流的方式进行 在进行字节流转换的过程中难免会丢失
就如同你用10/3.0会得到3.33333333333,然后你再乘以3 只能得到9.999999999而得不到10是一个道理

qq_33530738
qq_33530738 刚刚将copystream中bufferedstream去掉,直接使用stream读写,就没有数据丢失
4 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
C#如何使用WinHttp.WinHttpRequest.5.1

C#如何使用WinHttp.WinHttpRequest.5.1

要保存 httpwebresponse里面的字节流怎么保存 ?

要保存 httpwebresponse里面的字节流怎么保存 ?

使用c#将params设置为Web服务

<div class="post-text" itemprop="text"> <p>i can't set params to my web service this is my code in php :</p> <pre><code>$myValue = $_POST['myValue']; </code></pre> <p>and this is my C# Code :</p> <pre><code>void POST(string url, string jsonContent) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "POST"; System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); Byte[] byteArray = encoding.GetBytes("myValue=" + jsonContent); request.ContentLength = byteArray.Length; request.ContentType = @"application/json"; using (Stream dataStream = request.GetRequestStream()) { dataStream.Write(byteArray, 0, byteArray.Length); } long length = 0; try { //request.GetResponse(); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { length = response.ContentLength; using (Stream responseStream = response.GetResponseStream()) { StreamReader reader = new StreamReader(responseStream, Encoding.UTF8); string WSReturned = reader.ReadToEnd(); } } } catch (WebException ex) { //Nothing... } } </code></pre> <p>i tested "&amp;myValue=" and return null again</p> <p>This is my PHP Code :</p> <pre><code>&lt;?php if (isset($_POST['NewArray'])) { $NewArray = $_POST['NewArray']; } else { $NewArray = "Not"; } echo $NewArray;?&gt; </code></pre> </div>

将C#程序转化成java程序

public String postDataToUrl(String PostData, String PostUrl, String PostEncod, boolean UrlEncode, boolean ToBase64, String contentType) { Encoding RequstEncod = Encoding.GetEncoding("UTF-8"); if (PostEncod != null) { RequstEncod = Encoding.GetEncoding(PostEncod); } //URL编码 if (UrlEncode) { PostData = HttpUtility.UrlEncode(PostData); } byte[] data = RequstEncod.GetBytes(PostData); //进行64位编码 if (ToBase64) { data = RequstEncod.GetBytes(Convert.ToBase64String(data)); } ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate xc, System.Security.Cryptography.X509Certificates.X509Chain c, System.Net.Security.SslPolicyErrors se) { return true; }; //创建请求对象 HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(PostUrl); if (httpWebRequest == null) { return ""; } #region 填充httpWebRequest的基本信息 httpWebRequest.ContentType = contentType; httpWebRequest.Method = "Post"; #endregion httpWebRequest.ContentLength = data.Length; try { Stream RequestStream = httpWebRequest.GetRequestStream(); RequestStream.Write(data, 0, data.Length); RequestStream.Close(); #region 接收返回数据 Stream ResponseStream; string stringResponse = string.Empty; ResponseStream = httpWebRequest.GetResponse().GetResponseStream(); using (StreamReader sr = new StreamReader(ResponseStream, RequstEncod)) { stringResponse = sr.ReadToEnd(); } ResponseStream.Close(); return stringResponse; #endregion } catch (Exception ex) { return ex.Message; } }

c#模拟登陆 返回500错误

我想用c#模拟登陆一个网站,然后再对网站进行操作,post参数也很简单,但是为什么返回500错误呢? ![图片说明](https://img-ask.csdn.net/upload/201603/31/1459414065_362884.jpg) ![图片说明](https://img-ask.csdn.net/upload/201603/31/1459414075_702532.png) ![图片说明](https://img-ask.csdn.net/upload/201603/31/1459414082_979129.jpg) ![图片说明](https://img-ask.csdn.net/upload/201603/31/1459414093_528164.png) ![图片说明](https://img-ask.csdn.net/upload/201603/31/1459414100_67423.png) ``` using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Threading; namespace emulateLoginBaidu { class HTMLHelper { public static CookieContainer GetCooKie(string loginUrl, string postdata, HttpHeader header) { HttpWebRequest request = null; HttpWebResponse response = null; try { CookieContainer cc = new CookieContainer(); request = (HttpWebRequest)WebRequest.Create(loginUrl); request.Method = header.method; request.ContentType = header.contentType; byte[] postdatabyte = Encoding.UTF8.GetBytes(postdata); request.ContentLength = postdatabyte.Length; request.AllowAutoRedirect = false; request.CookieContainer = cc; request.KeepAlive = true; //提交请求 Stream stream; stream = request.GetRequestStream(); stream.Write(postdatabyte, 0, postdatabyte.Length); stream.Close(); //接收响应 response = (HttpWebResponse)request.GetResponse(); response.Cookies = request.CookieContainer.GetCookies(request.RequestUri); CookieCollection cook = response.Cookies; //Cookie字符串格式 string strcrook = request.CookieContainer.GetCookieHeader(request.RequestUri); return cc; } catch (Exception ex) { throw ex; } } /// <summary> /// 获取html /// </summary> /// <param name="getUrl"></param> /// <param name="cookieContainer"></param> /// <param name="header"></param> /// <returns></returns> public static string GetHtml(string getUrl, CookieContainer cookieContainer, HttpHeader header) { Thread.Sleep(1000); HttpWebRequest httpWebRequest = null; HttpWebResponse httpWebResponse = null; try { httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(getUrl); httpWebRequest.CookieContainer = cookieContainer; httpWebRequest.ContentType = header.contentType; httpWebRequest.ServicePoint.ConnectionLimit = header.maxTry; httpWebRequest.Referer = getUrl; httpWebRequest.Accept = header.accept; httpWebRequest.UserAgent = header.userAgent; httpWebRequest.Method = "GET"; httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); Stream responseStream = httpWebResponse.GetResponseStream(); StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8); string html = streamReader.ReadToEnd(); streamReader.Close(); responseStream.Close(); httpWebRequest.Abort(); httpWebResponse.Close(); return html; } catch (Exception e) { if (httpWebRequest != null) httpWebRequest.Abort(); if (httpWebResponse != null) httpWebResponse.Close(); return string.Empty; } } } public class HttpHeader { public string contentType { get; set; } public string accept { get; set; } public string userAgent { get; set; } public string method { get; set; } public int maxTry { get; set; } } } ``` 测试代码: ``` try { HttpHeader header = new HttpHeader(); header.accept = @"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; header.contentType = "application/x-www-form-urlencoded"; header.method = "POST"; header.userAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0"; header.maxTry = 300; CookieContainer cookieContainer = new CookieContainer(); cookieContainer = HTMLHelper.GetCooKie("https://www.wish.com/api/email-login", "email=oxvbgzo66627404%40163.com&password=ai49425&_buckets=&_experiments=", header); string html = HTMLHelper.GetHtml("https://www.wish.com", cookieContainer, header); MessageBox.Show(html); } catch (Exception ee) { MessageBox.Show(ee.Message); } ```

FTPClient连接时间过长无数据传输导致连接无效异常如何处理?

想要实现一个实时系统,while(true){中间是从ftp服务器上面下载文件 } 现在碰到一个问题:有时候服务器上面没有文件就不会有data传输 导致时间超过设置时间后无法读取文件 但是使用:ftp.isConnect() 和ftp.isAvailable()去判断都是true 但是ftp.retrieveFile(remoteFilePath+lists[i].getName(), fos);的时候就报错,请问如何判断ftp已经失效?或者说怎么样才能重新连接下载?

中国银行接口后台POST提交

中国银行退款接口,在后台POST提交不走页面。在请求是报错请求被中止: 未能创建 SSL/TLS 安全通道。代码如下 string Number = CreateRandomCode(30); posturl = "https://ebspay.boc.cn/PGWPortal/RefundOrder.do"; pastData = ChinaBlankConfig.merchantNo + "|" + Number + "|" + "001" + "|" + 0.01 + "|" + "20121206SHKF000004"; byte[] _bytedata = System.Text.Encoding.UTF8.GetBytes(pastData); string _strSignData = PKCS7Tool.SignatureMessage(cerPath, cerWord, _bytedata, string.Empty); string _singDate = "merchantNo=" + ChinaBlankConfig.merchantNo + "&mRefundSeq=" + Number + "&curCode=001" + "&refundAmount=" + 0.01 + "&orderNo=20121206SHKF000004" + "&signData=" + _strSignData; string str = RequestAndResponse(posturl, _singDate); //初始化请求对象 var request = WebRequest.Create(url) as HttpWebRequest; //X509证书 //X509Certificate2 cert = new System.Security.Cryptography.X509Certificates.X509Certificate2(cerPath, "111111", X509KeyStorageFlags.MachineKeySet); //request.ClientCertificates.Add(cert); X509Certificate cert = new System.Security.Cryptography.X509Certificates.X509Certificate(cerPath, "111111"); X509Certificate cert2 = new System.Security.Cryptography.X509Certificates.X509Certificate(keyStorePath); request.ClientCertificates.Add(cert2); request.ClientCertificates.Add(cert); request.ImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; //设定验证回调(总是同意) ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = Encoding.UTF8.GetByteCount(postData); request.Timeout = 300000; request.ReadWriteTimeout = 300000; //将来数据内容写入传输数据流中,并传输 using (var requestStream = request.GetRequestStream()) { using (var streamWriter = new StreamWriter(requestStream)) { streamWriter.Write(postData); } } //初始化响应对象 var response = request.GetResponse() as HttpWebResponse; //从传输流中对象返回的数据 using (var responseStream = response.GetResponseStream()) { using (var streamReader = new StreamReader(responseStream)) { return streamReader.ReadToEnd(); } }

C#模拟登录中国联通获取用户通话详单

我写一个根据手机号码和服务密码自动登录中国联通官网 然后获取通话详单json的类,第一步模拟登录返回的数据没有问题 但是第二步获取通话详单的时候总是报500错误 有人知道解决方法吗? public static string GetCalldetails(string userName, string password) { string content=""; CookieContainer cookie = new CookieContainer(); string postUrl = "https://uac.10010.com/portal/Service/MallLogin?callback=jQuery17202691898950318097_1403425938090&redirectURL=http://www.10010.com&userName="+userName+"&password="+password+"&pwdType=01&productType=01&redirectType=01&rememberMe=1"; HttpWebRequest httpRequset = (HttpWebRequest)WebRequest.Create(postUrl); httpRequset.CookieContainer = cookie;//设置cookie httpRequset.Method = "GET"; httpRequset.ContentType = "text/html;charset=UTF-8"; HttpWebResponse httpresponse = (HttpWebResponse)httpRequset.GetResponse(); Stream myResponseStream = httpresponse.GetResponseStream(); StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8")); string retString = myStreamReader.ReadToEnd(); myStreamReader.Close(); myResponseStream.Close(); if (Convert.ToInt32(httpresponse.StatusCode) == 200) { if (retString.Contains("resultCode:\"0000\"")) { string billurl = "http://iservice.10010.com/e3/static/query/callDetail?_=1450840337718&menuid=000100030001"; string strdata = "pageNo=1&pageSize=100&beginDate=2015-12-01&endDate=2015-12-23"; byte[] byteArray = Encoding.UTF8.GetBytes(strdata); //string billurl = "http://iservice.10010.com/e3/static/check/checklogin/?_=1450857473494"; // HttpWebRequest Requset = (HttpWebRequest)WebRequest.Create(billurl); HttpWebRequest Requset = (HttpWebRequest)WebRequest.Create(billurl); Requset.Method = "POST"; Requset.CookieContainer = cookie; Requset.ContentType = "application/x-www-form-urlencoded"; Stream stream = Requset.GetRequestStream(); using (StreamWriter myStreamWriter = new StreamWriter(stream, Encoding.GetEncoding("UTF-8"))) { myStreamWriter.Write(byteArray); } HttpWebResponse response = (HttpWebResponse)Requset.GetResponse(); //if (Convert.ToInt32(response.StatusCode) == 200) //{ using (Stream responsestream = response.GetResponseStream()) { using (StreamReader sr = new StreamReader(responsestream, Encoding.GetEncoding("utf-8"))) { content = sr.ReadToEnd(); //return content; } } return content; } else { return "登录失败:" + retString + ""; } } else { int num = Convert.ToInt32(httpresponse.StatusCode); return "数据传输失败:" + num+""; } }

发送时发生错误,上面一段是人家接口PHP的示例代码,下面是做成C#的,我执行下面的C#时提示基础连接已经关闭,请问是哪里不对?

- Stream responseStream = response.GetResponseStream(); StreamReader reader = new StreamReader(responseStream, Encoding.UTF8); string content = reader.ReadToEnd(); ``` ```<?php define('APPID', '<ID>'); define('SECRET', '<PW>'); define('CALLBACK_URL', '<CALLBACKURL>'); define('TOKEN_URL', '***'); $header = [ 'Content-Type: application/x-www-form-urlencoded', 'Authorization: Basic ' . base64_encode(APPID . ':' . SECRET), ]; $param = array( 'code' => <code>, 'grant_type' => 'authorization_code', 'redirect_uri' => CALLBACK_URL, ); $ch = curl_init(TOKEN_URL); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($param)); $response = curl_exec($ch); curl_close($ch); $token = json_decode($response, true); var_dump($token); ?> //我这样提示基础连接已经关闭,发送时发生错误         const string APPID = "***"; const string SECRET = "***"; const string CALLBACK_URL = "***"; const string TOKEN_URL = "***"; string jsonParam = "code=***&grant_type=authorization_code&redirect_uri=" + CALLBACK_URL; byte[] data = Encoding.UTF8.GetBytes(jsonParam); string base64Credentials = Convert.ToBase64String(Encoding.UTF8.GetBytes(APPID + ":" + SECRET)); HttpWebRequest hwr = (HttpWebRequest)WebRequest.Create(TOKEN_URL); hwr.ContentType = "application/x-www-form-urlencoded"; hwr.Headers.Add("Authorization", "Basic " + base64Credentials); hwr.Method = "POST"; hwr.ContentLength = data.Length; Stream dataStream = hwr.GetRequestStream(); dataStream.Write(data, 0, data.Length); WebResponse response = hwr.GetResponse(); Stream dataStream = hwr.GetRequestStream(); dataStream.Write(data, 0, data.Length); Stream dataStream = hwr.GetRequestStream(); dataStream.Write(data, 0, data.Length); WebResponse response = hwr.GetResponse(); Stream dataStream = hwr.GetRequestStream(); dataStream.Write(data, 0, data.Length);

为什么下面的代码只能下载一行数据?

``` private async void 下载保存测试股票数据文件(string stockCode) { //设定下载时间段 DateTime endDate = DateTime.Now; DateTime startDate = endDate.AddDays(-30); string filePathName = "C:\\TEMP\\" + stockCode + ".csv"; string uri = string.Format("http://quotes.money.163.com/service/chddata.html?code={0}&start={1}&end={2}&fields=TCLOSE;HIGH;LOW;TOPEN;TURNOVER;VOTURNOVER", stockCode, startDate.ToString("yyyyMMdd"), endDate.ToString("yyyyMMdd")); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream responseStream = response.GetResponseStream(); using (StreamReader srWeb = new StreamReader(responseStream, Encoding.GetEncoding("gb2312"))) { string text = await srWeb.ReadToEndAsync(); //或者取消异步直接string text = srWeb.ReadToEnd(); //或者循环读取一行While(text = srWeb.ReadLine() != null) Console.WriteLine(text); } } ``` //即使使用ReadLine(),第一次有一行数据,第二次读行就为空了,啥道理啊?困住了,大家能否救救我,跪谢! //用uri的实际字符串手动在浏览器里能直接下载到完整的多行数据,比如: http://quotes.money.163.com/service/chddata.html?code=0601336&start=20160616&end=20160716&fields=TCLOSE;HIGH;LOW;TOPEN;TURNOVER;VOTURNOVER

GetResponseStream只能使用一次的问题。

我用HttpWebRequest读取了一个网页后,读取的内容保存在了HttpWebResponse里面。 我后续要对HttpWebResponse的数据进行分析,可以HttpWebResponse里的GetResponseStream只能读取一次,不能反复使用,这个怎么解决? 尽量不要再次对原始网页进行下载。

Android urlconnection 上传文件

我通过Android 的urlConnection去上传文件,但是Spring MVC却接收不到,但是使用 jodd http库就可以。 常数代码: ``` private static final String END = "\r\n"; private static final String PREFIX = "--"; private static final String BOUNDARY = "***************"; private static final String REQUEST_POST = "POST"; private static final int TIME_OUT = 5000; private static final String PROPERTY_KEY_CONNECTION = "Connection"; private static final String PROPERTY_KEY_CHARSET = "Charset"; private static final String PROPERTY_KEY_COOKIE = "Cookie"; private static final String PROPERTY_KEY_CONTENT_TYPE = "Content-Type"; private static final String PROPERTY_VALUE_CONNECTION = "Keep-Alive"; private static final String PROPERTY_VALUE_CHARSET = "UTF-8"; private static final String PROPERTY_VALUE_REQUEST_CONTENT_TYPE = "multipart/json"; private static final String PROPERTY_VALUE_FILE_UPLOAD_CONTENT_TYPE = "multipart/form-data;boundary=" + BOUNDARY; private static final String PROPERTY_KEY_ACCEPT = "Accept"; private static final String PROPERTY_VALUE_ACCEPT = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; ``` 自己定义的文件上传: ``` //这里是之前我上传用的方法 try { mURL = new URL(FeedbackConst.FeedbackUrl.URL_MAIN + FeedbackConst.FeedbackUrl.URL_SUB_UPLOAD); LogUtils.i(FeedbackConst.FeedbackUrl.URL_MAIN + FeedbackConst.FeedbackUrl.URL_SUB_UPLOAD); mHttpURLConnection = (HttpURLConnection) mURL.openConnection(); //set properties mHttpURLConnection.setDoInput(true); mHttpURLConnection.setDoOutput(true); mHttpURLConnection.setUseCaches(false); String sessionId = getSessionIdFromSQLite(); mHttpURLConnection.setRequestProperty(PROPERTY_KEY_COOKIE, sessionId); mHttpURLConnection.setRequestMethod(REQUEST_POST); mHttpURLConnection.setRequestProperty(PROPERTY_KEY_CONNECTION, PROPERTY_VALUE_CONNECTION); mHttpURLConnection.setRequestProperty(PROPERTY_KEY_CHARSET, PROPERTY_VALUE_CHARSET); mHttpURLConnection.setRequestProperty(PROPERTY_KEY_CONTENT_TYPE, PROPERTY_VALUE_FILE_UPLOAD_CONTENT_TYPE); mHttpURLConnection.addRequestProperty(PROPERTY_KEY_ACCEPT, PROPERTY_VALUE_ACCEPT); DataOutputStream uploadFileOutputStream = new DataOutputStream(mHttpURLConnection.getOutputStream()); int length; Iterator<String> filenames = file.keys(); String filename = filenames.next(); LogUtils.i("file name : " + filename); String filePath = file.getString(filename); LogUtils.i("file path : " + filePath); File uploadFile = new File(filePath); FileInputStream fileInputStream = new FileInputStream(uploadFile); //DataInputStream dataInputStream = new DataInputStream(fileInputStream); LogUtils.i(LOG_TAG, "here is running!"); if (null == filename) { filename = filePath.substring(filePath.lastIndexOf("/") + 1); } //here may be is wrong uploadFileOutputStream.writeBytes(END + PREFIX + BOUNDARY + PREFIX + END); uploadFileOutputStream.writeBytes("Content-Disposition: form-data;" + "name=\"file\";filename=\"" + filename + "\"" + END); //uploadFileOutputStream.writeBytes("Content-Type: application/octet-stream;charset=utf-8" + END); uploadFileOutputStream.writeBytes(END); int bufferSize = 1024; byte[] buffer = new byte[bufferSize]; LogUtils.i(LOG_TAG, "文件大小 : " + fileInputStream.available()); while (-1 != (length = fileInputStream.read(buffer))) { uploadFileOutputStream.write(buffer, 0, length); } fileInputStream.close(); uploadFileOutputStream.writeBytes(END); uploadFileOutputStream.writeBytes(PREFIX + BOUNDARY + PREFIX + END); uploadFileOutputStream.flush(); uploadFileOutputStream.close(); float code = mHttpURLConnection.getResponseCode(); LogUtils.e("response Code : " + code); if (200 == (int) code) { InputStream responseStream = mHttpURLConnection.getInputStream(); BufferedReader responseReader = new BufferedReader(new InputStreamReader(responseStream)); StringBuffer responseBuffer = new StringBuffer(); String tmp; while (null != (tmp = responseReader.readLine())) { responseBuffer.append(tmp); } LogUtils.i(LOG_TAG, responseBuffer.toString()); responseStream.close(); } else { LogUtils.e("server response error code : " + code); return null; } } catch (MalformedURLException e) { LogUtils.e(LOG_TAG, e.getMessage()); throw new FeedbackException(e.hashCode(), e.getMessage()); } catch (IOException e) { LogUtils.e(LOG_TAG, "IOException : " + e.getMessage()); throw new FeedbackException(e.hashCode(), e.getMessage()); } catch (JSONException e) { LogUtils.e(LOG_TAG, e.getMessage()); throw new FeedbackException(e.hashCode(), e.getMessage()); } ``` 使用jodd库进行上传: ``` Iterator<String> filenames = file.keys(); jodd.http.HttpRequest req = jodd.http.HttpRequest.post(FeedbackConst.FeedbackUrl.URL_MAIN + FeedbackConst.FeedbackUrl.URL_SUB_UPLOAD) .accept(PROPERTY_VALUE_ACCEPT) .cookies(new Cookie(getSessionIdFromSQLite())); while (filenames.hasNext()) { String filename = filenames.next(); LogUtils.i("file name : " + filename); try { req.form(filename, new File(file.getString(filename))); } catch (JSONException e) { e.printStackTrace(); } } jodd.http.HttpResponse httpResponse = req.send(); LogUtils.i("url : " + req.url()); LogUtils.i("response code : " + httpResponse.statusCode() + ""); String value = httpResponse.charset("utf-8").bodyText(); LogUtils.i("return length : " + value.length()); value = value.replaceAll("\r|\n", ""); try { mResponseJSONObject = new JSONObject(value); } catch (JSONException e) { throw new FeedbackException(e.hashCode(), e.getMessage()); } ```

使用PHP / JS动态填充上传文件的网页

<div class="post-text" itemprop="text"> <p>I have been tasked with modifying a page so that it accepts an uploaded file and parses the contents of that file to display it in a particular format.</p> <p>I have code that parses the file - but currently it reads a static file on the server and reads it as a string. Instead I want the contents of the file to populate the string after upload.</p> <p>What's the best way to accomplish this using PHP/JS. I would prefer not to use PHP at all if possible, but it's fine if I have to.</p> <p>Other options are also welcome.</p> <p>Thanks</p> <p>Edit:</p> <p>Thanks - I will post the code shortly as I'm yet making some changes to it.</p> <p>This might be a stupid question, but I'm not familiar with AJAX.</p> <p>Does the file have to be uploaded to any location, or can it be temporarily housed in a variable. </p> <p>The file I need to use is </p> <p><a href="http://distributome.avinashc.com/howardL/scripts/distributome.js" rel="nofollow">http://distributome.avinashc.com/howardL/scripts/distributome.js</a></p> <p>In particular the lines xmlDoc = xmlhttp.responseXML;</p> <p>I am opening the file "Distributome.xml" using the operation</p> <p>xmlhttp.open("GET","Distributome.xml",false);</p> <p>Instead I want to populate it using an XML file (or two) that the user uploads.</p> <p>As another part of the task; I need to use two files so that they contain different data; so for now I am just appending the two files - in the lines that I have commented.</p> <p>Edit:</p> <pre><code> { /* Split into distributions and relations - but append them xmlhttp.open("GET","Distributome.xml",false); xmlhttp.send(); if (!xmlhttp.responseXML.documentElement &amp;&amp; xmlhttp.responseStream) xmlhttp.responseXML.load(xmlhttp.responseStream); xmlDoc = xmlhttp.responseXML; xmlhttp.open("GET","Distributome-references.xml",false); xmlhttp.send(); if (!xmlhttp.responseXML.documentElement &amp;&amp; xmlhttp.responseStream) xmlhttp.responseXML.load(xmlhttp.responseStream); xmlDoc = xmlDoc+xmlhttp.responseXML; */ getURLParameters(); /*** Read in and parse the Distributome.xml DB ***/ var xmlhttp=createAjaxRequest(); xmlhttp.open("GET","Distributome.xml",false); xmlhttp.send(); if (!xmlhttp.responseXML.documentElement &amp;&amp; xmlhttp.responseStream) xmlhttp.responseXML.load(xmlhttp.responseStream); xmlDoc = xmlhttp.responseXML; try{ DistributomeXML_Objects=xmlDoc.documentElement.childNodes; }catch(error){ DistributomeXML_Objects=xmlDoc.childNodes; } traverseXML(false, null, DistributomeXML_Objects, distributome.nodes, distributome.edges, distributome.references, distributomeNodes, referenceNodes); xmlhttp=createAjaxRequest(); xmlhttp.open("GET","Distributome.xml.pref",false); xmlhttp.send(); if (!xmlhttp.responseXML.documentElement &amp;&amp; xmlhttp.responseStream) xmlhttp.responseXML.load(xmlhttp.responseStream); var ontologyOrder = xmlhttp.responseXML; getOntologyOrderArray(ontologyOrder); } </code></pre> <p>Edit:</p> <p>I am not uploading the file to the server; instead I just want the content to be parsed when the user uploads - locally.</p> </div>

将C#SOAP Post请求转换为PHP SOAP Post请求

<div class="post-text" itemprop="text"> <p>The C# code looks like this:</p> <pre><code>private static string SendSoapRequest(string request, string destinationUrl) { string soapRequest = String.Format("&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;" + "&lt;soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " + "soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"&gt;" + "&lt;soap:Body&gt;{0}&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;", request); HttpWebRequest req = (HttpWebRequest) WebRequest.Create(destinationUrl); byte[] buffer = Encoding.UTF8.GetBytes(soapRequest); req.Method = "POST"; req.ContentType = "application/soap+xml"; req.ContentLength = buffer.Length; req.CookieContainer = new CookieContainer(); // enable cookies req.Referer = "localhost"; req.Credentials = CredentialCache.DefaultCredentials; Stream reqst = req.GetRequestStream(); // add form data to request stream reqst.Write(buffer, 0, buffer.Length); reqst.Flush(); reqst.Close(); HttpWebResponse res = (HttpWebResponse) req.GetResponse(); Stream responseStream = res.GetResponseStream(); if (responseStream != null) { StreamReader sr = new StreamReader(responseStream); string response = sr.ReadToEnd(); return response; } return string.Empty; } </code></pre> <p>And my effort so far, among many other variations, in PHP wihtout success:</p> <pre><code>public static function sendSoapCurl($samlMessage, $destination, $action) { $headers = array( "Content-type: application/soap+xml;charset=\"utf-8\"", "Content-length: ".strlen($samlMessage), ); if (isset($action)) { $headers[] = "SOAPAction: $action"; } // $samlMessage = utf8_encode($samlMessage); // PHP cURL for https connection with auth $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $destination); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $samlMessage); // the SOAP request curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // get soap response $soapresponsexml = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode != 200) { print_r("Status code: ".$httpCode." "); print_r($soapresponsexml);exit(); } if ($soapresponsexml === null || $soapresponsexml === "") { throw new \Exception('Empty SOAP response, check peer certificate.'); } try { $dom = new DOMDocument(); $dom = OneLogin_Saml2_Utils::loadXML($dom, $soapresponsexml); } catch (RuntimeException $e) { throw new \Exception('Not a SOAP response.', 0, $e); } $soapfault = self::getSOAPFault($dom); if (isset($soapfault)) { throw new \Exception($soapfault); } } </code></pre> <p>The C# code works, but I can't get it to work in PHP. Any ideas will be greatly appreciated. Thanks.</p> </div>

关于http通信的一些问题:请问大佬第一句的字符串各个部分都是什么意思

private const string UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"; public static string PostData(string url, string data) { // Convert to bytes string strReturn = ""; try { byte[] obtPostData = Encoding.UTF8.GetBytes(data); HttpWebRequest orqRequest = (HttpWebRequest)WebRequest.Create(url); orqRequest.Timeout = 3000; orqRequest.Method = "POST"; orqRequest.UserAgent = UserAgent; orqRequest.ContentType = "application/x-www-form-urlencoded"; orqRequest.ContentLength = obtPostData.Length; orqRequest.AllowAutoRedirect = false; // Add post data to request Stream stream; using (stream = orqRequest.GetRequestStream()) { stream.Write(obtPostData, 0, obtPostData.Length); } HttpWebResponse orsResponse = (HttpWebResponse)orqRequest.GetResponse(); using (Stream responseStream = orsResponse.GetResponseStream()) { using (StreamReader streamRead = new StreamReader(responseStream, Encoding.UTF8)) { strReturn = streamRead.ReadToEnd(); } } } catch (Exception e) { strReturn = e.Message; } return strReturn; }

尝试将.zip文件从VB .NET上传到服务器时出错

<div class="post-text" itemprop="text"> <p>I´m trying to upload .zip files from my VB form to a server, but file loses header information in the process, and I´m unable to find the error/s. Debugging, i found that losed data is from header. Does anyone know why is this happening?</p> <p>My VB.NET code is:</p> <pre><code>Imports System.Text Public Class Form1 Dim hola As String = "hola" Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click HttpUploadFile("http://localhost/sitio_victor/files.php?parameter1=""value1""&amp;parameter2=" &amp; hola &amp; "", "C:\MDPScan\ParaEnviar\C001_C002_C005_01062016_092619_76CDB2BAD9582D23C1F6F4D868218D6C.zip", "file", "multipart/form-data") End Sub Private Sub HttpUploadFile( _ ByVal uri As String, _ ByVal filePath As String, _ ByVal fileParameterName As String, _ ByVal contentType As String) Dim process As New Process Dim boundary As String = "---------------------------" &amp; DateTime.Now.Ticks.ToString("x") Dim newLine As String = System.Environment.NewLine Dim boundaryBytes As Byte() = Encoding.ASCII.GetBytes(newLine &amp; "--" &amp; boundary &amp; newLine) Dim request As Net.HttpWebRequest = Net.WebRequest.Create(uri) request.ContentType = "multipart/form-data; boundary=" &amp; boundary request.Method = "POST" request.KeepAlive = True request.Credentials = Net.CredentialCache.DefaultCredentials Using requestStream As IO.Stream = request.GetRequestStream() Dim formDataTemplate As String = "Content-Disposition: form-data; name=""{0}""{1}{1}{2}" requestStream.Write(boundaryBytes, 0, boundaryBytes.Length) Dim headerTemplate As String = "Content-Disposition: form-data; name=""{0}""; filename=""{1}""{2}Content-Type: {3};" Dim header As String = String.Format(headerTemplate, fileParameterName, filePath, newLine, contentType) MsgBox(header) Dim headerBytes As Byte() = Encoding.UTF8.GetBytes(header.ToString) requestStream.Write(headerBytes, 0, header.Length) Using fileStream As New IO.FileStream(filePath, IO.FileMode.Open, IO.FileAccess.Read) Dim buffer(4096) As Byte Dim bytesRead As Int32 = fileStream.Read(buffer, 0, buffer.Length) Do While (bytesRead &gt; 0) requestStream.Write(buffer, 0, bytesRead) bytesRead = fileStream.Read(buffer, 0, buffer.Length) Loop End Using Dim trailer As Byte() = Encoding.ASCII.GetBytes(newLine &amp; "--" + boundary + "--" &amp; newLine) requestStream.Write(trailer, 0, trailer.Length) End Using Dim response As Net.WebResponse = Nothing Try response = request.GetResponse() Using responseStream As IO.Stream = response.GetResponseStream() Using responseReader As New IO.StreamReader(responseStream) Dim responseText = responseReader.ReadToEnd() MsgBox(responseText) End Using End Using Catch exception As Net.WebException response = exception.Response If (response IsNot Nothing) Then Using reader As New IO.StreamReader(response.GetResponseStream()) Dim responseText = reader.ReadToEnd() Diagnostics.Debug.Write(responseText) End Using response.Close() End If Finally process.Start(uri) request = Nothing End Try End Sub End Class </code></pre> <p>And PHP code is:</p> <pre><code>&lt;?php $target_dir = "C:\images"; print_r($_FILES); //print_r($_POST); print_r($_REQUEST); $target_file = $_FILES['file']['tmp_name']; if(move_uploaded_file($target_file, $target_dir. DIRECTORY_SEPARATOR . $_FILES['file']['name'])) { echo "Success"; } else { echo "Failure"; } ?&gt; </code></pre> <p>I would be grateful of have any help.</p> <p>Best regards!</p> </div>

android中,网络大图解析出NULL

如题,现在需要的是在imageView中显示一个比较大的图片(有几M大) inJustDecodeBounds这个我会用。 不过问题是出在这里: ``` HttpMethod m_request; ......此处省略 m_request.getResponseBody(); ``` 获取byte数组,这样做,小图会正常解析出Bitmap,对于大图会报OOM. 然后我换了一种办法: ``` m_responseStream = m_request.getResponseBodyAsStream(); BitmapFactory.Options opt = new BitmapFactory.Options(); opt.inJustDecodeBounds = true; BitmapFactory.decodeStream(m_responseStream, null, opt); ...省略 opt.inJustDecodeBounds = false; m_responseStream = m_request.getResponseBodyAsStream(); m_retBitmap = BitmapFactory.decodeStream(m_responseStream, null, opt); ``` 这下不会OOM了,不过更蛋疼的来了:不管是大图小图返回全是null了。

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

Python代码实现飞机大战

文章目录经典飞机大战一.游戏设定二.我方飞机三.敌方飞机四.发射子弹五.发放补给包六.主模块 经典飞机大战 源代码以及素材资料(图片,音频)可从下面的github中下载: 飞机大战源代码以及素材资料github项目地址链接 ————————————————————————————————————————————————————————— 不知道大家有没有打过飞机,喜不喜欢打飞机。当我第一次接触这个东西的时候,我的内心是被震撼到的。第一次接触打飞机的时候作者本人是身心愉悦的,因为周边的朋友都在打飞机, 每

Python数据分析与挖掘

92讲视频课+16大项目实战+源码+¥800元课程礼包+讲师社群1V1答疑+社群闭门分享会=99元 &nbsp; 为什么学习数据分析? &nbsp; &nbsp; &nbsp; 人工智能、大数据时代有什么技能是可以运用在各种行业的?数据分析就是。 &nbsp; &nbsp; &nbsp; 从海量数据中获得别人看不见的信息,创业者可以通过数据分析来优化产品,营销人员可以通过数据分析改进营销策略,产品经理可以通过数据分析洞察用户习惯,金融从业者可以通过数据分析规避投资风险,程序员可以通过数据分析进一步挖掘出数据价值,它和编程一样,本质上也是一个工具,通过数据来对现实事物进行分析和识别的能力。不管你从事什么行业,掌握了数据分析能力,往往在其岗位上更有竞争力。 &nbsp;&nbsp; 本课程共包含五大模块: 一、先导篇: 通过分析数据分析师的一天,让学员了解全面了解成为一个数据分析师的所有必修功法,对数据分析师不在迷惑。 &nbsp; 二、基础篇: 围绕Python基础语法介绍、数据预处理、数据可视化以及数据分析与挖掘......这些核心技能模块展开,帮助你快速而全面的掌握和了解成为一个数据分析师的所有必修功法。 &nbsp; 三、数据采集篇: 通过网络爬虫实战解决数据分析的必经之路:数据从何来的问题,讲解常见的爬虫套路并利用三大实战帮助学员扎实数据采集能力,避免没有数据可分析的尴尬。 &nbsp; 四、分析工具篇: 讲解数据分析避不开的科学计算库Numpy、数据分析工具Pandas及常见可视化工具Matplotlib。 &nbsp; 五、算法篇: 算法是数据分析的精华,课程精选10大算法,包括分类、聚类、预测3大类型,每个算法都从原理和案例两个角度学习,让你不仅能用起来,了解原理,还能知道为什么这么做。

如何在虚拟机VM上使用串口

在系统内核开发中,经常会用到串口调试,利用VMware的Virtual Machine更是为调试系统内核如虎添翼。那么怎么搭建串口调试环境呢?因为最近工作涉及到这方面,利用强大的google搜索和自己

程序员的兼职技能课

获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:csdn590)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

C++语言基础视频教程

C++语言基础视频培训课程:本课与主讲者在大学开出的程序设计课程直接对接,准确把握知识点,注重教学视频与实践体系的结合,帮助初学者有效学习。本教程详细介绍C++语言中的封装、数据隐藏、继承、多态的实现等入门知识;主要包括类的声明、对象定义、构造函数和析构函数、运算符重载、继承和派生、多态性实现等。 课程需要有C语言程序设计的基础(可以利用本人开出的《C语言与程序设计》系列课学习)。学习者能够通过实践的方式,学会利用C++语言解决问题,具备进一步学习利用C++开发应用程序的基础。

北京师范大学信息科学与技术学院笔试10复试真题

北京师范大学信息科学与技术学院笔试,可以更好的让你了解北师大该学院的复试内容,获得更好的成绩。

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

本课程适合CCNA或HCNA网络小白同志,高手请绕道,可以直接学习进价课程。通过本预科课程的学习,为学习网络工程师、思科CCNA、华为HCNA这些认证打下坚实的基础! 重要!思科认证2020年2月24日起,已启用新版认证和考试,包括题库都会更新,由于疫情原因,请关注官网和本地考点信息。题库网络上很容易下载到。

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

Tomcat服务器下载、安装、配置环境变量教程(超详细)

未经我的允许,请不要转载我的文章,在此郑重声明!!! 请先配置安装好Java的环境,若没有安装,请参照我博客上的步骤进行安装! 安装Java环境教程https://blog.csdn.net/qq_40881680/article/details/83585542 Tomcat部署Web项目(一)·内嵌https://blog.csdn.net/qq_40881680/article/d...

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

图书管理系统(Java + Mysql)我的第一个完全自己做的实训项目

图书管理系统 Java + MySQL 完整实训代码,MVC三层架构组织,包含所有用到的图片资源以及数据库文件,大三上学期实训,注释很详细,按照阿里巴巴Java编程规范编写

linux下利用/proc进行进程树的打印

在linux下利用c语言实现的进程树的打印,主要通过/proc下的目录中的进程文件,获取status中的进程信息内容,然后利用递归实现进程树的打印

微信小程序开发实战之番茄时钟开发

微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。

[已解决]踩过的坑之mysql连接报“Communications link failure”错误

目录 前言 第一种方法: 第二种方法 第三种方法(适用于项目和数据库在同一台服务器) 第四种方法 第五种方法(项目和数据库不在同一台服务器) 总结 前言 先给大家简述一下我的坑吧,(我用的是mysql,至于oracle有没有这样的问题,有心的小伙伴们可以测试一下哈), 在自己做个javaweb测试项目的时候,因为买的是云服务器,所以数据库连接的是用ip地址,用IDE开发好...

人工智能-计算机视觉实战之路(必备算法+深度学习+项目实战)

系列课程主要分为3大阶段:(1)首先掌握计算机视觉必备算法原理,结合Opencv进行学习与练手,通过实际视项目进行案例应用展示。(2)进军当下最火的深度学习进行视觉任务实战,掌握深度学习中必备算法原理与网络模型架构。(3)结合经典深度学习框架与实战项目进行实战,基于真实数据集展开业务分析与建模实战。整体风格通俗易懂,项目驱动学习与就业面试。 建议同学们按照下列顺序来进行学习:1.Python入门视频课程 2.Opencv计算机视觉实战(Python版) 3.深度学习框架-PyTorch实战/人工智能框架实战精讲:Keras项目 4.Python-深度学习-物体检测实战 5.后续实战课程按照自己喜好选择就可以

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

Python数据分析师-实战系列

系列课程主要包括Python数据分析必备工具包,数据分析案例实战,核心算法实战与企业级数据分析与建模解决方案实战,建议大家按照系列课程阶段顺序进行学习。所有数据集均为企业收集的真实数据集,整体风格以实战为导向,通俗讲解Python数据分析核心技巧与实战解决方案。

YOLOv3目标检测实战系列课程

《YOLOv3目标检测实战系列课程》旨在帮助大家掌握YOLOv3目标检测的训练、原理、源码与网络模型改进方法。 本课程的YOLOv3使用原作darknet(c语言编写),在Ubuntu系统上做项目演示。 本系列课程包括三门课: (1)《YOLOv3目标检测实战:训练自己的数据集》 包括:安装darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 (2)《YOLOv3目标检测:原理与源码解析》讲解YOLOv1、YOLOv2、YOLOv3的原理、程序流程并解析各层的源码。 (3)《YOLOv3目标检测:网络模型改进方法》讲解YOLOv3的改进方法,包括改进1:不显示指定类别目标的方法 (增加功能) ;改进2:合并BN层到卷积层 (加快推理速度) ; 改进3:使用GIoU指标和损失函数 (提高检测精度) ;改进4:tiny YOLOv3 (简化网络模型)并介绍 AlexeyAB/darknet项目。

2021考研数学张宇基础30讲.pdf

张宇:博士,全国著名考研数学辅导专家,教育部“国家精品课程建设骨干教师”,全国畅销书《张宇高等数学18讲》《张宇线性代数9讲》《张宇概率论与数理统计9讲》《张宇考研数学题源探析经典1000题》《张宇考

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

DirectX修复工具V4.0增强版

DirectX修复工具(DirectX Repair)是一款系统级工具软件,简便易用。本程序为绿色版,无需安装,可直接运行。 本程序的主要功能是检测当前系统的DirectX状态,如果发现异常则进行修复

期末考试评分标准的数学模型

大学期末考试与高中的考试存在很大的不同之处,大学的期末考试成绩是主要分为两个部分:平时成绩和期末考试成绩。平时成绩和期末考试成绩总分一般为一百分,然而平时成绩与期末考试成绩所占的比例不同会导致出现不同

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

c语言项目开发实例

十个c语言案例 (1)贪吃蛇 (2)五子棋游戏 (3)电话薄管理系统 (4)计算器 (5)万年历 (6)电子表 (7)客户端和服务器通信 (8)潜艇大战游戏 (9)鼠标器程序 (10)手机通讯录系统

董付国老师Python全栈学习优惠套餐

购买套餐的朋友可以关注微信公众号“Python小屋”,上传付款截图,然后领取董老师任意图书1本。

2019全国大学生数学建模竞赛C题原版优秀论文

2019全国大学生数学建模竞赛C题原版优秀论文,PDF原版论文,不是图片合成的,是可编辑的文字版。共三篇。 C044.pdf C137.pdf C308.pdf

相关热词 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行 c# 循环给数组插入数据 c# 多线程死锁的例子 c# 钉钉读取员工排班 c# label 不显示 c#裁剪影像 c#工作进程更新ui
立即提问