我试图告诉谷歌和其他搜索引擎不要抓取我的网页的某些部分.
我所做的是:
<!--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标记内仍在渲染元素.
难道我做错了什么?
我在调用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)