小编use*_*378的帖子

避免使用"googleoff"和"googleon"抓取部分网页

我试图告诉谷歌和其他搜索引擎不要抓取我的网页的某些部分.

我所做的是:

<!--googleoff: all-->

<select name="ddlCountry" id="ddlCountry">
<option value="All">All</option>
<option value="bahrain">Bahrain</option>
<option value="china">China</option>
</select>

<!--googleon: all-->
Run Code Online (Sandbox Code Playgroud)

在我上传页面后,我注意到搜索引擎在googleoff标记内仍在渲染元素.

难道我做错了什么?

html seo comments googlebot google-crawlers

17
推荐指数
1
解决办法
2万
查看次数

调用System.Drawing.Image.Save时参数错误无效

我在调用System.Drawing.Image.Save函数时收到无效参数错误.我google并找到了一些建议,但没有任何作用.我想要做的是,当我上传一个图像,如果它比100kb大,我想将图像大小减少一半.请帮忙.

     System.Drawing.Image FullsizeImage = System.Drawing.Image.FromFile(realpath);


                        FullsizeImage = System.Drawing.Image.FromFile(realpath);                    
                        int fileSize = (int)new System.IO.FileInfo(realpath).Length;
                        while (fileSize > 100000) //If Larger than 100KB
                        {
                            SaveJpeg(realpath, FullsizeImage);
                            fileSize = (int)new System.IO.FileInfo(realpath).Length;
                        }



 private static ImageCodecInfo GetEncoderInfo(string mimeType)
    {
        // Get image codecs for all image formats 
        ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();

        // Find the correct image codec 
        for (int i = 0; i < codecs.Length; i++)
            if (codecs[i].MimeType == mimeType)
                return codecs[i];
        return null;
    }

    public static void SaveJpeg(string path, Image img)
        {


            Image …
Run Code Online (Sandbox Code Playgroud)

c# reduce image-size

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

标签 统计

c# ×1

comments ×1

google-crawlers ×1

googlebot ×1

html ×1

image-size ×1

reduce ×1

seo ×1